Accessing another GUI's objects from a GUI

2 visualizaciones (últimos 30 días)
Paul
Paul el 12 de Ag. de 2011
I tried making the title a little less circuitous sounding but couldn't.
So I have a main GUI that has an initializing function that creates an instance of an object that is pretty much the meat and potatoes of the whole program. Then I have other smaller GUIs like wizard windows where the user enters data that defines that object i mentioned earlier.
My question is, how can I access a property of that object that sits in the main GUIfrom the other smaller data entry GUIs?

Respuestas (1)

Paulo Silva
Paulo Silva el 12 de Ag. de 2011
One easy way is to tag objects, for example if you have one slider in one GUI and you want it to be easy to find by other GUI do this
%on the GUI that contains the slider do this
set(h,'tag','sliderGUI1') %where h is the handle of the slider
%on another GUI you want to get the slider properties
h=findall(0,'tag','sliderGUI1');
%Now you can do things like getting the value get(h,'Value')
See this for one complete example.

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by