Re: Have to subclass NSToolbarItem to be able to disable it?
Re: Have to subclass NSToolbarItem to be able to disable it?
- Subject: Re: Have to subclass NSToolbarItem to be able to disable it?
- From: "Laurent Daudelin" <email@hidden>
- Date: Wed, 18 Feb 2004 12:42:01 -0500
On 18/02/04 12:03, "Guy Umbright" <email@hidden> wrote:
>
Specifically, I would like to enable/disable a toolbar
>
item based on the state of the selection in an NSTableView
>
in the window. I tried using setEnabled to control the
>
state, but it always get reset to enabled. From what I
>
can tell, I need to create a subclass of NSToolbarItem
>
so that I can override validate:, the default of which
>
always sets enabled?
>
>
If so, is it only me that this seems a bit of overkill
>
for? Wouldn't a delegate method be more appropriate
>
here?
validateToolbarItem: is your friend. There is a sample from Apple that shows
how to create and manage a toolbar with toolbar items. Unfortunately, I
don't remember the name of the sample but if you browse them, there should
be one relating to toolbars.
-Laurent.
--
========================================================================
Laurent Daudelin Developer, Multifamily, ESO, Fannie Mae
mailto:email@hidden Washington, DC, USA
************************ Usual disclaimers apply ***********************
_______________________________________________
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.