[Q] Image background color different from NSTableView's background color
[Q] Image background color different from NSTableView's background color
- Subject: [Q] Image background color different from NSTableView's background color
- From: Mark de Jong <email@hidden>
- Date: Thu, 30 May 2002 10:29:57 -0700
Hi!
I have a window with an NSTableView in it. I set the background of this
view to a solid color using the setBackgroundColor: selector.
One of the columns in the NSTableView displays NSButtons whose NSCell is
an NSImage.
I setup the button view with the following in the "windowDidLoad"
delegate:
[myTableColumn setDataCell: [[NSButtonCell alloc] initImageCell:nil]]
where "myTableColumn" is an NSTableColumn.
Later, in the table delegate
"tableView:willDisplayCell:forTableColumn:row:", I place the appropriate
NSImage in the cell with:
[aCell setImage:myImage01]
The NSImages are all tiffs that have alpha channels.
The buttons and images display and are functional, with one caveat: the
background color surrounding the button is the standard "horizontal
striped" background rather than the solid background color set in
"windowDidLoad".
In response to Stiphane Sudre's comment, I added:
[[myTableColumn dataCell] setButtonType: NSMomentaryChangeButton];
This seems to fix things in an NSOutlineView, but not in an NSTableView.
How do I ensure the button's background is the same as my table's
background?
Thanks,
-- Mark de Jong
_______________________________________________
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.