cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Non-existent menu item

jonathan.reeve
1-Newbie

Non-existent menu item

I have added an item to the Arbortext edit menu. It calls an external service. I used timer_add_callback to poll the service occasionally to see if the menu item should be available. Then I used menu_change to enable or disable the menu item appropriately.

This all works until the user uses "Edit selection as XML source", because that displays a new window. When the timer goes off, the menu item doesn't exist in the XML-as-source window, and an error dialog pops up.

I tried calling menu_change inside catch, like this:
catch( 'menu_change ".Edit.Use service" -active "$$polledOK" )

That stops the error dialog, and the catch returns 0. But the menu item state never changes.

- Am I doing something wrong in the catch?
- Or is there some way of telling if the menu item is available?
- Or is there a way to refer to the menu item in the right window?


Jonathan Reeve









This e-mail from Practical Law Company (
2 REPLIES 2

Hi Jonathan--

You can use the menu_exists() function to make sure the menu can be
found before you try to update it.

--Clay

Clay Helberg
Senior Consultant

TerraXML
1380 Forest Park Circle, Suite 100
Lafayette, CO 80027

Thanks.


menu_exists is what I was looking for.



Top Tags