• 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: The fieldEditor and a focus ring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Locally Saving Data Acquired by my Cocoa App?
  • Next by Date: Re: Custom file types and extensions
  • Previous by thread: Re: The fieldEditor and a focus ring
  • Next by thread: Re: Live resizing NSTableView causes ghosting/nastiness in custom drawn NSTextFieldCell
  • Index(es):
    • Date
    • Thread