classafReflux::ProgressWorker
sys::Obj afReflux::ProgressWorker
Used by ProgressDialogues to update the progress bar.
Example:
dialogue.open(window) |ProgressWorker worker| { worker.update(1, 4, "Processing...") Actor.sleep(2sec) worker.update(2, 4, "A Very Long...") Actor.sleep(2sec) worker.update(3, 4, "Process...") Actor.sleep(2sec) worker.update(4, 4, "Done.") }
- cancelled
Bool cancelled { internal set }
Returns
true
if the user clicked the Cancel button.- detailText
Str detailText
The text displayed in the details panel.
- image
Image? image
The image displayed in the progress dialogue.
- showHideDetails
Void showHideDetails(Bool showHide)
Call to manually shows / hide the details panel.
- text
Str text
The message displayed in the progress dialogue.
- update
Void update(Int workDone, Int workTotal, Str? msg := null)
Updates the progress bar to show work done.
msg
is optional and sets the dialogue text and is appended to the detail text.If the dialogue has been cancelled then this throws a
CancelledErr
.- warn
Convenience method for:
- Changing the dialogue image to a warning image
- Opening the detail text and showing the msg
- Ensuring the dialog doesn't close when finsihed (so users can read the warning msg)