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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

In ACL language, how to activate a customized menu depending on the context

dgopois
12-Amethyst

In ACL language, how to activate a customized menu depending on the context

Hello,

Under Arbortext Editor and  with ACL language, I would like to activate a customized menu (grayed or not) depending on the context. For example, if the cursor of the mouse is in a specific tag, the customized menu is activated. If not, the menu is disabled (grayed).

1 ACCEPTED SOLUTION

Accepted Solutions
dgopois
12-Amethyst
(To:dgopois)

Hello,

 

We can use this function to active or not the menu:

function activeMenu() {
if (in_context("tagname") != 1) {
return 0;
}
return 1;
}

 

and use the command lines to add the menu:

menu_add -menu -before .Help 'TEST';

menu_add .TEST. "TEST1" -cmd { test() } \
-active "activeMenu() == 1";

 

Best regards

David G

View solution in original post

1 REPLY 1
dgopois
12-Amethyst
(To:dgopois)

Hello,

 

We can use this function to active or not the menu:

function activeMenu() {
if (in_context("tagname") != 1) {
return 0;
}
return 1;
}

 

and use the command lines to add the menu:

menu_add -menu -before .Help 'TEST';

menu_add .TEST. "TEST1" -cmd { test() } \
-active "activeMenu() == 1";

 

Best regards

David G

Top Tags