I wonder how you are supplying the name of the function to CW_PDMENU? For me CW_PDMENU throws an error at the beginning of run time, if I specify an EVENT_PRO or EVENT_FUNC keyword in the CW_PDMENU call.
The place to specify a special event handler for CW_PDMENU is on its parent widget. Well, in the case of a CW_PDMENU that is defining a top-level base's menu bar, the parent widget is the top-level base. It is ***not*** the /MBAR-type button that is the 'Parent' argument to CW_PDMENU, as one might normally expect. Top-level WIDGET_BASEs also do not use the EVENT_FUNC or EVENT_PRO keywords; the top-level base event handler is defined in the XMANAGER call.
Thus, if you want an event handler for your CW_PDMENU with a special name, then you should assign that name in the XMANAGER call of your widget program, e.g.
xmanager, 'myidlapp', tlb, EVENT_HANDLER='pdmenu_handler'
Of course, the 'pdmenu_handler' in this case will have to handle ALL events from all other widgets in your program unless those widgets have their own EVENT_PRO's or EVENT_FUNC's.
James Jones
|