• 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: Windows and views and controls, oh my!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Windows and views and controls, oh my! (From: William Squires <email@hidden>)
 >Re: Windows and views and controls, oh my! (From: Ken Thomases <email@hidden>)
 >Re: Windows and views and controls, oh my! (From: N!K <email@hidden>)
 >Re: Windows and views and controls, oh my! (From: Quincey Morris <email@hidden>)
 >Re: Windows and views and controls, oh my! (From: N!K <email@hidden>)

  • Prev by Date: Re: nonatomic vs atomic assign/retain
  • Next by Date: Re: Windows and views and controls, oh my!
  • Previous by thread: Re: Windows and views and controls, oh my!
  • Next by thread: Re: Windows and views and controls, oh my!
  • Index(es):
    • Date
    • Thread