• 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: Xcode-users Digest, Vol 5, Issue 558
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode-users Digest, Vol 5, Issue 558


  • Subject: Re: Xcode-users Digest, Vol 5, Issue 558
  • From: Fritz Anderson <email@hidden>
  • Date: Sat, 30 Aug 2008 11:51:54 -0500

On 30 Aug 2008, at 10:28 AM, Roland Silver wrote:

My project has a window created by IB with four buttons, one of which is named "Play Piece", which I want to enable/disable. To do that, do I need an outlet for the button? If so, I don't see one: how do I create one?

Your controller object (which you've either instantiated in the NIB, or set as File's Owner for the NIB) should have an outlet that points to the button. Add an instance variable:


	IBOutlet NSButton *	playPieceButton;

to your controller class. (Interface Builder 2: Drag the controller's .h flag onto the NIB window.) Control-drag from the controller object in the NIB to the button. Accept the playPieceButton outlet for the connection. In your application, have your controller watch/be informed of the relevant model state, and setEnabled: as needed.

All the watching and enabling can be done with less, and simpler, code using bindings, but it's not a beginner technique.

	— F

 --
Fritz Anderson -- Xcode 3 Unleashed: Now Available -- http://x3u.manoverboard.org/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Xcode-users Digest, Vol 5, Issue 558 (From: Roland Silver <email@hidden>)

  • Prev by Date: Re: Xcode-users Digest, Vol 5, Issue 558
  • Next by Date: Re: .pkg, .dmg, etc
  • Previous by thread: Re: Xcode-users Digest, Vol 5, Issue 558
  • Next by thread: error exit
  • Index(es):
    • Date
    • Thread