Re: Combined objects (NSString and Switch checkbox)
Re: Combined objects (NSString and Switch checkbox)
- Subject: Re: Combined objects (NSString and Switch checkbox)
- From: Rakesh Pandey <email@hidden>
- Date: Fri, 17 Jan 2003 20:05:44 +0530
You can create an instance of NSButtonCell and attach with your
tableview column. You can use the title of NSButtonCell to show the
string you want.
[aCell setButtonType:NSSwitchButton];
[aCell setEnabled:YES];
[aCell setTitle:@""];
[[variablesTableView tableColumnWithIdentifier:k115_variableSelection]
setDataCell:aCell];
Yeah you will have to implement the
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn*)aTableColumn row:(int)rowIndex
{
if (aTableColumn == [variablesTableView
tableColumnWithIdentifier:k115_variableSelection])
{
//Your code to get the string tto show in title, obviously you will
have to get it from the datasourec of table.
//Say your title is in string newTitle then do
[aCell setTitle:newTitle];
}
}
Thanks & Regards
Rakesh
On Friday, Jan 17, 2003, at 15:19 Asia/Calcutta, Chad Armstrong wrote:
>
In my table, I want two elements, a checkbox and a string after it to
>
appear in one cell. Is this possible, and if so, when I call an
>
addObject method, how should I go about doing this? Should I create a
>
new class which contains the checkbox and string elements, and when I
>
do an addObject: I would do something like [myStuff addObject: [
>
[myClass alloc] init]]; (or something like that)?
>
>
Regards,
>
>
Chad Armstrong
>
_______________________________________________
>
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.