**SOLVED** Custom "ButtonAndText" cell in NSOpenPanel accessory view
**SOLVED** Custom "ButtonAndText" cell in NSOpenPanel accessory view
- Subject: **SOLVED** Custom "ButtonAndText" cell in NSOpenPanel accessory view
- From: Tim Hewett <email@hidden>
- Date: Wed, 7 Jul 2004 15:18:59 +0100
Hi,
This has finally been solved, thanks to Louis's hint on using
NSProxy to display each method call to a given object. The
problem is that there is a hidden method in NSCell called
"- (BOOL)_needRedrawOnWindowChangedKeyState". Just
overload this in your custom subclass to return YES.
Background: I have an outline view which has a custom cell
in its first column. The cell is a subclass of NSTextFieldCell
and it contains a button (checkbox type) which it draws next
to the text. The problem was that when the view containing
the outline view was specified as the accessory view for a
NSOpenPanel, when the panel opened the buttons would
display as grey rather than blue when the panel was first
displayed, and wouldn't change colour when the panel
changed key status. Normally text doesn't need to change
in this circumstance, hence NSTextFieldCell doesn't ask
for it, but checkboxes need to change colour and so
NSButtonCell returns YES from this hidden method. Now
mine does too it all works fine.
Regards,
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.