Problem with custom cell not gaining key focus
Problem with custom cell not gaining key focus
- Subject: Problem with custom cell not gaining key focus
- From: Tim Hewett <email@hidden>
- Date: Sat, 3 Jul 2004 14:55:06 +0100
Hi,
I have a custom cell inheriting from NSTextFieldCell where a
checkbox (NSButtonCell) has been added to the cell - this cell is
used in a NSOutlineView column. It all works fine but has a subtle
display problem when the outline view is used as an accessory
view to a NSOpenPanel. The view operates fine when the panel
is displayed, it reacts to mouse clicks ok, expandable rows expand,
the checkboxes check and uncheck fine, but when the panel first
displays the checkboxes don't have the blue "focus" colour, but the
"graphite" colour shown by controls which are in a non-key window.
If you then click on the outline view the buttons then become blue,
but if you scroll the outline view down a few lines before clicking
on it you get a situation where the buttons heading off the top of
the scroll view are still grey while those scrolling up into the view
are blue.
If you have the open panel display with the buttons grey as described,
then bring another app to the front the buttons stay grey, and if you
bring the open panel back to the front the buttons remain grey.
However if you first click on the outline view (so the buttons become
blue), bring another app to the front makes the buttons go grey
and they go blue when the open panel is brought back to the front
(i.e. normal behaviour resumes, but only after the outline view has
been clicked on).
When the same outline view is displayed in a custom panel the
buttons in the custom cell behave perfectly, the problem seems to be
confined to when the outline view is an accessory view to an open
panel.
If the cell is changed to be a standard NSButtonCell, they display
as blue and behave exactly as normal, as is the case if the custom
cell is made to inherit from NSButtonCell (and given a button type
of NSSwitchButton) so I suspect that there is a method I need to
overload in my subclass of NSTextFieldCell to mimic the same
internal status of NSButtonCell. However tests so far have not found
a way to do this - all the attributes (of documented methods) have
been duplicated yet the problem continues.
It is very strange - does anyone have an insight on what is causing
this? It seems to me that the custom cell's drawWithFrame:inView:
selector isn't getting called, but why?
Cheers,
Tim.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.