How to implement modal progress bars and wait bar in MATLAB Simulink

7 ビュー (過去 30 日間)
Kunal
Kunal 2024 年 5 月 9 日
コメント済み: Nick 2025 年 1 月 13 日
Hello everyone,
I've developed a Simulink model where progress bars are displayed on a UI figure within the Simulink environment. While a progress bar is active, users can inadvertently click anywhere within the Simulink interface. However, I want to restrict user interaction with the Simulink interface while a progress bar is active, allowing control only when the progress is completed. How can I implement this restriction effectively?

回答 (1 件)

Poorna
Poorna 2024 年 5 月 15 日
Hi Kunal,
I see you want to implement a modal progress bar. In MATLAB you can create modal ui figures by setting the "WindowStyle" property of the ui figures to "modal". By setting the "WindowStyle" property to "modal" the ui figure will be displayed on top of all other figures and restricts the user from accessing other parts of the application.
To know more about the "WindowStyle" property refer to the "Window Appearance" section in the following documentation:
If you are using "waitbar" function to mimick a progress bar, then you can use the "WindowStyle" of the wait bar to make the bar modal.
Hope this Helps!
  3 件のコメント
Nick
Nick 2024 年 12 月 10 日
Hi,
I'm also struggling with this topic, as all the dialogs, I'm able to create, are actually created in the MATLAB, not in Simulink.
For example, if the "WindowsStyle" is set to "docked", then the dialog will be docked in the MATLAB, disregarding that the creation of the dialog was triggered from the Simulink callback (I'm trying to show a dialog as reaction on a ToolStrip action).
Logically, we need to pass something like "groot" as parent for the new dialog, but I can't find how to do this in Simulink.
Thank you!
Nick
Nick 2025 年 1 月 13 日
One more addition, I've received answer from Support, that actually all the dialogs belong to MATLAB, not to Simulink, and there is no alternative to it. Meaning, that desired functionality cannot be achieved with actual API of Simulink.

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

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by