Have a listener modify a waitbar when user calls waitbar(x,hwaitbar)

3 Ansichten (letzte 30 Tage)
Jake August
Jake August am 12 Okt. 2018
Kommentiert: Walter Roberson am 15 Okt. 2018
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 Kommentare
Jake August
Jake August am 15 Okt. 2018
The waitbar in R2017/18 uses the JProgressBar, not a patch. I know how to set the foreground of the JProgressBar to change colors, but would like that to be an automatic feature of waitbar(x,hwaitbar).
I realize that I could add a property to the waitbar figure, e.g. "ProcessCompleted", that has a postset listener to perform all waitbar updates and manage color, but again, I want it to behave as natural as the update waitbar command.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Dialog Boxes finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by