Transparent NSTextFieldCell
Transparent NSTextFieldCell
- Subject: Transparent NSTextFieldCell
- From: John Scalo <email@hidden>
- Date: Sun, 15 Dec 2002 22:21:08 -0800
Hi all,
I'm trying to get a certain visual effect with an NSTableView where the text
cells have opaque text but a transparent background. Behind the table is a
custom view (that is just an NSImage) which I want to show through the cell
background. I've tried a few different techniques to achieve this but in
most cases the background becomes _completely_ transparent all the way
through the window, i.e. whatever is behind this window shows through the
cell background.
For example,
* calling setBackgroundColor:[NSColor clearColor] on the cell
* subclassing NSTextFieldCell and forcing backgroundColor to return
[NSColor clearColor]
- subclassing NSTextFieldCell and doing this:
* (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[[NSColor clearColor] set];
NSRectFillUsingOperation(cellFrame, NSCompositeCopy);//or
NSCompositeClear
[super drawWithFrame:cellFrame inView:controlView];
}
None of the above result in the custom view behind the table showing
through. I've also tried similar things with the NSTableView itself in
combination with the NSTextFieldCell as well as various isOpaque settings
for the window and the view.
Anyone know of a way to get this effect?
And before the HI police descend on me, this is for a game which is already
highly visually customized, not some productivity app...
Thanks much,
John
_______________________________________________
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.