Re: Stupid newbie question...
Re: Stupid newbie question...
- Subject: Re: Stupid newbie question...
- From: Pandaa <email@hidden>
- Date: Fri, 27 May 2005 02:32:22 +0200
27 maj 2005 kl. 00.02 skrev Brian O'Brien:
Honestly!
I have two radio buttons and I can't figure out how to find out
which state the set is in...
The object thats passed to my action is an NSMatrix.
I assume this is a matrix of buttons and I guess I'm supposed to be
able to go through each one and figure out
which is the currently selected button..
Help?
You can use -(id)selectedCell to find out which of your radio button
cells are selected. From the documentation:
"- (id)selectedCell
Returns the most recently selected cell, or nil if no cell is
selected. If more than one cell is selected, this method returns the
cell that is lowest and farthest to the right in the receiver."
To distinguish between your two button cells, you can set their tags
to unique values in Interface Builder and then query the return value
of [matrix selectedCell] with a -(int)tag message. You can then send
- (BOOL)selectCellWithTag:(int)aTag to the NSMatrix instance to
select one of the cells programatically.
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .
. email@hidden . . www.synapticpulse.net .
_______________________________________________
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