Re: Focus Rings
Re: Focus Rings
- Subject: Re: Focus Rings
- From: "Sean McBride" <email@hidden>
- Date: Mon, 23 Oct 2006 14:31:09 -0400
- Organization: Rogue Research
On 2006-10-22 14:28, Seth Willits said:
>Is there a *good* example of drawing a rectangular focus ring on a
>view correctly? The only real complete example I've found (it was on
>cocoadev.com) has several problems with it. It either is ridiculously
>inefficient in drawing, keeps redrawing the focus ring ontop of
>itself so it gets thick and ugly, or doesn't maintain the focus ring
>correctly when switching windows, however I modify it. It seems like
>one of those simple things, but it's apparently not simple.
I use this at the end of my drawRect: method:
// Draw focus ring if this view is the first responder
if ([self isFirstResponder]) {
[NSGraphicsContext saveGraphicsState];
NSSetFocusRingStyle (NSFocusRingOnly);
[[NSBezierPath bezierPathWithRect:[self bounds]] fill];
[NSGraphicsContext restoreGraphicsState];
}
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Focus Rings (From: Seth Willits <email@hidden>) |