• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Transparent NSTextFieldCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: spurious Mountain View and Redwood City
  • Next by Date: Re: "First Run" installation of Application support stuff?
  • Previous by thread: Meeting - Chicago CAWUG Tuesday Dec. 17th
  • Next by thread: Symbol and dingbats in RTF
  • Index(es):
    • Date
    • Thread