home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!caen!sol.ctr.columbia.edu!sol.ctr.columbia.edu!mhall
- From: mhall@occs.cs.oberlin.edu (Matthew Hall)
- Subject: Problem with DrawString and ScreenSavers.
- Organization: Oberlin College Computer Science
- Message-ID: <MHALL.92Sep8223855@occs.cs.oberlin.edu>
- Distribution: comp.sys.mac.programmer
- Sender: news@ctr.columbia.edu (The Daily Lose)
- Date: Wed, 9 Sep 1992 03:38:55 GMT
- X-Posted-From: occs.cs.oberlin.edu
- X-Posted-Through: sol.ctr.columbia.edu
- Lines: 54
-
-
- Hello-
-
- I am having a problem with an app I am writing. Basically, when the
- mouse is in a bar graph, I draw the coordinates of the mouse and the
- height of the bar in a box at the bottom of the window, using
- drawstring, with the textmode set to patcopy.
-
- var TheCoordBox : rect;
-
- Procedure CoordBox (TheStr : str255);
- var ExtraEraseRect : rect;
- begin
- with TheCoordBox do
- begin
- SetPort(GraphWind)
- moveto(left,bottom);
- DrawString(TheStr);
- {Below is to erase extra stuff from previous string}
- SetRect(ExtraEraseRect,left+StringWidth(TheStr),top,right,bottom);
- EraseRect(ExtraEraseRect);
- end;
- end;
-
- Now normally this works fine. However, this quantity that it displays
- can change over time, and if it does, I redraw the box. This too
- works fine.
-
- However, after 10 minutes, AfterDark kicks in. If I redraw the box,
- the string is written over the screensaver, leaving an ugly white box
- on the screen and ruining the purpose of the screensaver. The odd
- thing is, only the string is written over the screensaver graphics.
- (Since I am using textmode(PatCopy), the string is enclosed by a white
- box) The EraseExtraRect doesn't affect the screensaver.
-
- Now, I know this is a minor quibble, but why does DrawString write
- over the screensaver when eraserect doesn't? Can I possibly stop it
- from doing this?
-
- Thanks for your help
- -matt hall
-
-
- --
-
-
- -------------------------------------------------------------------------------
- Matt Hall. mhall@occs.cs.edu OR SMH9666@OBERLIN.BITNET
- (216)-775-5805 (That's a Cleveland Area code. Lucky Me)
-
- "If a man comes up to you and says:
- 'A dog just carried away your ear.'
- Do you run after the dog, or search first for your ear?" - Moon over Morocco
-
-