Waitbar problems in GUI

조회 수: 6 (최근 30일)
abaza
abaza 2020년 11월 21일
답변: TED MOSBY 2025년 8월 15일 12:36
Hello Matlab community!
I have a GUI in GUIDE and in one figure axes, some plottings are performed in a loop and finally I end up with a plot with pultiple lines (e.g. see fig1 attached)!
The point is that I have to use a waitbar till the whole process is finished, BUT, the waitbar doesn't allow me to use any other software in my PC since it always should pop up after each loop till all lines are all plotted!
So, do you know any solution for that???
I thought either:
1) you know something about WAITBAR properties that I am unaware of, that could allow me to work on other things on my PC while GUI software is running
or
2) Put waitbar integrated in a figure on the GUI! For that solution, I tried everything but still I cannot integrate it successfully!
Could someone give a solution????

답변 (1개)

TED MOSBY
TED MOSBY 2025년 8월 15일 12:36
Hi Abaza,
You may try the following workarounds:
  1. Change the "Window style" to "normal" : https://in.mathworks.com/help/matlab/ref/waitbar.html?searchHighlight=waitbar&s_tid=srchtitle_support_results_1_waitbar#:~:text=Window%20style%2C%20specified%20as%20one%20of%20the%20following%3A
  2. Don’t use waitbar at all - draw a progress bar inside your existing GUIDE figure. It won’t create new windows, so it never makes your PC inaccessible : https://stackoverflow.com/questions/5368861/how-to-add-progress-bar-control-to-matlab-gui
  3. If you want to keep waitbar, avoid calling waitbar in every iteration (that brings the window to the front). Instead you can create it once and update its patch directly.
Hope it helps!

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by