How to get and set handles of GUI1 in GUI2 (GUI1 and GUI2 are stored in a different folders)

1 vue (au cours des 30 derniers jours)
Hi everyone.
my question is:
I have for exemple to GUIs(GUI1 und GUI2). in every GUI there are so many figures(edittext ,Text, Pushbutton,...). what I want is, to have a ability to access to every figure of any GUI (for exemple handles.edittext1 from GUI1) in another GUI(for exemple GUI2). Note: the GUI1 and GUI2 are in a different folders
I use MATLAB R2017b

Réponse acceptée

Sarah Mohamed
Sarah Mohamed le 5 Jan 2018
Hello Joe!
I think you'll find the example for sharing data between GUIs at the following page helpful:
https://www.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html#bvih9xi
You can also take a look at the following video tutorial discussing this subject:
https://blogs.mathworks.com/videos/2005/10/03/guide-video-part-two/
  1 commentaire
joe
joe le 10 Jan 2018
hello Sarah!
thank you for your help.
this is how i solve it
function push_buttonGUI2_Callback(hObject, eventdata, handles)
% this is a button inside a GUI2
% Run GUI1
GUI1 % run GUI1
% Get the tag of the object to be able to access on it
h=findall(0,'tag','edit_TextGUI1'); % let say edit text in GUI1
% set a number/name inside edit text of GUI1
set(h,'String', ' I can controll you now :)');
% get the Content
Content = get(h,'String');
% Get the tag of selected_file (pushbutton) to be able to access on it
g_m=findobj('tag','push_buttonGUI1');
% Get handles of GUI1
gd_m=guidata(g_m);
% click on the button of GUI1 from GUI2
GUI1('push_buttonGUI1_Callback',gd_m.selected_file,[],gd_m);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by