Focus Ring in NSBrowser Column
Focus Ring in NSBrowser Column
- Subject: Focus Ring in NSBrowser Column
- From: Micha Fuhrmann <email@hidden>
- Date: Tue, 01 Jul 2008 13:36:03 +0200
Hi there,
I'm trying to set the focus ring on a 10.4 NSBrowser column for a drag
in. I'v tried setting it on the NSMatrix of each column but the focus
ring stops where the NSMatrix view stops. So I've sub-classed my
NSBrower as such:
- (BOOL)needsDisplay;
{
NSResponder* resp = nil;
shouldDrawFocusRing = (resp != nil && [resp isKindOfClass:[NSView
class]]
&& [(NSView*)resp isDescendantOf:self]);
lastResp = resp;
[self setKeyboardFocusRingNeedsDisplayInRect:[[AppController
sharedInstance]rectInColumn:0]];
return YES;
}
- (void)drawRect:(NSRect)rect
{
[super drawRect:[[AppController sharedInstance]rectInColumn:0]];
if ( shouldDrawFocusRing )
{
NSSetFocusRingStyle(NSFocusRingOnly);
NSRectFill([[AppController sharedInstance]rectInColumn:0]);
}
}
[[AppController sharedInstance]rectInColumn:0] being the NSRect of the
column. I've chosen column:0 just for testing purposes
However the NSBrowser still draws its focus ring around its entire view.
Any help greatly appreciated.
_______________________________________________
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