How do I stop flickering in my transparent Splash screen in Tkinter? How do I stop flickering in my transparent Splash screen in Tkinter? tkinter tkinter

How do I stop flickering in my transparent Splash screen in Tkinter?


A rule of thumb you should follow is to never put a call to sleep in a GUI. It does exactly what it says, it causes your whole application to sleep. This means that the GUI is not able to redraw itself, and is likely the cause of your flicker.

If you want a window to be destroyed after a period of time, use the after method. For example:

delta = (self.__wait - now) * 1000self.after(delta, self.close)

You'll need to define self.close to destroy the window.

This gives you an opportunity to add a little "fade away" effect if you like. You do this by checking to see if the alpha of the splash screen is below some threshold (say, 10%) and destroy it. If it's not, reduce the alpha by 10% and call the function again in 100 ms.