How to change the GUI content when selecting different menu buttons?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alon Rozen
el 15 de Nov. de 2016
Comentada: Alon Rozen
el 16 de Nov. de 2016
Hi all,
Using GUIDE, I am developing a GUI which controls 3 different aspects of analysis work: input data, presentations and analysis.
I want to have three menu buttons for each of these (I know how to add menu buttons to a GUI). I want that each time a menu button is selected all the content of the main GUI figure - all the controls that the user see - will change. Much like the behavior of apps on a smartphone.
I know that I can create some buttons on the main GUI that, when being pushed, will open another GUI which will do the job. However, I want the more 'sexy' way of having to work with only one GUI.
Is there a way to do it?
Thanks, Alon
2 comentarios
Romano Geerling
el 15 de Nov. de 2016
To give a simple answer, yes you can.
However creating a GUI like this requires you to put all the controls into a uipanel and set the visibility to on and off when the user selects something from the menu. Does the menu only contains 3 options, then it might not be such a big issue.
If you create much more options the code is maybe harder to read and maintain and the performance might go down. Although you set the visibility of the uipanel to off all the code will still be executed by MATLAB.
Respuesta aceptada
Adam
el 15 de Nov. de 2016
You can do this programmatically quite easily. You can also do it in GUIDE with a little bit of programmatic addition, it is just a bit messy.
Basically you would need to put 3 panels on top of each other (using the object browser or 'send to back' option on the top panel) in GUIDE, with the functionality of each of your different GUIs in.
Then it is just a matter of making the other panels invisible and the one you want visible in response to the menu changing.
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!