Appdesigner - Appearance of second window similar to uialert

조회 수: 2 (최근 30일)
Kevin
Kevin 2021년 7월 8일
답변: Pavan Guntha 2021년 9월 3일
Hey everyone,
I am currently working on small GUI via appdesigner. The app basically consists of a main window and a dialog, that is sometimes called from the main app after processing some data. I created both windows via appdesigner in two seperate .mlapp files. So both apps work, the calling from the dialog by the main app too.
However I now want to change a bit the behavior/appearance of the dialog window. Currently it is just appearing as a seperate windows next to my mainwindow. However I like the appearence e.g. uialert uses. So I want the dialog to appear in the middle of my mainwindow, with the mainwindow beeing colored in dark gray, with some transparency. When just opening an uialert window this is just passing the app.UIFigure of the mainapp to uialert(). Is there a simple way I can achieve this with my appdesigner dialog?

답변 (1개)

Pavan Guntha
Pavan Guntha 2021년 9월 3일
Hello Kevin,
A possible workaround might be to design the dialog app using 'dialog' function instead of developing a MATLAB App because 'dialog' function helps to create pop up dialogues and allows us to control its position when popped out from the main app. To make the main window greyed out when the dialog is opened, you could make use of the following command:
set(app.UIFigure.Children, 'Enable', 'off');
The attached example MATLAB App illustrates the idea. The main app looks as follows:
Upon clicking the Enter Colors button, a dialog app pops up and asks the user to choose a color. The main app now gets greyed out (buttons and EditField get disabled).
For more details on 'dialog' function you could have a look at this documentation page.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by