Workaround for annoying NSFocusRing bug in NSImageView
Workaround for annoying NSFocusRing bug in NSImageView
- Subject: Workaround for annoying NSFocusRing bug in NSImageView
- From: Rick Hoge <email@hidden>
- Date: Tue, 06 Feb 2007 22:52:58 -0500
For some reason it can be very difficult to get rid of focus rings in
NSImageViews if [super drawRect:rect] is ever called - apparently the
class does not consider the value set in
[myImageView setFocusRingType:NSFocusRingTypeNone]
I finally figured out a simple workaround - I noticed that the blue
ring is only present if the image view's 'editable' attribute is set.
In my subclasses drawRect class I just make sure that 'editable' is
set to NO when [super drawRect:rect] is called:
BOOL wasEditable = [self isEditable];
[self setEditable:NO];
[super drawRect:rect];
[self setEditable:wasEditable];
The darned ring finally goes away...
The ring also seemed to have a buggy redraw during window resize,
leaving lots of blue lines all over the place.
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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