1
當我按下'X'關閉彈出窗口時,出現這樣的錯誤。錯誤使用刪除()MATLAB GUI
這裏是我的錯誤:
Undefined function or variable 'PopupWindow'.
Error while evaluating UIControl Callback
這裏是我使用的代碼:
function PopupWindow = alertBox(figg,position,showtext,titlebar);
PopupWindow = uipanel('Parent',figg,'Units','pixels','Position',position,...
'BackGroundColor',CYAN,'BorderType','beveledout','ButtonDownFcn','','Visible','on');
uicontrol('Parent',PopupWindow,'Units','pixels','Style','PushButton','String','X',...
'Position',[position(3)-margin+1 position(4)-margin+1 margin-2 margin-2],'Callback',...
['delete(PopupWindow);']);
這非常明確和有用。非常感謝你! –