Re: Custom radio button failure with bindings
Re: Custom radio button failure with bindings
- Subject: Re: Custom radio button failure with bindings
- From: Ricky Sharp <email@hidden>
- Date: Wed, 23 Feb 2005 12:21:00 -0600
I've decided to go down a different path with bindings for my custom controls/cells.
I still do not understand exactly why I had different behaviors with my radio buttons (depending if keyboard or mouse was used to change the selection), but I think it stems from the fact that too much is happening under the covers with NSButtonCell.
In fact, I tried one last time to subclass NSButtonCell to provide my own look-and-feel. My thought here was I should gain all the exposed bindings of NSButtonCell, yet have my own appearance. That effort just ended this morning and it failed miserably :P
Anyhow, my IIButton and IIButtonCell classes derive from NSControl and NSActionCell respectively. Certain inherited bindings such as hidden and enabled can be currently used. Others, such as value, cause grief. What I'll thus do is expose my own bindings. For example, I plan to expose 'state' on my button objects which map to the state attribute. To address the problems with the custom radio group (subclass of NSMatrix), I'll expose a 'selectedRadioButton' binding. Note that I'll most likely name the bindings uniquely (i.e. use my two-letter prefix) to avoid any possible collisions.
While on one had this will be more work, I have a feeling that it's the best thing to do. Perhaps this is a trade-off; either use the standard widgets and gain their bindings, or roll your own widgets and expose your own bindings. Attempting to use 'inherited' bindings with custom widgets mostly caused problems.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden