Suspected bug (was: Removing focus rings from NSImageViews)
Suspected bug (was: Removing focus rings from NSImageViews)
- Subject: Suspected bug (was: Removing focus rings from NSImageViews)
- From: Ken Tabb <email@hidden>
- Date: Fri, 25 Nov 2005 11:23:16 +0000
Hi again folks,
things are taking a turn for the more bizarre with my image view
focus rings. If I use a standard NSImageView, and set its focus ring
with:
[myImageView setFocusRingType:NSFocusRingTypeNone]
... then sure enough it doesn't draw a focus ring, even if I click on
it / tab to it (to get focus). Once focussed however, if I then
resize it (eg. resizing the window with springy width & height), or
call [myImageView setImageScaling:anyValue], it draws the focus ring.
I can repeatedly call -setFocusRingType:NSFocusRingTypeNone during
any or all of these operations, it doesn't make a jot of difference;
the focus ring is still drawn. Furthermore [myImageView
focusRingType] returns NSFocusRingTypeNone at every stage in the app,
so nothing's resetting it behind my back.
If I use my NSImageView subclass (as per original post) instead of an
actual NSImageView, it draws the focus ring whenever I call [super
drawRect:rect] (eg. in my subclass' -drawRect, if I only want a plain
image drawn in the view). If I do all the image drawing myself
though, no focus ring ever gets drawn (woo-hoo!).
So I'm tempted to think something within NSImageView's -drawRect is
not honouring the focus ring that's been set? I've even tried
overriding the subclass' -setKeyboardFocusRingNeedsDisplayInRect, so
that it uses NSZeroRect, but even that doesn't stop [super drawRect:]
from giving me a darned focus ring!
This is a de facto, genuine bug yes? Or am I barking up entirely the
wrong tree? Somebody please give me a sanity check!
Thanks in advance,
Ken
On 24 Nov 2005, at 4:41 pm, Ken Tabb wrote:
Hi folks,
I have an NSImageView subclass that I'm trying to display without a
focus ring - the view needs to show that it is selected using other
visual means besides a focus ring (it is a web plugin). However
despite all 'reasonable' attempts, I can't quite kill the focus
ring entirely. Here is what I've tried so far:
[1] Calling [myImageView setEnabled:NO] does indeed kill the focus
ring, but it also prevents it from receiving drag / drop
operations, cut/copy/paste etc., so bearing in mind it knobbles all
of the required functionality besides the focus ring, is a non-starter
[2] Calling [myImageView setFocusRingType:NSFocusRingTypeNone]
doesn't kill it.
[3] overriding -setImage / -setImageScaling, so that after calling
super's implementation it sets the focus ring as per [2], doesn't
work when you drag an image onto it or change the scaling type (let
alone when you're not changing the image, of course, eg. clicking
on it)
[4] overriding -focusRingType, to always return
NSFocusRingTypeNone, doesn't seem to change anything
[5] overriding -setFocusRingType to always set it as
NSFocusRingTypeNone, doesn't seem to change anything
[6] overriding +defaultFocusRingType to always return
NSFocusRingTypeNone, doesn't seem to change anything
... am I completely missing the point here? Or is this a known
NSImageView-specific bug? I searched the archives and the only
other issue people have had with NSImageViews / focus rings is the
heavy redrawing (i.e. draws the ring multiple times, resulting in a
darker ring).
Thanks in advance for any help / medication you can give me,
Ken
- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer
Science
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/
Certified non-Microsoft Solution Provider
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40herts.ac.uk
This email sent to email@hidden
- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK
http://www.health.herts.ac.uk/ken/
Certified non-Microsoft Solution Provider
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden