NSTableView Bug (or I cocked up)
NSTableView Bug (or I cocked up)
- Subject: NSTableView Bug (or I cocked up)
- From: Thomas Davie <email@hidden>
- Date: Thu, 27 Mar 2003 14:18:50 +0000
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.
Here's code, note that the outline view's data source simply provides
empty strings and says that nothing has any children:
/* BugDemoController.h */
#import <Cocoa/Cocoa.h>
@interface BugDemoController : NSObject
{
IBOutlet NSImageView *imageWell;
IBOutlet NSOutlineView *outlineView;
NSImage *image;
}
@end
/* BugDemoController.m */
#import "BugDemoController.h"
@implementation BugDemoController
- (void)awakeFromNib
{
NSImageCell *imageCell;
// Load up the image.
image = [[NSImage imageNamed:@"Test.tiff"] retain];
imageCell = [[[NSImageCell alloc] initImageCell:image] autorelease];
// Set the outline view to display the image as a header.
[[outlineView tableColumnWithIdentifier:@"ImageColumn"]
setHeaderCell:imageCell];
// 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];
}
- (void)dealloc
{
if (image)
[image release];
}
@end
_______________________________________________
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.