home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14075 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  2.2 KB

  1. Path: sparky!uunet!wupost!waikato.ac.nz!ldo
  2. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: FlushEvents necessary?
  5. Message-ID: <1992Aug17.183233.10148@waikato.ac.nz>
  6. Date: 17 Aug 92 18:32:33 +1200
  7. References: <1992Aug11.152914.18785@uni-paderborn.de> <13992@gazette.bcm.tmc.edu>  <hammett.714004576@sbsu1.aukuni.ac.nz>
  8. Organization: University of Waikato, Hamilton, New Zealand
  9. Lines: 34
  10.  
  11. In article <hammett.714004576@sbsu1.aukuni.ac.nz>, hammett@sbsu1.aukuni.ac.nz (Tim Hammett) writes:
  12. > ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  13. >>>     InitWindows();
  14. >>>     FlushEvents(0xffff,0);
  15. >
  16. >>Personally I prefer to do a FlushEvents *after* all my program setup.
  17. >
  18. > Is it necessary to do FlushEvents() at all these days? I notice that most
  19. > of the DTS sample Apps don't. I would be interested in hearing the pros
  20. > and cons of using FlushEvents at program startup.
  21.  
  22. The reason for calling FlushEvents isn't technical, it's to do with the
  23. user interface. While the program is starting up, the user might have clicked
  24. the mouse, or pressed a few keys. It makes sense to flush all these before
  25. actually entering your event loop for the first time, to avoid any unexpected
  26. behaviour.
  27.  
  28. Actually there's no reason why program startup should be special; it also
  29. makes sense to call FlushEvents after doing *any* potentially lengthy operation,
  30. during which you aren't able to give user feedback. For example, a screen
  31. update in ditherCopy mode. Or a file access to a VAXshare server.
  32.  
  33. Thot: in the old floppy-based days, programs took quite a long while to
  34. start up. These days it's not so bad, though programs like PageMaker,
  35. FreeHand, Premiere, Canvas and others seem to hint at a trend back to the
  36. slow old days...
  37.  
  38. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  39. Computer Services Dept                     fax: +64-7-838-4066
  40. University of Waikato            electric mail: ldo@waikato.ac.nz
  41. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  42. PC operating environments: DOS is the leading software operating environment
  43. (73%), followed by Microsoft Corp.'s Windows (18%), Unix (8%) and the Macintosh
  44. environment (3%).            -- Computerworld August 3 report on USSR.
  45.