Waitbar problems in GUI

2 次查看(过去 30 天)
abaza
abaza 2020-11-21
回答: TED MOSBY 2025-8-15
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
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