Re: NSTableView Bug (or I cocked up)
Re: NSTableView Bug (or I cocked up)
- Subject: Re: NSTableView Bug (or I cocked up)
- From: "Clark S. Cox III" <email@hidden>
- Date: Thu, 27 Mar 2003 09:33:22 -0500
On Thursday, Mar 27, 2003, at 09:18 US/Eastern, Thomas Davie wrote:
Hi,
I was just wanting to check that I hadn't cocked something up here
before I file a but on apple bugreporter. I've been attempting to put
images into table columns, but can't get it to work quite right,
whatever I do I seem to get graphical glitches.
Code for this small test is included below. Examples of what happens
are at:
http://www-users.york.ac.uk/~tatd100/images/bug1.jpg
In this one, note the fact that the column with the image in does not
have it's normal background on. It appears to be whited out. The
image does have an alpha channel and renders correctly when you draw it
elsewhere.
http://www-users.york.ac.uk/~tatd100/images/bug2.jpg
In this one, not the text that has become superimposed on the image.
This appeared after re-ordering the columns and then returning them to
their origional state.
What appears to be happening is that the background of the header is
not being drawn, hence when text is dragged over it a shadow is left
where the background is not redrawn.
This is because you are changing the cell of the column header, and
the background is drawn by the cell. Instead of sticking an NSImageCell
in there, simply call setImage: on the cell that is already there. i.e.:
- (void)awakeFromNib
{
// Load up the image.
image = [[NSImage imageNamed:@"Test.tiff"] retain];
// Set the outline view to display the image as a header.
[[[outlineView tableColumnWithIdentifier:@"ImageColumn"]
headerCell] setImage: image];
// Set the outline View to display the arrows in the second
column.
[outlineView setOutlineTableColumn:[outlineView
tableColumnWithIdentifier:@"TextColumn"]];
// Display what the image looks like.
[imageWell setImage:image];
}
--
http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
_______________________________________________
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.