Have a pop-up dialog which has license agreement?

조회 수: 3 (최근 30일)
A
A 2016년 3월 5일
댓글: Geoff Hayes 2016년 3월 5일
In GUI, is there a way to first have a pop-up dialog box launch and show my license agreement, with scroll bars, accept and decline buttons. Accept moves user to application, Decline exits the program?
Thanks

답변 (1개)

Geoff Hayes
Geoff Hayes 2016년 3월 5일
A - I would create a separate GUI to handle the licensing information. When the user presses the Accept button, then you would close this GUI and launch the main one. If the user presses Decline, then just close this GUI and do nothing.
  댓글 수: 2
A
A 2016년 3월 5일
Sorry about multiple threads.
Thanks for the GUI advice. How can I create two separate GUIs?
Should I create a separate .m file using the GUIDE?
How can I 'run' the second GUI from the first GUI?
Thanks!
Geoff Hayes
Geoff Hayes 2016년 3월 5일
A - yes, you would create a separate GUI (using GUIDE) so that you have another m and fig file for that introductory or licensing GUI. In that GUI, you would have then have two buttons with their callbacks defined as
% --- Executes on button press in acceptButton.
function acceptButton_Callback(hObject, eventdata, handles)
% hObject handle to acceptButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% launch the main GUI
mainGui;
close(handles.figure1);
% --- Executes on button press in declineButton.
function declineButton_Callback(hObject, eventdata, handles)
% hObject handle to declineButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close(handles.figure1);
Where mainGui is the name of the second or main GUI that you wish th user to interact with.
See the attached for an example.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by