• 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: NSTableView and check boxes (for the hundredth time)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView and check boxes (for the hundredth time)


  • Subject: Re: NSTableView and check boxes (for the hundredth time)
  • From: j o a r <email@hidden>
  • Date: Thu, 3 Oct 2002 12:29:35 +0200

Try something like this instead. I set the button state in willDisplayCell:

- (void) awakeFromNib
{
NSButtonCell *bCell = [[NSButtonCell alloc] init];
[bCell setButtonType: NSSwitchButton];
[bCell setImagePosition: NSImageOnly];
[enableColumn setDataCell: bCell];
[bCell release];
}

- (void) tableView:(NSTableView *) tableView willDisplayCell:(id) cell forTableColumn:(NSTableColumn *) tableColumn row:(int) row
{
if (tableColumn == enableColumn)
{
[cell setState: NSOffState]; // Or NSOnState
}
}

As a side note you can see that I don't use the table column identifier - I think it's much more slick to hook up the table columns in IB and be able to refer to them directly.

j o a r
_______________________________________________
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.

References: 
 >NSTableView and check boxes (for the hundredth time) (From: Jan Van Tol <email@hidden>)

  • Prev by Date: Re: Bochs - Free PC emulator
  • Next by Date: Re: How to organize an app (baffled with Accessor methods)
  • Previous by thread: NSTableView and check boxes (for the hundredth time)
  • Next by thread: Re: NSTableView and check boxes (for the hundredth time)
  • Index(es):
    • Date
    • Thread