Setting a GUI Pop-up Menu to a given option without doing it manually with the arrow (i.e. in the coding)

I have a test case that will be loaded to the GUI thereby setting all of the GUI edit boxes and most importantly the pop-up menus. My question lies in how to "set" the pop-up menus such that they do not lose there original cell structure.
e.g. Pop-up menu is formatted as: popupmenu = {'Left';'Right';'Down';'Up'} where this pop-up menu is for a direction i.e. when the pop-up menu arrow is clicked these four options appear
Within the test case a parameter is defined as direction = 'Right'
What I desire is that when the case is loaded I want the pop-up menu to be set to what is given in the test case for direction, which in this case is 'Right'
The key is that I don't want to modify the string of the pop-up menu, in other words, after the pop-up menu has changed to 'Left' I want to be able to hit the arrow and still see all four options.
Note the question is not in relation to loading the case; it is in relation to how to set the pop-up menu to the option that corresponds with the direction string.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!