필터 지우기
필터 지우기

Control Gui with another Gui

조회 수: 1 (최근 30일)
Joep
Joep 2012년 12월 11일
I would like the handles of a GUI into another GUI. I did this with the method described below, where I use the matlab function in another script. Only the handles are herein not found. Probably because the handles can not be called in the other matlab script.
Script which calls the other function
function Omhoog5Links_Callback(hObject, eventdata, handles)
% hObject handle to Omhoog5Links (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = 'Omhoog5Links'
setappdata(0, 'kalibratie', handles)
kalibreren = getappdata(0, 'kalibreren')
feval(kalibreren)
The Function which is called
function Kalibratieframe(hObject, eventdata, handles)
% hObject handle to Kalibratieframe (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
findObj(Hoogtefilmpjebeamer, 'type', 'figure')
h=getappdata(0, 'kalibratie')
switch h
case 'Omhoog5Links'
h = get(handles.Kalibratieframe, 'Position')
i = h+[0 -5 0 0]
set(handles.Kalibratieframe, 'Position', i)
The function is saved by in OpeningFcn
setappdata(0, 'kalibreren', @Kalibratieframe)

답변 (2개)

Image Analyst
Image Analyst 2012년 12월 12일

Babak
Babak 2012년 12월 12일
I think you need to remove the line
handles = 'Omhoog5Links'
because handles includes all the data of the GUI and you are simply over-writing it with a string. You are clearing all the handle data with this line and all what is written in setappdata(0, 'kalibratie', handles) as for the value of the data is a string that is passed.

카테고리

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