My interface has a number of buttons which are a subclass of NSButton I've named "StickyOnButton". That means they mimic the behavior of radio buttons or tabs/tab panels-- once you click one On, clicking it again does nothing. It can only be turned Off by turning On another one of the group.
And that means that I need to use setState:false programmatically to turn the previous button Off when the next button is clicked On.
And that means that the binding to NSUserDef'sCon'r is not tripped-- the value is not updated by a call to setState.
I would like to override setState in my StickyOnButton class, (and it strikes me as appropriate), like:
Maybe someday it will all seem very simple to me, but right now the docs are killing me; nothing seems to remotely fit.
Can anyone help? Is it even possible with the public API?
And that means that I need to use setState:false programmatically to turn the previous button Off when the next button is clicked On.
And that means that the binding to NSUserDef'sCon'r is not tripped-- the value is not updated by a call to setState.
I would like to override setState in my StickyOnButton class, (and it strikes me as appropriate), like:
Code:
- (void)setState:(NSInteger)value {
[super setState:value];
if ( value ) return;
// This line can only be reached from my own code
anyoneWhoIsObservingMePleaseUpdateAnyBoundKeyToTheNewValue();
}
Maybe someday it will all seem very simple to me, but right now the docs are killing me; nothing seems to remotely fit.
Can anyone help? Is it even possible with the public API?