Re: Template Images in Table Cells
Re: Template Images in Table Cells
- Subject: Re: Template Images in Table Cells
- From: Kyle Sluder <email@hidden>
- Date: Wed, 28 Dec 2011 00:23:02 -0800
On Tue, Dec 27, 2011 at 10:43 PM, Seth Willits <email@hidden> wrote:
>
> I want to use template images as the icon next to the text for some rows in a table/outline view, as part of the "source list" look. Normally I'd just use full color images, but now that we're being led into monotony by Apple's new look in Lion, I expect to be able to use a template image somehow, and it figures out how to colorize it appropriately. 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.
>
> Any idea how to actually get that to work?
If it's a view-based Table or Outline View, hooking up the imageView
outlet from the NSTableCellView should Just Work(TM). All that really
does appearance-wise is change the image view's cell's backgroundStyle
to NSBackgroundStyleRaised, so you can easily do this yourself.
Unfortunately, it has to be done in code since there's no way to set
the backgroundStyle property of a cell using Interface Builder. (If I
haven't filed an enhancement request on that yet, I've been meaning
to.)
--Kyle Sluder
_______________________________________________
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