Re: NSTextFieldCell subclass template image inversion
Re: NSTextFieldCell subclass template image inversion
- Subject: Re: NSTextFieldCell subclass template image inversion
- From: Brandon Walkin <email@hidden>
- Date: Thu, 26 Jun 2008 21:21:29 -0400
You can make a template image white by telling its cell:
[cell setBackgroundStyle:NSBackgroundStyleDark]
Cheers,
Brandon
On 26-Jun-08, at 4:18 PM, email@hidden wrote:
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
_______________________________________________
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