Control Gui with another Gui
2 ビュー (過去 30 日間)
古いコメントを表示
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)
0 件のコメント
回答 (2 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!