I'mm trying to do something that is (for me anyhow) rather on the tricky side. A bit _too_ tricky for me, and hence my writing here.
I'm using uimenus and they are going fine. Suppose I have a menu with submenus as follows (dumb example follows):
--> Main Menu Item--> COMPUTER --> Sub Menu Items--> Mac PC UNIX
Each of the submenu's has its own Callback function. But... suppose the number of submenu items is _variable_ (that is, we might also have 'Amiga' sometimes). When I start the function, the function must check to see what sub menu items are needed, and put them there. I can start off OK:
COMPLIST=['Mac';'PC';'UNIX']; CompH=uimenu('Label','Computer') for i=1:size(COMPLIST,1), %PERHAPS SOMEONE CAN VECTORISE FOR ME TOO? uimenu(CompH,'Label',COMPLIST(i,:)) end;
BUT... How do I add Callbacks? I can't use the indexing variable, i, because it is always equal to 3 (as COMPLIST stands now anyhow). So when the function finishes, i=3 always---the finishing value of i.
Please help! It may be an easy one, but nothing comes to more poor old mind. Thanx heaps.