Specificity of selection for submenus with PopupContextualMenu
Wed, 09/04/2019 - 05:01 pm
I have run into some behavior that I don't know how to resolve (Igor 8, Mac). I have an interface that uses PopupContextualMenu, and the menu has a submenu of a list of waves. I want to add a second submenu that offers a different operation but on the same list of waves. The problem is that v_value and s_selection seem to return values referring to their individual submenus, and do not report which item in the parent menu was selected.
I've written a simplified example to illustrate the basic problem:
submenu "action 1"
submenu "action 2"
function testMenu ()
PopupContextualMenu /N "Tester"
print v_kind, v_flag, s_selection
If you enter "testmenu ()" on the command line, it will give you the popup menu. If you select action1->wave1, you get the same v_kind, v_flag, and s_selection as if you had selected action2->wave1. So, how can I distinguish the two? Any suggestions for a work-around? Is renaming the items in my submenus the best choice? I am grateful for suggestions.
Igor Pro 8
Igor XOP Toolkit
Igor NIDAQ Tools MX