• 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
Using Bindings for a toggle control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Bindings for a toggle control


  • Subject: Using Bindings for a toggle control
  • From: Paul Thomas <email@hidden>
  • Date: Thu, 26 Apr 2007 09:50:56 +0100

Hi,

I'd like to use bindings for a toggle control and I can't work out how best to do it.

I have a state dependent control that appears in the menu and as a push button, so I'd like to use a controller. The thing is that I want to change the selector and the title of the button to show the action automatically (same for the menu I guess). I can't see a way to do this via the bindings options.

To make it a little more concrete, what I'm looking at is a Play/ Pause button that
- displays "Play" and is bound to -play: when -isPlaying is NO
- displays "Pause" and is bound to -pause: when -isPlaying is YES


So I thought a controller with 2 key paths would do the job but I can't see how to coerce NSObjectController to do this for me. Is this trivial? Or do I have to code it up?

thanks,
Paul.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Using Bindings for a toggle control
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Any way to find out user's default email client?
  • Next by Date: Re: Using Bindings for a toggle control
  • Previous by thread: [SOLVED] CFPropertyListWriteToStream and NSDictionary
  • Next by thread: Re: Using Bindings for a toggle control
  • Index(es):
    • Date
    • Thread