1

I am working on a project that has a loading screen which is a animated GIF image. The only problem is when I try to display the animated GIF in the Label it only shows the first frame. Why does it do this? And is there a way to display all the frames in the GIF? I know that there has been many other questions like this but none of those questions helped me and I tried their code and it did not work.

Code:

from Tkinter import *

class Application(Frame):
    def __init__(self, parent):
        Frame.__init__(self,parent)
        self.pack(fill=BOTH)

        self.create_widgets()
        self.animate()

    def create_widgets(self):
        self.label = Label(self, bd=0)
        self.label.pack()

    def animate(self):
        img = PhotoImage(file="Loading.gif")

        self.label.config(image=img)
        self.label.image=img

root = Tk()

app = Application(root)

root.mainloop()
cdw100100
  • 192
  • 1
  • 13
  • `tkinter` cannot natively handle all frames of a GIF image sequence. Use a library like [PIL](https://pillow.readthedocs.org/). – TigerhawkT3 May 31 '15 at 23:09
  • @TigerhawkT3 I know this. I did a little bit of research and I found out that. Could you proved a example on how I could go about doing this? – cdw100100 May 31 '15 at 23:13
  • @BryanOakley I have looked at this example and it did not help me out. I even tried their code and it did not work for me. – cdw100100 May 31 '15 at 23:15

0 Answers0