Re: Radio Buttons in NSTableView
Re: Radio Buttons in NSTableView
- Subject: Re: Radio Buttons in NSTableView
- From: Andy Lee <email@hidden>
- Date: Sat, 16 Jun 2007 11:19:37 -0700
On Friday, June 15, 2007, at 03:27PM, "Hendrik Holtmann" <email@hidden> wrote:
>I got an NSTableView that is populated by an NSArrayController.
>I want the first column to be displayed as a radio button and only one
>item should be selectable in this column (real radio button behavior).
I see that NSArrayController has -setAvoidsEmptySelection: but not a similar method for multiple selection. I would call -setAllowsMultipleSelection:NO on the table view, unless someone chimes in with a reason not to. The combination of these two constraints on the selection should give you the *behavior* you want.
If you really need to change the *appearance* to emphasize this behavior, I would try implementing the -tableView:willDisplayCell:forTableColumn:row: delegate method. Unlike a matrix of radio buttons, which has one cell instance per button, your table column is re-using one cell instance over and over to draw the cells in the first column.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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