Tips: wx.Python: Animated Gif in


import wx

import wx.animate # ..\wx\animate.py

class MyPanel(wx.Panel):

“”” class MyPanel creates a panel, inherits wx.Panel “””

def __init__(self, parent=None):

wx.Panel.__init__(self, parent)

self.SetBackgroundColour(“white”)

ag_fname = r”progress.gif”

self.ag = wx.animate.GIFAnimationCtrl(self, -1, ag_fname, pos=(0, 0), size=(64,64))

self.ag.GetPlayer().UseBackgroundColour(True)

self.ag.Play()

#self.ag.Stop()

if __name__ == ‘__main__’:

app = wx.App(redirect = 0)

frame = MyPanel(None)

frame.Show(True)

app.SetTopWindow(frame)

app.MainLoop()

Advertisements

One thought on “Tips: wx.Python: Animated Gif in

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s