Re: NSTextFieldCell subclass template image inversion
Re: NSTextFieldCell subclass template image inversion
- Subject: Re: NSTextFieldCell subclass template image inversion
- From: Quincey Morris <email@hidden>
- Date: Thu, 26 Jun 2008 14:43:04 -0700
On Jun 26, 2008, at 13:18, email@hidden wrote:
My difficult is in getting system media template images to invert
when the cell is highlighted.
The documentation for NSImage - setTemplate states:
You can mark an image as a “template image” to notify clients who
care that the image contains only black and clear content.
Yes, I detect that an image is a template, but how do I initiate
"caring".
My feeble attempts at getting my client to care have firstly been to
try and invert the NSImageRep of the template, but this fails as the
image rep is the undocumented NSCoreUIImageRep and not a
NSBitmapImageRep.
My second attempt was along the following lines:
[cell setHighlighted:YES];
[cell setState:NSOnState];
NSImage *image = [cell preparedImage];
A modified - duller - image is returned, but not an inverted one.
I think that this is more along the right track. But something's
missing (brains probably).
AFAIK, the "caring client" part refers to use of the templates in
certain button styles as masks, e.g. for glowing and/or incised
inscriptions (like the buttons at the bottom of the iCal window). This
is documented in the Leopard developer release notes, though I don't
know if it's reached the mainstream documentation yet.
If you can figure out what it says, you might be able to use such
effects instead of inverting. If you must have inverting, the path of
least resistance might be to create your own images.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden