Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
- Subject: Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 2 Apr 2004 07:46:15 -0700
On Apr 1, 2004, at 11:18 PM, Drew McCormack wrote:
- (void)drawRect:(NSRect)rect
{
[_cachedImage release];
_cachedImage = [[NSImage alloc] initWithSize:[self
frame].size];
[_cachedImage lockFocus];
[_component drawInPlotView:self]; // This code includes the
NS_DURING block
[_cachedImage unlockFocus];
[_cachedImage compositeToPoint:rect.origin fromRect:rect
operation:NSCompositeSourceOver];
}
Out of curiosity, is there any reason why you can't put the entire draw
operation into the exception handler? Maybe switching exception
handlers before unlocking the focus, as you appear to be doing here, is
screwing things up... So maybe putting the NS_DURING before -lockFocus
would help. I'm not sure, but that's what I'd try first.
Nick Zitzmann
<
http://www.chronosnet.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.