Re: focus ring around button
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.