Re: DotView.m
Re: DotView.m
- Subject: Re: DotView.m
- From: John Hörnkvist <email@hidden>
- Date: Wed, 7 Nov 2001 14:19:52 +0100
On Wednesday, November 7, 2001, at 02:01 , Graeme Phillipson wrote:
OK, I got the details wrong! (must remember to double check next time I
post) But all the same the point is that the reason you must use
setNeedsDisplay rather than calling drawRect directly is that it gives
the framework a chance to do some work for you. Like double buffering.
Not double buffering; that's handled at the window level, and happens
when you do the drawing, but merging of multiple setNeedsDisplay: and
setNeedsDisplayInRect:.
If you really need to do immediate drawing, without going through
setNeedsDIsplay:, then you lock focus first;
[view lockFocus];
[view drawRect:someRect];
[view unlockFocus];
For the thrill seekers, you can do interesting things by locking focus
on other images or views:
[image lockFocus];
[view drawRect:someRect];
[image unlockFocus];
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com
References: | |
| >Re: DotView.m (From: Graeme Phillipson <email@hidden>) |