• 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
Dynamically Updating NSToolbarItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamically Updating NSToolbarItem


  • Subject: Dynamically Updating NSToolbarItem
  • From: Albert Atkinson <email@hidden>
  • Date: Thu, 23 May 2002 11:11:08 -0500

Hello!

I have an NSToolbarItem that will show and hide an NSDrawer. What I would like is when the drawer is open it will display the close icon and text but when the drawer is closed it will display the open icon and text. Here is the code I have:

else if([itemIdent isEqual: SpeechDocToolbarItemIdentifier]) {
if ([speechDrawer state]==NSDrawerClosedState) {
[toolbarItem setLabel: @"Show Speech"];
[toolbarItem setPaletteLabel: @"Speech"];

[toolbarItem setToolTip: @"Show Speech Drawer"];
[toolbarItem setImage: [NSImage imageNamed: @"Show Speech Panel"]];
} else if ([speechDrawer state]==NSDrawerOpenState) {
[toolbarItem setLabel: @"Hide Speech"];
[toolbarItem setPaletteLabel: @"Speech"];

[toolbarItem setToolTip: @"Hide Speech Drawer"];
[toolbarItem setImage: [NSImage imageNamed: @"Close Speech Panel"]];
}

// Tell the item what message to send when it is clicked
[toolbarItem setTarget: speechDrawer];
[toolbarItem setAction: @selector(toggle:)];
}

This code does not seem to work as all it shows is "Show Speech Drawer" with the open icon no matter what state it is in.

Anyone have any suggestions?

Thanks!

Albert
_______________________________________________
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.

  • Follow-Ups:
    • Re: Dynamically Updating NSToolbarItem
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Flame retardant
  • Next by Date: Re: Setting __MyCompanyName__
  • Previous by thread: object specifier question
  • Next by thread: Re: Dynamically Updating NSToolbarItem
  • Index(es):
    • Date
    • Thread