• 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: What paradigm behind NSColor's drawing methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What paradigm behind NSColor's drawing methods?


  • Subject: Re: What paradigm behind NSColor's drawing methods?
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 2 Feb 2008 09:04:16 -0600


On Feb 1, 2008, at 8:29 PM, Erik Buck wrote:

I may have to change the way I have been drawing focus rings. A quick search and Apple's examples indicates that it is necessary to save the graphics state before drawing a focus ring and restore it after. This must be particularly true if you draw the focus ring outside the visible rect and/or clipping path of the focused view.

I believe it is indeed the case due to the focus ring being drawn outside the view's actual bounds.


I used to see bugs (in Tiger and earlier) when full keyboard access was turned on, a control had keyboard focus and then you used the mouse to track it. If you clicked on the control and while keeping the mouse down, tracked on/off the control repeatedly, the focus ring would re-render itself over and over without first clearing the area. This led to an ever-darkening focus ring.

I do not see this in Leopard anymore, so perhaps the ability to now have overlapping views had something to do with the fix?


Anyhow, when I first worked on my custom UI, I had struggled with the focus ring being outside and ultimately "cheated" since I needed my own look. I never use the provided focus ring APIs; instead, I just render a bezier path _inside_ the view's bounds. And, since my UI controls are physically large, the extra few pixels around the actual control's body just added a bit of "slop" area to the hit region.


___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________

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


References: 
 >Re: What paradigm behind NSColor's drawing methods? (From: Erik Buck <email@hidden>)

  • Prev by Date: Spotlight for Help, index features of your app
  • Next by Date: Re: setAutoresizingMask from code
  • Previous by thread: Re: What paradigm behind NSColor's drawing methods?
  • Next by thread: The NSTrackingArea Report
  • Index(es):
    • Date
    • Thread