[futurebasic] RE: [FB] White Dot Problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: "Rowe, Lorin" <lorin.rowe@...>
Date: Thu, 24 Jun 1999 14:54:20 -0700
In a past programming experience I believe I had similar problems to yours.
That is portions of my window had spots that were either blank or erased.  I
had occasion to read a FAQ that had perfect bearing on this single problem
and although I have not tried to test out your white dot problem.  Perhaps
this note from "www.stazsoftware.com"  web site will help answer why you are
experiencing problem drawing in windows and seeing white spots.  

"Why is my window erased after I draw in it?

You should never draw into a window until you have received an update event.


Here's an explanation of how the Mac handles updates and why you should
react at the proper time: 
When a window is built or brought forward, most often all of part of its
content must be refreshed. The window
manager collects these "clobbered" areas in a structure called an update
region (sometimes called the clobbered
region). You can force pieces of a window to be added to this region by
calling CALL INVALRECT(t), and force
pieces to be subtracted from the region by calling CALL VALIDRECT(t). 
                          
When nothing else is going on in MacDom, the Window Manager looks around to
see what needs to be fixed and
sees that it has an update region for your window. It builds a fake event
(_updatEvt) and sends it through the event queue. 
                          
FutureBASIC sees the update event and calls BEGINUPDATE. This swaps the
visible region with the clobbered region.
FB then erases the clobbered area, redraws all controls and fields, then
calls your program to do its drawing via the _updatEvt. When your program
receives the _updatEvt event, you are expected to draw the windows contents.
When everything is finished, FB calls ENDUPDATE to reset all regions back to
normal. 
                          
Remember: anytime a window is built, the Window Manager automatically sends
you an update event - without fail. You can count on it. 
                          
If you draw into a window when it is first built or when some button is
clicked or a menu item is selected, rather
than in response to an update event, the update sequence will erase your
work; and after the update you'll be looking a blank window. 

Always do your drawing in response to update events. "





-----Original Message-----
From: Robert Covington [mailto:t88@...]
Sent: Thursday, June 24, 1999 7:05 AM
To: futurebasic@...
Subject: Re: [FB] White Dot Problem


>Hi;
>
>In fooling around with Robert Covington's problem with
>a white pixel at (0,0) I happened to change the
>CALL SETRECT(rect,0,0,400,400)
>to:
>CALL SETRECT(rect,1,1,400,400)
>
>in the DrawTest function
>AND interestingly the problem disappeared.
>
>So why doesn't SETRECT work with 0.0?


Sorry to bust a bubble here, but did you notice that doing that left a
horizontal line at y=0 unpainted, and a vertical line at x=o unpainted? :)
That is why you don't see a white dot, because there is now a 1 pixel wide
line of white there framing the picture halfway.

Got my hopes up only to be crushed again. :(  This Dotth Vader needs to be
vanquished I tell you.

Robert Covington
Inventor, Click of Dotth
"Stop Funding The DOT"




--
To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>