Re: setting up radio buttons
Re: setting up radio buttons
- Subject: Re: setting up radio buttons
- From: Gordon Apple <email@hidden>
- Date: Wed, 19 Sep 2007 19:28:55 -0500
Just connect the matrix to an action and read the cell and cell tag;
- (IBAction)radioModeMatrixAction:(id)sender
{
id selectedCell = [sender selectedCell];
if (selectedCell)
{
userResponse = [selectedCell tag];
}
}
You can connect an outlet to the matrix to set the initial choice if
desired:
[radioButtons selectCellWithTag:0]; // Or whatever tag
I think you could also do a series of them with the same action method
if you first check the matrix tag for each set before getting the selected
cell. I recently set up a sheet controller to do this.
> I am trying to set up a series of radio buttons. I have used matrices
> before, and they worked fine, but for some reason, I can't find any
> examples on how to get radio buttons to work.
>
> I declared the radio button outlet as an NSButtonCell and connected
> the GUI to the instantiated controller object. But when I try to get
> the state, the values are wrong. For three buttons, titled TAB,
> COMMA, and OTHER, I get the following logs when attempting to get the
> state for all three.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden