On Dec 17, 2014, at 11:40 PM, Jerry Krinock <je...@ieee.org> wrote:

> • It would be *really* nice if -[NSImage setTemplate:YES] sent to a 
> monochrome image would cause it to reverse brightness depending on the 
> highlight color, the way it works with Status Item icons in the menu bar, or 
> even better yet, turn blue like they do in Xcode when selected.  That sure 
> seems like the way a “template” image should work.  Am I missing some trick?

Just to be clear, a template image should not be black and white.  It should be 
black and clear.  Or, more accurately, the only thing that matters is the alpha 
channel.

If you use a proper template image in a button whose showsStateBy includes 
NSChangeBackgroundCellMask, it will show a blue effect when the button's state 
is NSOnState.  (You don't normally explicitly set the showsStateBy of a 
button's cell, although you certainly can.  Usually you set a button's type in 
IB or via -setButtonType:.  For example, set it to NSToggleButton.)

I typically use Round Textured / Toggle buttons and Textured Square segmented 
controls in a toolbar with template images.  They look correct on Yosemite.

Regards,
Ken


_______________________________________________

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

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

Reply via email to