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

  1. Path: sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!waikato.ac.nz!ldo
  2. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Toolbox init (was Re: What is a memory error -113 ?)
  5. Message-ID: <1992Aug13.181036.10085@waikato.ac.nz>
  6. Date: 13 Aug 92 18:10:36 +1200
  7. References: <1992Aug11.152914.18785@uni-paderborn.de> <13992@gazette.bcm.tmc.edu> <1992Aug13.031241.9631@gallant.apple.com>
  8. Organization: University of Waikato, Hamilton, New Zealand
  9. Lines: 42
  10.  
  11. In article <1992Aug13.031241.9631@gallant.apple.com>, dodd@apple.com (Mike Dodd) writes:
  12. >
  13. > void initToolbox(void)
  14. > {
  15. >     MaxApplZone();
  16. >     InitGraf(&qd.thePort);
  17. >     InitFonts();
  18.  
  19. Technically speaking, you're supposed to call InitFonts *before* InitGraf.
  20. Not that I've ever experienced any problems from doing it the other way
  21. round...
  22.  
  23. >     InitWindows();
  24. >     FlushEvents(0xffff,0);
  25.  
  26. Personally I prefer to do a FlushEvents *after* all my program setup.
  27. By the way, did you know that FlushEvents does a logical-and of the
  28. mask you pass it with the low-memory global FlEvtMask? And that the
  29. usual value for FlEvtMask is all 1's except for the diskEvt bit?
  30. I don't recall seeing this documented anywhere. Initially I used to
  31. worry about excluding the diskEvt bit from the FlushEvents mask myself,
  32. because I always felt that disk-insertion events were something that
  33. you would almost *never* want to flush.
  34.  
  35. >     InitMenus();
  36. >     TEInit();
  37. >     InitDialogs(0);
  38. >     InitCursor();
  39. > }
  40.  
  41. On a related note, I've wondered whether the Mac could do with something
  42. like a special key combination so the user can cancel all pending mouse
  43. clicks and keystrokes--effectively be able to invoke FlushEvents at any time.
  44. Sometimes you may type ahead or "mouse ahead"--and then you may want to
  45. change your mind...
  46.  
  47. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  48. Computer Services Dept                     fax: +64-7-838-4066
  49. University of Waikato            electric mail: ldo@waikato.ac.nz
  50. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  51. "You don't need floppies in an open client/server environment."
  52.                 -- quote in a recent Computerworld
  53.