Re: NSView and rectangle management
Re: NSView and rectangle management
- Subject: Re: NSView and rectangle management
- From: Brent Gulanowski <email@hidden>
- Date: Tue, 25 Jun 2002 16:39:42 -0400
On Tuesday, June 25, 2002, at 01:15 PM, Cameron Hayne wrote:
Paul Fox <email@hidden> wrote:
Consider this: I have an NSView, with two children. These children
implement my scrollbar (placed at the left and bottom of the
window). Now if I draw into this view, I currently have to send
a setNeedsDisplay: to the two children views, causing them to redraw
themselves
in their entirety. Visually this is ok, but CPU wise, it makes the
machine run like a dog with lead boots.
I may be missing something, but it seems to me that you ought to have an
NSView with *three* children:
1) your content view (the one in which you draw)
2) your horizontal scrollbar
3) your vertical scrollbar
In fact the NSScrollView's own "content view" is not for drawing
either, -- it is an NSClipView, and it has yet another child view,
nicknamed the document view, which is the one you draw into. At first it
seemed odd to me, but I've found it pretty easy to work with.
Brent
There are two kinds of people in the world, those who divide the kinds of
people in the world into two kinds, and those who don't.
_______________________________________________
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.