Re: Force NSToolbar to revalidate NOW?
Re: Force NSToolbar to revalidate NOW?
- Subject: Re: Force NSToolbar to revalidate NOW?
- From: Phill Kelley <email@hidden>
- Date: Tue, 09 Sep 2003 12:34:41 +1000
G'Day Dan!
I have the opposite problem. In my case, validateToolbarItem seems to be
called at the drop of the proverbial hat.
Apart from the toolbar, my window has a two split views, a tab view, an
outline view, two tableviews and a text field. Anytime I click in any of
those, or type in any of those, or drag the window, or resize the window,
validateToolbarItem gets called. About the only time validateToolbarItem
doesn't get called is for simple mouse movements over the other views in
the window. Conversely, mouse movements over the toolbar items repeatedly
call validateToolbarItem.
And it ain't just one call per triggering event. A click in any one of
those views produces five validateToolbarItem calls in a row.
My guess is that anytime an NSView subclass gets any form of "update"
message, validateToolbarItem winds up getting called. The behavior may be
affected by what's in the responder chain but I haven't felt the need to
investigate further.
Given that I get floods of validateToolbarItem calls, I'm curious to know
what else you have in your window which ISN'T causing the kind of behavior
I'm seeing. If you've got any of the same UI widgets that I have, and you
aren't getting validateToolbarItem calls when you click in such widgets,
then I think something else is going on. When you create the NSToolbar
instance, you say you set the delegate. Did you also attach it to the
window via:
[[self window] setToolbar:toolbar];
Regards, PK
At 10:38 -0700 08/09/2003, email@hidden wrote:
>
I have some items in NSToolbar that are initially grayed out, but then
>
become valid after some delay. (I am using validateToolbarItem in the
>
window's delegate to control this.)
>
>
Unfortunately, the items *stay* gray until I pass the mouse over the
>
NSToolbar, which causes an update. So until the user moves the mouse
>
in the right place, it looks like the items remain deactivated.
>
>
Is there any way to force the items to re-validate (and re-display)
>
"now"? I have tried calling -validate on the items; I have tried
>
-display or -update on the window itself; I have tried making the
>
toolbar invisible and then visible again, etc.
>
>
Can anybody think of a workaround to force the toolbar to display
>
itself with its new enabled state immediately?
>
>
--
>
Dan Wood
>
Karelia Software, LLC
>
email@hidden
>
http://www.karelia.com/
>
Watson for Mac OS X: http://www.karelia.com/watson/
>
_______________________________________________
>
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.
_______________________________________________
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.