>On Dec 28, 2011, at 3:19 AM, Lee Ann Rucker wrote:

>>> I'm currently drawing the image in my custom cell using [image 
>>> drawInRect:....], the image is a proper template image (the property is YES 
>>> etc), but it's still just a grayscale image.
> 
>> You have to let the cell draw the image. [NSImage drawInRect:...] doesn't 
>> change the image and whatever NSButtonCell does isn't public.
> 
>> If that's not feasible, you can make a temporary NSButtonCell and use it to 
>> draw into another image that you can then use where you need it. 
>> rdar://9643738 requested an easy way to do that and was marked as a 
>> duplicate of 8067825.


>Hmm. Ok, so I dropped a template image into an NSButtonCell in a table column, 
>and inside of an NSButton just sitting on top of the table. Neither worked:
http://sethwillits.com/temp/upshot/upshot_EB5e2jd0.jpg

>(Ignore the focus on the right burn button)

>So it seems there's more to it than simply having the template image be in the 
>button cell. 

Yes, you have to set the button cell style & state so it knows what style to 
apply to the template image (that's why NSImage drawing doesn't do anything - 
it doesn't know cell state), and I don't have the code with me so I can't help 
there. What I did to work it out was to create a button in IB and tweak its 
settings to see how that affected the image, then use that in code.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to