Re: ImageInTableview
Re: ImageInTableview
- Subject: Re: ImageInTableview
- From: Stefan Schüßler <email@hidden>
- Date: Sun, 10 Aug 2003 22:44:48 +0200
You have to set the cell to an NSImageCell. In awakeFromNib get the
appropriate column using NSTableView's tableColumnWithIdentifier:
method and set the type using NSTableColumn's setDataCell: method.
Stefan
Am Sonntag, 10.08.03 um 22:06 Uhr schrieb Mathew Peterson:
I want to place a small image in a tableview row for a certain column
when its called. This is the code I am using but its simply sending me
a description of the image (sure, the image is there...just not in the
right form).
How can I make the image display correctly?
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
if ([[aTableColumn identifier] isEqualToString:@"icon"])
{
return([NSImage imageNamed:@"library"]);
}
return([item objectAtIndex:rowIndex]);
}
Thanks,
Mat
_______________________________________________
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.