Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextFieldCell - Kidnapped Focus Ring!



Hi Seth,

My experience with focus rings has always been with NSView subclasses, not with cells.  And my focus rings have always been drawn outside their views, adorning them, as it were.  In the past, I have had to invalidate the focus ring's area with setKeyboardFocusRingNeedsDisplayInRect in order to to get them to draw, because I was doing something non-standard.  Also I've always used NSFocusRingTypeExterior.

Here's some code I've used to draw focus rings "by hand":

- (void) drawFocusRing
{
    [NSGraphicsContext saveGraphicsState];

    [[NSColor keyboardFocusIndicatorColor] set];
		
    NSSetFocusRingStyle(NSFocusRingOnly);
    [[NSBezierPath bezierPathWithRect:[self bounds]] fill];

    [NSGraphicsContext restoreGraphicsState];
}

I doubt that this will be of much help, but since no one else has taken a shot at your question, I wanted "to keep the ball in the air," so to speak.

Sincerely,
Joel




      
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.