Re: Embedding a Check Box in an NSTableView
Re: Embedding a Check Box in an NSTableView
- Subject: Re: Embedding a Check Box in an NSTableView
- From: Hiro Fujimoto <email@hidden>
- Date: Fri, 2 Apr 2004 13:42:33 +0900
Bruce,
Yes, its possible.
To put check box in the column ...
NSTableColumn* checkColumn = [aTable
tableColumnWithIdentifier:@"check"];
NSButtonCell* checkBoxCell = [NSButtonCell new];
[checkBoxCell setButtonType:NSSwitchButton];
[checkColumn setDataCell:checkBoxCell];
and set Boolean value ...
return [NSNumber numberWithBool:YESorNO]
as return value of
- (id) tableView:(NSTableView*)aTableView
objectValueForTableColumn:(NSTableColumn*)aTableColumn
row:(int)rowIndex;
Good luck.
--
On 2004/04/02, at 12:37, Bruce Truax wrote:
>
I have a table view where one column is displaying a boolean value.
>
Is it
>
possible to put a check box in this column to display and allow
>
changing the
>
state of the boolean value?
>
>
In another case I also need to display a boolean value but in this
>
case it
>
it mutually exclusive. In other words, for all of the items in the
>
table,
>
only one true value is allowed and the rest must be false. In this
>
case it
>
would be ideal if I could use an array of radio buttons. Is this
>
possible?
>
>
Bruce
>
>
--
>
_____
------------------------------------------------------------------------
---------
hiro FUJIMOTO - developer in Japan.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.