Re: Creating a checkbox
Re: Creating a checkbox
- Subject: Re: Creating a checkbox
- From: Eric Peyton <email@hidden>
- Date: Thu, 11 Apr 2002 12:58:04 -0500
On Thursday, April 11, 2002, at 12:35 PM, Mike O'Connor wrote:
I have a table where one column contains checkboxes and another contains
sliders. So I have to set this up programmatically.
How do I create a checkbox? Looks like I start with an NSButton, but
how do
I set it up? IB has a "checkbox" button type, but I can't really tell
what
it's doing.
Set the cell for the column to be a button
[checkColumn setDataCell:[[NSButtonCell alloc] init]];
Then, when the cell is being displayed using ...
- (void)outlineView:(NSOutlineView *)ov willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
if (tableColumn == fileCheckColumn) {
[cell setButtonType:NSSwitchButton];
[cell setControlSize:NSSmallControlSize];
[cell setAllowsMixedState:YES]; (if you want to
allow 3 state checkboxes)
[cell setState:NO];
[cell setAction:@selector(your_action:)];
}
}
Eric
The slider column is easy, but I'd like it to be the "small" version.
How do
I set up the "small" version? Again, IB has a setting for this but I
can't
tell exactly what it's adjusting and by how much.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.