Re: focus ring around button
Re: focus ring around button
- Subject: Re: focus ring around button
- From: Alastair Houghton <email@hidden>
- Date: Tue, 17 Feb 2004 09:30:59 +0000
On 17 Feb 2004, at 07:30, Ruben Smits wrote:
>
Hi,
>
>
Thanks for your reply.
>
>
I tried this method indeed and it draws a kind of focusring. However,
>
the method bezierPathWithOvalInRect results in an incorrect path. It
>
is an oval indeed, but the button it is supposed to draw around is not
>
an oval.
>
>
So, this solution might work, as soon as I can find out the correct
>
NSBezierPath for the button. (To be exact: I am using the "small" kind
>
of button in Interface Builder.) I can't use the rect of the button,
>
because that results in a rect path.
>
>
Any idea how to find the correct NSBezierPath around the button?
Well, buttons aren't really drawn with NSBezierPath (they're just
bitmaps), and there's nothing to say that Apple won't change them at
any arbitrary time in the future... Basically, you're going to have to
either (a) guess and hope it doesn't change too much or (b) use some
sort of tracing algorithm to recover an appropriate path from the
rendered button. (a) is simple. (b) is far too complicated to
describe here (find some books on computer vision if you really want to
go for this approach).
Why are you trying to draw a focus ring around the button anyway? Have
you looked at the "Full keyboard access" feature? (Look in Keyboard &
Mouse in System Preferences.) If you're just doing this in a "normal"
application, then you probably shouldn't... unless full keyboard access
(Ctrl-F7) is enabled, then the user has indicated a preference for
*not* having focus rings around buttons in dialog boxes.
Kind regards,
Alastair.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.