How can I add a progress dialog box inside of a GUI axis?

13 ビュー (過去 30 日間)
Yahya Fahmi
Yahya Fahmi 2020 年 6 月 18 日
回答済み: Jemima Pulipati 2020 年 7 月 22 日
I'd like to have a progress dialog box be contained inside of a GUI axis, instead of in an external figure tab.
A GUI axis is a uifigure, and since one of the inputs for 'uiprogressdlg' is a figure, I thought the following would work:
% app.prog is the uifigure in question
% app.prog = uiaxes(app.UIFigure);
uiprogressdlg(app.prog,'Title','Please Wait','Message','any message.....');
However, doing this does not work, and I get the following error message:
% Error using matlab.ui.dialog.ProgressDialog (line 44)
% Invalid or deleted figure handle. First argument must be a valid figure handle
Does anyone have any idea why this would not work, maybe I am missing something very simple.
Appreciate anyone's help!
  2 件のコメント
Tommy
Tommy 2020 年 6 月 18 日
"A GUI axis is a uifigure"
UI axes created by the uiaxes() function are not the same as figures created by the uifigure() function. If app.UIFigure is your figure, you can pass that to uiprogressdlg, and the dialog box should show within your figure. I'm not sure you can do any better without creating your own progress dialog box.
Yahya Fahmi
Yahya Fahmi 2020 年 6 月 18 日
I see, thank you for your help!

サインインしてコメントする。

回答 (1 件)

Jemima Pulipati
Jemima Pulipati 2020 年 7 月 22 日
According to the documentation, uiprogressdlg() accepts figure created from uifigure() as an argument.
But according to your code you are trying to pass a UIAxes object as an argument hence you are receiving the error "Invalid or deleted figure handle". So you can use a figure handle as an argument to uiprogressdlg().
The appearance and behaviour of progress dialog can be customized by changing its properties.
Also, waitbar() provides a similar functionality if your interested.

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by