Accessing another GUI's objects from a GUI

1 visualizzazione (ultimi 30 giorni)
Paul
Paul il 12 Ago 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?

Risposte (1)

Paulo Silva
Paulo Silva il 12 Ago 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.

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by