On Mar 2, 2009, at 7:42 AM, cocoa-dev-requ...@lists.apple.com 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to