Re: A Question about radio buttons...
Re: A Question about radio buttons...
- Subject: Re: A Question about radio buttons...
- From: Ricky Sharp <email@hidden>
- Date: Mon, 04 Apr 2005 13:45:46 -0500
On Monday, April 04, 2005, at 01:11PM, Brian O'Brien <email@hidden> wrote:
>I have a few radio buttons on my application.
>I set up actions to handle events from these buttons.
>I am wondering how I can get the currently selected value of the radio
>button.
>Also I'm wondering if maybe they should have been setup as outlets...
I'm not sure why you'd want to have your buttons fire some action; usually they are to allow the user to make a mutually exclusive choice.
Are you using the actions to set something in your model (i.e. which choice the user has selected)? In that case, if not using bindings, see selectedCell in NSMatrix. Once you get the cell, you can obtain its tag by sending it a tag message.
If using bindings, just bind selectedTag or selectedIndex. I tend to use the former as it shields me from the physical order of the radio buttons.
--
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