필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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

채택된 답변

Sarah Mohamed
Sarah Mohamed 2018년 1월 5일
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
joe
joe 2018년 1월 10일
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);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by