Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: [Q:] Tricky Use of uimenu
Replies: 6   Last Post: Jul 16, 1996 11:04 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Dunn

Posts: 7
Registered: 12/7/04
[Q:] Tricky Use of uimenu
Posted: Jul 15, 1996 1:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all,

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.

ENJOY,

Pete.
(Peter Dunn
dunn@usq.edu.au)





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.