• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Bug in Cocoa drawing? (was 'Changing subviews during drawing') (From: Drew McCormack <email@hidden>)

  • Prev by Date: Re: Java or Objective-C for Cocoa?
  • Next by Date: Re: AuthorizationExecuteWithPrivileges, night of the living dead
  • Previous by thread: Re: Bug in Cocoa drawing? (was 'Changing subviews during drawing')
  • Next by thread: Warning about NS_DURING (was "Bug in Cocoa drawing?")
  • Index(es):
    • Date
    • Thread