• 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: updating NSView subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: updating NSView subclass


  • Subject: Re: updating NSView subclass
  • From: Mike Ferris <email@hidden>
  • Date: Wed, 4 Dec 2002 12:50:45 -0800

If you're only invalidating the parts of the view that need redisplay (using -setNeedsDisplayInRect:) then the rectangle passed to -drawRect: will only be the part you need to redraw and you can pay attention to that in your implementation to avoid drawing stuff that falls outside the given rect. Note that NSView's display machinery can only handle a single invalid rect, so if you need to update one little rect in the upper-left and another little rect in the lower-right of the view, and you call -setNeedsDisplayInRect: with each little rect, by the time drawRect: gets called, the rect passed in will be the union of the two invalidations (in other words most or all of the view, in this case.)

Mike Ferris


Begin forwarded message:

From: Alexander White <email@hidden>
Date: Wed Dec 4, 2002 12:27:39 PM US/Pacific
To: email@hidden
Subject: updating NSView subclass

Hello,
I am writting an app that performs animation within an NSView subclass. The problem that I am having is that everytime I update the NSView with -drawRect I have to redraw the entire area rather than just the parts that have changes since the last update. Is there a better approach.
A.W.
_______________________________________________
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.
_______________________________________________
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: 
 >updating NSView subclass (From: Alexander White <email@hidden>)

  • Prev by Date: [ANN] SSHTunnelManager 1.0.1
  • Next by Date: Weird NSDrawer error...
  • Previous by thread: updating NSView subclass
  • Next by thread: Cocoa-Java????
  • Index(es):
    • Date
    • Thread