1

我试图弹出一个帮助窗口,所以用户看到的第一件事就是一个帮助窗口。但它留在我的 GUIDE 窗口的后面。我将代码放在我的打开函数中。

% --- Executes just before layout is made visible.
function layout_OpeningFcn(hObject, ~, handles, varargin)
% Open the help dialog
helpdlg('My help message')

% opening code here...


guidata(hObject, handles);
4

1 回答 1

2

您要做的是中断OpeningFcn的执行以显示窗口。为避免在点击“ok”后等待很长时间,您应该将帮助信息放在 OpeningFcn 的末尾。

% --- Executes just before layout is made visible.
function layout_OpeningFcn(hObject, ~, handles, varargin)
% Open the help dialog
h = helpdlg('My help message');

% opening code here...


guidata(hObject, handles);

%# optional: set(hObject,'visible','on')
%# if you want to have the GUI be visible when the dialogue pops up.

uiwait(h); %# wait for closing the window
于 2012-12-29T13:43:06.133 回答