Using a GUI popup menu to change an Edit Text box
Show older comments
I'm hoping I can get some help without having to submit a picture or my code, but I have a GUI setup up with numerous edit text fields. I have some different "profiles" set up that I can select from using a popup menu. What I'd like to see happen is when I change from one "profile" to another, the edit text boxes will all change to the values represented by that profile. Currently the values are getting stored correctly as my plots turn out correctly when I plot my different profiles, but the edit text boxes look like they'd be plotting the initial values they have when I start up the mfile.. Is this possible?
1 Comment
Adam Kaas
on 18 May 2012
Accepted Answer
More Answers (1)
Sean de Wolski
on 18 May 2012
After the popup menu returns and gives you the information you need, extract this information and then set the 'string' property of the edit boxes to be the new info:
%Example uicontrol
h = uicontrol('units','norm','pos',[0.2 0.2 0.6 0.6],'style','edit','string','Hello World');
To change its size and string:
%Now let's set it to be something different:
set(h,'string','It''s Friday!','pos',[0.4 0.4 0.2 0.2]);
1 Comment
Adam Kaas
on 18 May 2012
Categories
Find more on Entering Commands 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!