Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Arbortext Editor 5.4 M110
Background:
Context:
Issue:
When the "set stylesheet" command it initiated, the custom menus are removed.
Any idea what is happening? Or what I need to do to reload the menus?
Thank you in advance
Have you reviewed the menuloadhook?
Here is an example;
package testmenuhook
function testmenuhook_addmenus(win=0,filename="")
{
# add some menus to the Tools button
if (menu_exists('.Tools') && !menu_exists('.Tools.Export_XML'))
{
menu_add .Tools. "" -separator
menu_add .Tools. "Export XML" -cmd {eval "here's export_xml"}
menu_add .Tools. "Import XML" -cmd {eval "here's import_xml"}
}
}
missed the last 3 lines resubmitting.
Here is an example;
package testmenuhook
function testmenuhook_addmenus(win=0,filename="")
{
# add some menus to the Tools button
if (menu_exists('.Tools') && !menu_exists('.Tools.Export_XML'))
{
menu_add .Tools. "" -separator
menu_add .Tools. "Export XML" -cmd {eval "here's export_xml"}
menu_add .Tools. "Import XML" -cmd {eval "here's import_xml"}
}
}
#set up menus
add_hook("menuloadhook","testmenuhook::testmenuhook_addmenus")
testmenuhook_addmenus()
Hi Tim,
First let me thank you for responding to my question. Now to answer your question.
Not sure what you mean by;
>"Have you reviewed the menuloadhook?"
Background:
The custom menus established with the "menu_add" method and with the "add_hook" method is currently in the ACL stored in location "[editor root]\custom\editinit\" and is loaded at startup. I am writing a different tool that is also stored in this ACL file that allows the end-user to change the FOSI style sheet using the "set stylesheet=" command. When this command is submitted, the custom menus established with the "menu_add" method and with the "add_hook" method are removed.
Questions:
Thank you in advance
I was suggesting that you review the menuloadhook function documentation in Arbortext Editor Help Center - Help > Help Center.
Okay, I'll check it out. Thanks!
Hi Tim,
Thank you for directing me to the appropriate documentation to help resolve the issue I was having. I believe the best solution for my situation is:
This seems to be working in my test case and I assume this is an appropriate method to achieve my goal?
Best Regards