• 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: Tony Romano <email@hidden>
  • Date: Sat, 18 Jun 2011 11:14:57 -0700
  • Thread-topic: Drawing focus rings

You will need this as well.

- (BOOL) resignFirstResponder
{
 ...
 // Invalidate the area around the focus ring
 [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
 ...
}


Tony Romano



On 6/18/11 10:19 AM, "Lee Ann Rucker" <email@hidden> wrote:

>>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
>


_______________________________________________

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: Drawing focus rings (From: Lee Ann Rucker <email@hidden>)

  • Prev by Date: Retrieve NSTable DataSource from AppController
  • Next by Date: Re: Retrieve NSTable DataSource from AppController
  • Previous by thread: Re: Drawing focus rings
  • Next by thread: Retrieve NSTable DataSource from AppController
  • Index(es):
    • Date
    • Thread