Re: Images in NSOutlineViews and NSTableViews
Re: Images in NSOutlineViews and NSTableViews
- Subject: Re: Images in NSOutlineViews and NSTableViews
- From: Stéphane Sudre <email@hidden>
- Date: Mon, 4 Nov 2002 16:38:53 +0100
On lundi, nov 4, 2002, at 15:00 Europe/Paris, mw wrote:
Hello everyone,
I would just like to know how to place an image in an NSOutlineView or
an NSTableView (I assume the method for doing so is the same?).
I have looked through the archives, and all of the answers there have
just said to use NSImageCells instead of the default NSTextCell in one
of the columns. But, I have no idea how to change the type of cell for
a column in a table view. Also, since Outline Views have no columns (or
do they?), how would I go about making an image in an outline view? Is
it possible to have a table view with 2 columns: the first one
containing NSImageCells with images in them, and the second one
containing an actual NSOutlineView? This sounds kind of shaky, and if
it isn't possible to do it that way, is there another way to do it? I
am more concerned about placing images in outline views than I am with
placing images in table views as of now.
In your awakeFromNib code
NSImageCell * myImageCell;
myImageCell=[NSImageCell new];
myColumn=[myTableView tableColumnWithIdentifier:@"My Column Name"];
[myColumn setDataCell: myImageCell];
It's the same code for NSOutlineView that does have Columns.
_______________________________________________
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.