White highlighted appearance for icons in NSSegmentedCell
-
Hello,
I have a segmented control in my app that behaves like Finder's View
control in its toolbar. I'd like each icon in the control to change to
white when it's selected. Is there a way to do this without
subclassing or changing segment images manually?
Ben -
> I have a segmented control in my app that behaves like Finder's View
> control in its toolbar. I'd like each icon in the control to change
> to white when it's selected. Is there a way to do this without
> subclassing or changing segment images manually?
If you use a template image, everything should be automatic:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Cla
sses/NSImage_Class/Reference/Reference.html#/
/apple_ref/occ/instm/NSImage/setTemplate:
-Ben -
On Feb 20, 2008, at 11:30 AM, Benjamin Stiglitz wrote:>> I have a segmented control in my app that behaves like Finder's
>> View control in its toolbar. I'd like each icon in the control to
>> change to white when it's selected. Is there a way to do this
>> without subclassing or changing segment images manually?
>
> If you use a template image, everything should be automatic:
>
> http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Cla
sses/NSImage_Class/Reference/Reference.html#/
> /apple_ref/occ/instm/NSImage/setTemplate:
Unfortunately this code needs to run on Tiger.
Ben -
On Feb 20, 2008 AD, at 10:32 AM, Ben Kazez wrote:>> If you use a template image, everything should be automatic:
>>
>> http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Cla
sses/NSImage_Class/Reference/Reference.html#/
>> /apple_ref/occ/instm/NSImage/setTemplate:
>
> Unfortunately this code needs to run on Tiger.
The only way to do that in Tiger is to use an undocumented method &
supply your own white icons. You're best off just making the cell
available only in Leopard if at all possible.
Nick Zitzmann
<http://www.chronosnet.com/>


