Re: Bindings and Buttons
Re: Bindings and Buttons
- Subject: Re: Bindings and Buttons
- From: Andreas Mayer <email@hidden>
- Date: Thu, 22 Jul 2004 17:27:20 +0200
Am 21.07.2004 um 23:34 Uhr schrieb David Webster:
I would like to use bindings to enable/disable buttons based on the
on/off state of other buttons.
You really shouldn't do that.
Instead your On/Off button should alter the state of some model data.
Then you bind the enabled property of your second button to that model
property through a controller.
The model controller might of course be the File's Owner. In that case
you'll need an outlet to the first button (button1) and a variable to
hold the state:
IBOutlet NSButton *button1;
BOOL button1State;
Now bind both, button1's 'value' binding and button2's 'enabled'
binding, to <controller>.selection.button1State. Done.
Andreas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.