Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
I have a large IDL application for which I would like to set up a menu interface. I would like to have 5-10 menu buttons with pulldown menus, hence I'm using 'xpdmenu'. Each menu button is registered using 'xmanager' and has an 'event_handler' routine. Each menu button has a parent menu and each parent menu has some items that have submenus. (I'm not sure yet if I can register each menu button separately, but let's assume I can). My problem occurs with the submenus that I have for some of the menu selections. What I would like to do is have a different routine to handle events from a submenu. I don't want to use the same routine as registered with the 'event_handler' for the parent menu. Is there any way that I can call a different 'event_handler' routine if an item from a submenu is selected ? The reason why I want to do this is because the submenu items perform tasks that are distinct from the tasks performed by the items in the main menu. I really don't want to have a huge case statement in only one 'event_handler' routine that is forced to handle every item from the parent menu and every item from each of its submenus. I've thought about having no submenus, but that would result in a cluttered menu base with a whole bunch of menu buttons. -- Jatinder Singh 916-653-7564 jat@water.ca.gov ...ucbvax!ucdavis!caldwr!jat Any opinions expressed are my own; they do not represent the DWR.
In article <JAT.94Feb16164227@grizzly.water.ca.gov> jat@water.ca.gov (Jatinder Singh) writes: > > I have a large IDL application for which I would like to set > up a menu interface. First of all, use the compound widget menu tool - it makes things a lot easier. > My problem occurs with the submenus that I have for some of > the menu selections. What I would like to do is have a different > routine to handle events from a submenu. Use /RETURN_FULL_NAME for the menu items. Then eventval will contain the menu item name and event.value will contain the event item name with the subitem name appended to it. Then use CASE eventval OF "Item1": CASE event.value OF "Item1.Subitem1": do something "Item1.Subitem2": do something else ENDCASE ENDCASE The advantage of returning the full name is that subitems of different menu items can have the same name. Ed