On Nov 5, 2014, at 3:43 PM, Alex Kac <a...@webis.net> 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 (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