Hi, I'm currently trying to reference back to a submenu of a menu that I created using loops. How can I do that?
%Populate / Create Menu & Submenu
FIRST.menu = uimenu('Label','FIRST');for i = 1:1:length(A) SECOND.menu = uimenu('Parent',FIRST.menu,'Label',A(i)) for j = 1:1:length(B) THIRD.menu = uimenu('Parent',SECOND.menu,'Label',B(j)) for k = 1:1:length(C) THIRD.choices(k) = uimenu(THIRD,'Label',C(k),'Callback',@Callback) end endendfunction Callback(eventobject,~)%How can I reference to a specific submenu in the callback function?
%Like if Option 2 of the FIRST Menu was "expanded" then Option 3 of
%the SECOND Menu was "expanded" and finally Option 4 of the "THIRD"
%Menu was clicked on, how can I refer back to the menus and find out which
%ones were selected(Not the selected options but the respective menus)?
Best Answer