Dialog box's Parent
10 ビュー (過去 30 日間)
古いコメントを表示
Merve Makbule Semizer
2020 年 6 月 12 日
コメント済み: Merve Makbule Semizer
2020 年 6 月 12 日
function tri
f=figure(...
'MenuBar','none',...
'Position',[400 200 600 445]...
);
m_file=uimenu('Label','File');
uimenu(m_file,'Label','New','Accelerator','N','Callback',{@new,f});
end
function new(hObject, eventdata, handle)
d=dialog('Name','OPEN');
end
I want to set the d's parent as f figure. I wrote
d=dialog('Parent',handle,'Name','OPEN');
instead of this:
d=dialog('Name','OPEN');
But i'm getting an error:
Error using figure
While setting the 'Parent' property of Figure:
Figure parent must be the root.
Error in dialog (line 84)
hDialog = figure('ButtonDownFcn' ,btndown , ...
Error in den>new (line 10)
d=dialog('Parent',handle,'Name','OPEN');
Error while evaluating Menu Callback
How can I fix this error and reach my aim?
0 件のコメント
採用された回答
Walter Roberson
2020 年 6 月 12 日
You cannot do that. Dialog boxes are figures; you cannot set a figure (the dialog box) to be a child of another figure.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!