home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15191 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.2 KB  |  68 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!caen!sol.ctr.columbia.edu!sol.ctr.columbia.edu!mhall
  3. From: mhall@occs.cs.oberlin.edu (Matthew Hall)
  4. Subject: Problem with DrawString and ScreenSavers.
  5. Organization: Oberlin College Computer Science
  6. Message-ID: <MHALL.92Sep8223855@occs.cs.oberlin.edu>
  7. Distribution: comp.sys.mac.programmer
  8. Sender: news@ctr.columbia.edu (The Daily Lose)
  9. Date: Wed, 9 Sep 1992 03:38:55 GMT
  10. X-Posted-From: occs.cs.oberlin.edu
  11. X-Posted-Through: sol.ctr.columbia.edu
  12. Lines: 54
  13.  
  14.  
  15. Hello-
  16.  
  17. I am having a problem with an app I am writing.  Basically, when the
  18. mouse is in a bar graph, I draw the coordinates of the mouse and the
  19. height of the bar in a box at the bottom of the window, using
  20. drawstring, with the textmode set to patcopy.
  21.  
  22. var TheCoordBox : rect;
  23.  
  24. Procedure CoordBox (TheStr : str255);
  25. var ExtraEraseRect : rect;
  26. begin
  27.   with TheCoordBox do  
  28.     begin
  29.       SetPort(GraphWind)
  30.       moveto(left,bottom);
  31.       DrawString(TheStr);
  32.       {Below is to erase extra stuff from previous string}
  33.       SetRect(ExtraEraseRect,left+StringWidth(TheStr),top,right,bottom);
  34.       EraseRect(ExtraEraseRect);
  35.     end;
  36. end;  
  37.  
  38. Now normally this works fine.  However, this quantity that it displays
  39. can change over time, and if it does, I redraw the box.  This too
  40. works fine.
  41.  
  42. However, after 10 minutes, AfterDark kicks in.  If I redraw the box,
  43. the string is written over the screensaver, leaving an ugly white box
  44. on the screen and ruining the purpose of the screensaver.  The odd
  45. thing is, only the string is written over the screensaver graphics.
  46. (Since I am using textmode(PatCopy), the string is enclosed by a white
  47. box) The EraseExtraRect doesn't affect the screensaver.
  48.  
  49. Now, I know this is a minor quibble, but why does DrawString write
  50. over the screensaver when eraserect doesn't?  Can I possibly stop it
  51. from doing this?
  52.  
  53. Thanks for your help
  54. -matt hall
  55.  
  56.  
  57. --
  58.  
  59.  
  60. -------------------------------------------------------------------------------
  61. Matt Hall.    mhall@occs.cs.edu  OR  SMH9666@OBERLIN.BITNET
  62.               (216)-775-5805 (That's a Cleveland Area code. Lucky Me)
  63.  
  64. "If a man comes up to you and says:
  65.     'A dog just carried away your ear.'
  66. Do you run after the dog, or search first for your ear?" - Moon over Morocco
  67.   
  68.