home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / apps / text_ed / scribe12 / scrlfix / scrolfix.doc < prev   
Text File  |  1992-03-24  |  3KB  |  74 lines

  1.                             SCROLFIX
  2.             Desk Accessory (including source code) is
  3.                 Public Domain, 03/92, by Ian Lepore
  4.                 
  5.  
  6. Starting with TOS 1.04 (aka 1.4), a system bug causes some windowed 
  7. programs to scroll twice when you click once on a window scroller.
  8. Charles Johnson soon released a fix for the problem called BUTTNFIX,
  9. and it worked quite well on most systems.  But, a few folks (especially
  10. TT owners) have reported that BUTTNFIX doesn't cure the double-scroll
  11. problem unless you actually open the DA after you've started an 
  12. application that uses scrolling windows.
  13.  
  14. SCROLFIX cures that problem in a purely brute-force manner.  When it
  15. receives an AC_CLOSE message (indicating an application has just 
  16. started or ended), it waits 3 seconds, then recycles itself through
  17. its main event loop.  It's not elegant, but it seems to do the trick,
  18. and it doesn't put any extra performance overhead on your system.  (In
  19. fact, SCROLFIX uses a couple hundred bytes less memory than BUTTNFIX.)
  20.  
  21. All you have to do is copy SCROLFIX.ACC to your boot drive, and then 
  22. forget about it after that.  It uses about 800 bytes of memory.  It
  23. should be perfectly compatible with MultiDesk and the like, but of 
  24. course it won't fix the scroll bug while it's not actively loaded.
  25.  
  26. Notes for programmers:
  27.  
  28. If you're writing a program that has scrolling windows, and you want to
  29. eliminate the double-scroll problem without relying on SCROLFIX or 
  30. BUTTNFIX being present on the user's system, you're in luck.  It seems
  31. that the fix is quite simple:  your program just has to wait for a 
  32. double-click at least once after it starts.  If your main event loop 
  33. already includes double-clicks as one of its events to wait for, then
  34. you're all set.  If not, just put a piece of code such as the following
  35. in your initialization block, perhaps right after your appl_init():
  36.  
  37.     XMULTI xm;
  38.     
  39.     xm.mflags    = MU_BUTTON | MU_TIMER;
  40.     xm.mbclicks  = 2;
  41.     xm.mbmask    = 1;
  42.     xm.mbstate   = 1;
  43.     xm.mtlocount = 1;
  44.     xm.mthicount = 0;
  45.     
  46.     evnx_multi(&xm);
  47.     
  48.  This just waits for either a double-click or a 1 millisecond timer
  49. event.  The double-click is unlikely to happen during program startup,
  50. so the timer event ensures that you get control back right away.  So
  51. far, this seems to be a pretty foolproof method.  As long as your 
  52. program has waited for a d-click at least once, it won't get bitten
  53. by the double-scroll bug.  
  54.  
  55. Release of rights:
  56.  
  57. This DA and the source code is in the public domain, do with it what 
  58. you please.  When you redistribute this, I'd prefer that you keep the
  59. DA, source code, and this doc together.
  60.  
  61. Ian Lepore
  62. moderator, BIX atari.st and c.language conferences
  63. 03/92
  64.  
  65. --------------------------------------------------------
  66.                    < OK TO PORT >
  67. This information comes from the atari.st conference
  68. on BIX (r), the BYTE Information Exchange.
  69.  
  70. For additional information about BIX, call 800-227-2983
  71. or 603-924-7681.
  72. ---------------------------------------------------------
  73.  
  74.