Transfer of information between GUIs

8 ビュー (過去 30 日間)
Clément P
Clément P 2016 年 4 月 1 日
回答済み: Clément P 2016 年 4 月 1 日
Hi everyone,
I'm working on a program which have 2 GUIs. My GUI_A is my main GUI and GUI_B is the sub GUI.
I have a PushButton in my GUI_B and I want to know in my GUI_A when this pushbutton has been activate. Do you know a way to do it?
My code in GUI_A :
handles.GUI_B=GUI_B; %Open GUI_B
handles.GUI_B=guidata(findall(0,'Tag','GUI_B)); %retrieve handles from GUI_B
while get(handles.GUI_B.PushButton,'Value')~=1
handles.GUI_B=guidata(findall(0,'Tag','GUI_B)); %Update Handles from GUI_B
end
close(handles.GUI_B.h);
The problem with this code is that it does an infinite loop... I would like to know if there is a way to send an information from GUI_B to GUI_A. Like (Code in GUI_B) :
function PushButton_Callback (hObject,~)
if get(hObject,'Value')
%Do stuff
send(hObject,'Value') to GUI_A
end
Or even a way to unpause GUI_A from GUI_B.
Anyway, I'm open to all proposals !!
Thanks all, Clément.

採用された回答

Clément P
Clément P 2016 年 4 月 1 日
Actually it works with waitfor(handles.GUI_B). ;)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by