NSTextFieldCell subclass template image inversion
NSTextFieldCell subclass template image inversion
- Subject: NSTextFieldCell subclass template image inversion
- From: "email@hidden" <email@hidden>
- Date: Thu, 26 Jun 2008 21:18:16 +0100
- Domainkey-status: no signature
Hello list
My NSTextFieldCell subclass is based on ImageAndTextCell.m from the
SourceView sample.
This displays text and images in a single cell.
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).
Any enlightenment would be welcome.
Jonathan
_______________________________________________
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