I'm developing an image processing application where, one of the routines takes more than 5 seconds to process. To make this process more professional, I want to display a window, showing a "please wait" message while that routine takes it's time.
The problem is that, although the code executes sequentially, like it should, the popups only appear after the 5 second-routine runs, and not before like they should.
The logic is:
- showacceptdialog(saying image file loaded ok, requires pressing the
- call the image processing method
- showmessagewindow(show popup panel, no input required)
- showmessagewindow(hide popup panel)
This image processing method translates to the following code (heavily simplified):
Foto = _foto
# This calls the method to show the "please wait" popup panel
if Foto.path_ficheiro.length() > 0:
var pal = palette_cores.new()
# The next method takes between 5 to 6 seconds to run
var cores = pal.calcular(Foto.path_ficheiro)
# Hides the "please wait" popup panel
With this code, the popup never appears, although it is executed in the right sequence, because Godot only updates the GUI after the routine completes.
I've tried several yields (idleframe, physicsframe, completed, custom signals, splitting the method in two, having a signal call the second part) between
pal.calcular but nothing makes Godot show the popup before running the
Does anyone knows a way to make it stop, update the GUI and then process the rest? Having the program "freeze" for 5 seconds with no feedback is bad.