Disabling Toolbar Items

I’m trying to disable one toolbar item in my app’s toolbar, but only under certain circumstances. While I can disable it, it re-enables itself a second later. Is there any way to permanently disable it until such time as I tell it otherwise?

Hi,

Take a look here:
http://developer.apple.com/documentation/AppleScript/Reference/StudioReference/sr9_menu_suite/sr_menu.html
especially the last part ‘update menu item’.

You would need to enable the ‘update menu item’ handler for the menu item in Interface Builder, and then build a set of conditions that fit when your menu item should be enabled or not.

Best wishes

John M

I don’t need to disable a menu item, just a toolbar icon. I’ve got the menu disabled fine, and I can disable the toolbar icon, but it re-enables itself automatically a second later.

Sorry, my mistake.

Are you using an ‘on update toolbar item’ handler?

John M

Ah - that’s what I was missing. I was trying to just set the enabled status of the toolbar icon without using the update handler, so it was returning true when I updated it, thus canceling out my disabling of it. I’ve got it working now - thanks! :slight_smile: