How do I set the popup menu to automatically select the first string when run?
Show older comments

When I run the GUI, this comes up. I have used the following script to set the first string in the popup menu:
function GUI_OpeningFcn(hObject, eventdata, handles, varargin)
set(handles.test_pop,'Value',1);
However, when I run the GUI and click calculate, I get errors because no string in the menu has actually been selected. I tested that the script I added changed the string when I run the GUI by changing the value from 1 to 2 or 3 and it does change the string but it only shows it as the string in the box, it does not seem to select it as the first 'value'. So how do I have it set to 'Choose Material' when it first runs?
Accepted Answer
More Answers (0)
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!