Re: NSBrowser with checkboxes?
Re: NSBrowser with checkboxes?
- Subject: Re: NSBrowser with checkboxes?
- From: Ron Fleckner <email@hidden>
- Date: Thu, 13 Dec 2007 14:02:26 +1100
On 13/12/2007, at 8:33 AM, Dave Camp wrote:
I need to create an NSBorwser where each cell also has a checkbox,
in addition to the normal image and text. I've checked the list
archives and circa 2004 the answer was to subclass NSBrowserCell
and subclass the NSMatrix the browser uses to intercept the click
and route it to the checkbox.
Is this still the recommended implementation, or is there an easier
way to do this now?
Thanks,
Dave
Hi Dave,
I haven't actually run this, but it does set up a switch button
(checkbox) in a table cell when I build and run. I used this method
to add a circular push button. This is taken from an example by Joar
Wingfors.
- (void)awakeFromNib
{
NSButtonCell *switchCell = [[[NSButtonCell alloc] init] autorelease];
[switchCell setButtonType:NSSwitchButton];
[switchCell setTitle:@"OK"];
[switchCell setControlSize:NSSmallControlSize];
[switchCell setTarget:self];
[myTableColumnOutlet setDataCell:switchCell];
}
HTH,
Ron
_______________________________________________
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