Re: NSImage glowing
Re: NSImage glowing
- Subject: Re: NSImage glowing
- From: Wim Lewis <email@hidden>
- Date: Wed, 05 Nov 2014 17:53:54 -0800
On Nov 5, 2014, at 3:43 PM, Alex Kac <email@hidden> wrote:
> BUT, in this case I’m just trying to get the glow on selected images, so when I look at the code below all I see is that we’re getting the bitmap and drawing it. I’m not understanding how that gets a glow.
It’s applied by NSButtonCell, which knows that if it’s in the selected state and its image is marked as a template image (or some set of conditions like that), then it should apply the glow when drawing.
I take it you’re trying to get this effect in some place other than inside a button? It’s not unreasonable to use an NSCell instance elsewhere— that’s essentially what cells are for, to abstract away some of the drawing behavior from the control view that uses them.
I think NSButtonCell uses NSSetFocusRingStyle() to provide the actual effect, but there may be additional magic in there.
_______________________________________________
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