Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Bindings for a toggle control



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.