GUI Question: Have a pop-up dialog which has license agreement? Accept/Decline pushbuttons.
1 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I want to have a pop-up dialogic box with 'accept' and 'decline' pushbuttons BEFORE the application is launched. If users hit 'decline', the application exits.
Is this possible?
Thank you
0 个评论
回答(1 个)
Jos (10584)
2016-3-4
编辑:Jos (10584)
2016-3-4
Sure! You can, for instance, use QUESTDLG for this:
function Main
disp('Welcome to this function.') ;
ButtonName = questdlg('Do you accept agreement','License', ...
'Accept', 'Decline', 'Accept') ;
if ~isequal(ButtonName,'Accept')
disp('License not accepted. Program terminated.')
else
disp('Program continues.') ;
end
4 个评论
Adam
2016-3-5
The wrapper function would just be like any other function.
Put Jos' code in it and then simply call your GUIDE GUI afterwards. You can call a GUI simply by its name (if it takes arguments pass them to it as a function, but I assume yours doesn't).
So in the else part of Jos' code you would launch your GUI as e.g.
MyGUI( );
If you GUI is in MyGUI.fig and MyGUI.m
另请参阅
类别
在 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!