• 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
Re: NSTextFieldCell subclass template image inversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTextFieldCell subclass template image inversion (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: NSTrackingArea message lag
  • Next by Date: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • Previous by thread: Re: NSTextFieldCell subclass template image inversion
  • Next by thread: NSArchiver question?
  • Index(es):
    • Date
    • Thread