Have a listener modify a waitbar when user calls waitbar(x,hwaitbar)
3 次查看(过去 30 天)
显示 更早的评论
I recently cleaned up a piece of code I use modify the color of a waitbar's progress bar, ColorProgressBar.m.
If one creates a waitbar, h, the color can be controlled with that code.
h = waitbar(0.5,'my waitbar');
ColorProgressBar(h);
waitbar(0.75,h);
ColorProgressBar(h);
This was cobbled together from other Q&A around the internet. My only complaint with this code is that the user must still call ColorProgressBar after performing an update to a waitbar via waitbar(x,h).
Is there a way to add a listener somewhere to invoke this color change function automatically? Piecing through the hidden JavaWrapper and and JProgressBar used in the waitbar, I could not find any properties or events to listen for, preventing me from invoking this color change automatically.
Knowing how to do this would significantly cut back how users interact with my code, no longer requiring an explicit call to ColorProgressBar after the waitbar has been updated, as well as change other functions using similar concepts.
4 个评论
Walter Roberson
2018-10-15
Additional technical information about waitbar is at https://www.mathworks.com/matlabcentral/answers/293374-waitbar-color-2016a-is-broken-red-how-to-set-to-older-continuous-green#answer_227433
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!