Using Bindings for a toggle control
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