On 05/02/2012, at 12:20 PM, Quincey Morris wrote:

> The one issue this doesn't solve is that of making room around the view to 
> draw the focus ring. If one or more edges of the view are flush with the edge 
> of the window, the exterior ring looks ugly.


True, though if all edges are flush with the window, or an enclosing 
scrollview, it's not visible at all. The views I've done this for don't work 
that way so I didn't address the problem. I imagine the reason many views leave 
the whole focus ring drawing to you is that there is no single solution for 
whether it's drawing inside or outside.

> I think you also need to force an update when the app is deactivated. The 
> window is still the key window, but the focus ring shouldn't be drawn.

What I usually do is have an 'active' state that is ANDed with the focus being 
true to determine whether to draw the ring. Then the focus ring goes away 
whenever inactive, including when the window isn't key but the app is still 
active. Usually other elements in the view would also be interested in that 
state (even if only to use a grey highlight instead of colour, for example). Of 
course you have to add additional code to make that refresh happen when the 
active state changes.

--Graham




_______________________________________________

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