Hello,
I’m developing a Python plugin using the Extension Wizard template as the code basis, and I would like to add a loading bar.
I’ve seen that it can be done like this:
progress_bar = slicer.util.createProgressDialog(parent=slicer.util.mainWindow(), autoClose=False, labelText="Please wait", windowTitle="Painting contour...", value=0)
progress_bar.setCancelButton(None)
slicer.app.processEvents()
Here’s a screenshot of what it looks like:
How can I make the window appear correctly?
Note that the window is encapsulated within:
with slicer.util.tryWithErrorDisplay("Failed to compute segmentation.", waitCursor=True):
and when an error occurs, it displays the error window and the progress bar window correctly (with the bar, the inside text and the window background).
I’m using Slicer 5.4.0 r31938 / 311cb26 on Ubuntu LTS 22.04.3.