• 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: Mon, 16 Feb 2004 17:33:33 +0000

On 13 Feb 2004, at 08:23, Ruben Smits wrote:

Hi,

How do I draw a focus ring around a "default" button? The method setFocusRingType() creates a rectangular focus around a control, while a button should have an oval ring.

I tried the bezierPathWithOvalInRect: method to draw my own focus, but this method does not return the path around the button.

Any ideas?

Try something like

// Save graphics state
[NSGraphicsContext saveGraphicsState];

// Draw a focus ring (note that you *fill* the path to do this)
NSSetFocusRingStyle (NSFocusRingOnly);
[[NSBezierPath bezierPathWithOvalInRect:myRect] fill];

// Restore the graphics state
[NSGraphicsContext restoreGraphicsState];

Obviously you might need to use some other path, depending on the exact shape of your button.

Kind regards,

Alastair.
_______________________________________________
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>)

  • Prev by Date: XetSystemUIMode
  • Next by Date: Re: XetSystemUIMode
  • Previous by thread: focus ring around button
  • Next by thread: Re: focus ring around button
  • Index(es):
    • Date
    • Thread