home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 21930 < prev    next >
Encoding:
Text File  |  1993-01-22  |  2.1 KB  |  45 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!usc!howland.reston.ans.net!sol.ctr.columbia.edu!eff!news.oc.com!spssig.spss.com!uchinews!quads!chh9
  3. From: chh9@quads.uchicago.edu (Conrad Halling)
  4. Subject: Re: Slow drawing under System 7
  5. Message-ID: <1993Jan21.204855.3849@midway.uchicago.edu>
  6. Sender: news@uchinews.uchicago.edu (News System)
  7. Reply-To: chh9@midway.uchicago.edu
  8. Organization: University of Chicago
  9. References: <1993Jan19.222529.1@cc.newcastle.edu.au>
  10. Date: Thu, 21 Jan 1993 20:48:55 GMT
  11. Lines: 32
  12.  
  13. In article <1993Jan19.222529.1@cc.newcastle.edu.au> 
  14.   cegrw@cc.newcastle.edu.au
  15.   (Dr Garry Willgoose: INTERNET cegrw@cc.newcastle.edu.au) writes:
  16.  
  17. >I have a program that basically puts up on screen a huge number of filled
  18. >rectangles. Just a plain loop with relevant QD commands and a call to
  19. >WaitNextEvent with wait time set to 0. Well this code has worked fine to ages
  20. >on a system 6 machine but when I moved it recently to a Powerbook 170 running
  21. >S7 it runs really slow ... unless I keep moving the mouse around and then it
  22. >runs just like before. Actually this same behaviour is shown by another
  23. >part of the code where a series of line segments is drawn so its not a 
  24. >function of the particular QD calls. The picture is being saved a PICT2 as the
  25. >pict is drawn.
  26.  
  27. The PowerBook goes into resting (idling or processor cycling) mode when
  28. certain activities are not occurring.  (One of the activities that prevents
  29. resting is moving the mouse.)  This is what is causing your
  30. program to slow down.  The net result is that PowerBook behaves as if
  31. the processor were running at 1 MHz.
  32.  
  33. Read chapter 31 of Inside Macintosh Vol VI about the Power Manger.  Your
  34. program needs to call Gestalt() to determine if the Power Manager is
  35. present (p. 31-12).  (The Power Manager is present only for the Portable
  36. and PowerBooks).  If the Power Manager is present, then call IdleUpdate()
  37. (p. 31-19) each time through your event loop when you're doing something
  38. significant.  If you have nothing to do on null events, then don't call
  39. IdleUpdate(), and the PowerBook can go into rest mode, which is a good
  40. thing for battery charging.
  41. -- 
  42. Conrad Halling
  43. c-halling@uchicago.edu
  44.  
  45.