Re: DotView.m
Re: DotView.m
- Subject: Re: DotView.m
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 7 Nov 2001 03:49:56 -0800
On Wednesday, November 7, 2001, at 02:34 AM, Graeme Phillipson wrote:
Hello,
Just ben going through the same book myself.
On Wednesday, November 7, 2001, at 10:12 AM, Craig Bakalian wrote:
Is the [self setNeedsDisplay:YES] message firing the -(void)drawRect:
(NSRect)rect? I know this is not good MVC but couldn't DotView.m
replace
[self setNeedsDisplay:YES] with [self drawRect: (NSRect)frame?
But you need the frame in question (NSRect)frame. When you call the set
needs display it does a lot of work, like clearing what was there
before.
No, -setNeedsDisplay just sets a flag which the superview will check the
next time through the event loop to decide whether to send a -drawRect:
message.
I've also noticed that the NSView implements double buffering for you,
that is you draw not directly on the screen but into a off-screen
buffer which is copied onto the screen when your done.
No, NSWindow does the double-buffering.
-jcr
"These kids today don't know the simple joy of saving four bytes of
page-0 memory on a 6502" - unknown
References: | |
| >Re: DotView.m (From: Graeme Phillipson <email@hidden>) |