Re: Stopping a NSView from drawing in -drawRect
Re: Stopping a NSView from drawing in -drawRect
- Subject: Re: Stopping a NSView from drawing in -drawRect
- From: Phillip Hutchings <email@hidden>
- Date: Sat, 7 Feb 2004 00:45:17 +1300
That's what I thought, my current code is:
- (void)drawRect:(NSRect)rect
{
NSDisableScreenUpdates();
[self lockFocus];
[bgColour set];
[NSBezierPath fillRect:rect];
[fgColour set];
[trackTextView display];
if (gotImage == YES) {
[theArtwork compositeToPoint:imagePoint
operation:NSCompositeCopy];
}
[self unlockFocus];
NSEnableScreenUpdates();
}
I never call display explicitly, only setNeedsDisplay. This is in a
screensaver if it makes any difference.
On 7/02/2004, at 12:21 AM, James Chen wrote:
Hi,
It's a little weird.
The Window(Context) should be double buffered by default, unless you
changing it in some ways.
If not, I think this could be fixed by drawing appropriately.
Could you give us more clues about how you draw those widgets, such as
NSTextView, NSImage and background?
For example, Do you sending -display to your view during your drawing
or something like that?
In my opinion, you might flush the port buffer during you drawing
codes.
Hope this helps,
James
--
Phillip Hutchings
email@hidden
http://www.sitharus.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.