• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Have to subclass NSToolbarItem to be able to disable it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: mmalc's Controller examples
  • Next by Date: Re: OCUnit on Xcode .. I'm lost.
  • Previous by thread: Re: Have to subclass NSToolbarItem to be able to disable it?
  • Next by thread: RE: Have to subclass NSToolbarItem to be able to disable it?
  • Index(es):
    • Date
    • Thread