Re: NSToolbarItem validation
Re: NSToolbarItem validation
- Subject: Re: NSToolbarItem validation
- From: Chris Miner <email@hidden>
- Date: Tue, 14 Mar 2006 18:55:10 +0100
Am 14.03.2006 um 18:17 schrieb Tommy Nordgren:
On 14 mar 2006, at 17.56, Chris Miner wrote:
Am 14.03.2006 um 17:10 schrieb Tommy Nordgren:
From the NSView Docs (a base class of NSButton)
Whenever the data or state used for drawing a view object
changes, the view should be sent a setNeedsDisplay:
I see. So are you suggesting I tell the NSToolbarItem item's view
that it should be re displayed at the end of my validation
method? Something like:
if ([[self view] isKindOfClass:[NSControl class]])
{
NSControl *control = [self view];
[self setEnabled:[control isEnabled]];
[[control superview] setNeedsDisplay:YES];
use [control setNeedsDisplay:YES]
(a control IS a NSView subclass)
I am sorry, I must not have been clear in my original post. The
problem isn't with my control's display being updated properly. It's
display updated. Through a binding. The problem is that the text of
the NSToolbarItem remains grayed out, even though the control is
enabled, and even though I am enabling the NSToolbarItem in the
validate method.
In any case "[control setNeedsDisplay:YES]" doesn't work and
"[[control superview] setNeedsDisplay:YES]". You see, my control is
updating, the NSToolbarItem is not. So when I updated the superview
of my control, the NSToolbarItem label redrawn as though the item
were now enabled. I'm not sure I should have to be doing that, but
thanks for the workaround!
_______________________________________________
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