• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating a checkbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Creating a checkbox
      • From: Stéphane Sudre <email@hidden>
References: 
 >Creating a checkbox (From: "Mike O'Connor" <email@hidden>)

  • Prev by Date: Re: How to detect a single mouse click on a cell in a TableView?
  • Next by Date: Re: Creating a checkbox
  • Previous by thread: Creating a checkbox
  • Next by thread: Re: Creating a checkbox
  • Index(es):
    • Date
    • Thread