I have a GUI and when I right click a ui for the uicontext menu, I want to call a general callback for processing. To do this I need to know which UI triggered the callback. Currently I have This in my ui_CreateFcn:
hcmenu = uicontextmenu;uimenu(hcmenu, 'label' , 'fdatool', 'callback', 'UI_callbackHandler(handles)');set(hObject, 'uicontextmenu', hcmenu)
Where handles are in the base, (0). Is there a way that I can find which ui in my GUI triggered the call. Right now I am creating different functions in each UI. For example:
____
...uimenu(hcmenu, 'label' , 'Name', 'callback', 'UI_callbackHandler1(handles)');...
____
...uimenu(hcmenu, 'label' , 'Name', 'callback', 'UI_callbackHandler2(handles)');...______
and so on. It is cumbersome Since the callbacks are very similar.
Best Answer