Re: Windows and views and controls, oh my!
Re: Windows and views and controls, oh my!
- Subject: Re: Windows and views and controls, oh my!
- From: Ron Hunsinger <email@hidden>
- Date: Wed, 07 Sep 2011 11:44:40 -0700
On Sep 7, 2011, at 11:19 AM, N!K wrote:
> What I'm trying to do is really very simple. I want a pushbutton to seek data input for the model (easily done). Then I want a pushbutton to display two different views of the data.
The pushbutton sets a flag indicating which view of the data should be displayed, and then invokes setNeedsDisplay:YES on the view.
By and by, the view's drawRect: handler gets invoked, and consults the flag to tell it which view of the data to draw.
Notice the two different uses of the word "view". There's a "view" (an instance of (a subclass of) NSView) that receives the setNeedsDisplay: and drawRect: messages, and there's the "view of the data" which is the image that the "view" draws. The point is that you don't need to load different NSView instances to draw two different images. It's enough to have one NSView instance that knows what to draw at any given time.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden