• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: focus ring around button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: focus ring around button
      • From: Ruben Smits <email@hidden>
References: 
 >focus ring around button (From: Ruben Smits <email@hidden>)
 >Re: focus ring around button (From: Alastair Houghton <email@hidden>)
 >Re: focus ring around button (From: Ruben Smits <email@hidden>)

  • Prev by Date: Reading from the "almost end" of a file
  • Next by Date: Re: Installer framework or .pkg format?
  • Previous by thread: Re: focus ring around button
  • Next by thread: Re: focus ring around button
  • Index(es):
    • Date
    • Thread