Re: Bindings NSMatrix
Re: Bindings NSMatrix
- Subject: Re: Bindings NSMatrix
- From: Ricky Sharp <email@hidden>
- Date: Tue, 15 Mar 2005 18:08:09 -0600
On Mar 15, 2005, at 3:39 PM, Ricky Sharp wrote:
On Mar 15, 2005, at 2:36 PM, Chris Outwin wrote:
What is the correct way to bind a matrix containing two radio buttons
so the previously selected button is turned off? Can I use any of
the Value Selection properties seen the the NSMatrix Info inspector?
I have the app working by using Value seen in the NSButtonCellInfo
inspector, but this requires me to turn the unselected button off
via code.
You shouldn't have to manually manage the radio button states. When
you select the matrix in IB and bring up its attributes, which "Mode"
is selected? It should have a tracking mode of "Radio".
To better answer the question, I typically bind radio groups using
NSMatrix's selectedIndex or selectedTag. The former is good enough if
the order of your radio buttons will always be a constant. The latter
is best if you want to abstract yourself away from the physical order.
For example, in IB (I'm using the version that came with Xcode 1.5 and
running this on 10.3.8), drag a radio group (NSMatrix) and NSTabView to
a window. Bind both the NSMatrix and NSTabView selectedIndex to Shared
User Defaults using a key of tabIndex. Then test the interface.
Note that the first time you run, you'll need to either click on one of
the radio buttons or tabs to get a proper value stored for the tabIndex
key. But thereafter, clicking or using the keyboard (will full
keyboard access enabled) does the right thing. In no case would you
need to programatically set your radio button states.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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