• 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: Drawing focus rings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing focus rings


  • Subject: Re: Drawing focus rings
  • From: Lee Ann Rucker <email@hidden>
  • Date: Sat, 18 Jun 2011 10:19:38 -0700 (PDT)

>From the sample code in ClockControl.m :

 // If we have focus, draw a focus ring around the entire cellFrame (inset it a little so it looks nice).
    if ([self showsFirstResponder]) {
    // showsFirstResponder is set for us by the NSControl that is drawing us.
        NSRect focusRingFrame = clockRect;
    focusRingFrame.size.height -= 2.0;
    [NSGraphicsContext saveGraphicsState];
    NSSetFocusRingStyle(NSFocusRingOnly);
    [[NSBezierPath bezierPathWithRect: NSInsetRect(focusRingFrame,4,4)] fill];
    [NSGraphicsContext restoreGraphicsState];
    }

----- Original Message -----
From: "Peter Hudson" <email@hidden>
To: email@hidden
Sent: Saturday, June 18, 2011 3:32:49 AM
Subject: Drawing focus rings

I need to draw a focus ring ( or something that looks like a focus
ring ) around a group of rows in an NSTableView.

Drawing a rectangle with NSBezierPath  works fine - how do I make it
look like a focus ring ?

Peter
_______________________________________________

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
_______________________________________________

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

  • Follow-Ups:
    • Re: Drawing focus rings
      • From: Tony Romano <email@hidden>
References: 
 >Drawing focus rings (From: Peter Hudson <email@hidden>)

  • Prev by Date: Re: Release a NSWindowController after the window is closed
  • Next by Date: Re: Release a NSWindowController after the window is closed
  • Previous by thread: Drawing focus rings
  • Next by thread: Re: Drawing focus rings
  • Index(es):
    • Date
    • Thread