Re: The fieldEditor and a focus ring
Re: The fieldEditor and a focus ring
- Subject: Re: The fieldEditor and a focus ring
- From: Kirk Swenson <email@hidden>
- Date: Mon, 2 Mar 2009 14:33:09 -0800
On Mar 2, 2009, at 7:42 AM, email@hidden wrote:
On Feb 27, 2009, at 6:29 PM, Graham Cox wrote:
On 28/02/2009, at 7:07 AM, Eric Gorr wrote:
Is this focus ring something I need to draw myself or is there
some way to get the fieldEditor to draw it?
If you are using the field editor with something other than a
standard NSTextField, you are going to have to draw the focus ring
yourself but based on the actual view or part of the view that is
visible, not the field editor.
I tried following the comments found here:
http://www.cocoadev.com/index.pl?DrawingAFocusRingAlongAnArbitraryPath
So, this is what I have tried to which should be drawing the focus
ring but doesn't:
[self lockFocus];
[NSGraphicsContext saveGraphicsState];
NSRect focusRingBounds = [self bounds];
NSSetFocusRingStyle( NSFocusRingOnly );
NSBezierPath *path = [NSBezierPath
bezierPathWithRect:focusRingBounds];
[path setClip];
[path fill];
[NSGraphicsContext restoreGraphicsState];
[self unlockFocus];
Essentially the same code is working for me, except that I'm not
calling the setClip method. Have you tried without the call to setClip?
Kirk Swenson
KCP Technologies, Inc.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden