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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to