This module encapsulates the concept of a platform-dependent animation. An animation is a sequence of frames of the same size.
Sound is not supported by wx.animate.Animation.
The following example shows a simple implementation that utilizes wx.animate.AnimationCtrl:
import wx
import wx.animate
GIFNames = [
'bitmaps/AG00178_.gif',
'bitmaps/BD13656_.gif',
'bitmaps/AG00185_.gif',
'bitmaps/AG00039_.gif',
'bitmaps/AG00183_.gif',
'bitmaps/AG00028_.gif',
]
class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
sizer = wx.FlexGridSizer(2,3,5,5)
for name in GIFNames:
ani = wx.animate.Animation(name)
ctrl = wx.animate.AnimationCtrl(self, -1, ani)
ctrl.SetUseWindowBackgroundColour()
ctrl.Play()
sizer.AddF(ctrl, wx.SizerFlags().Border(wx.ALL, 10))
border = wx.BoxSizer()
border.AddF(sizer, wx.SizerFlags(1).Expand().Border(wx.ALL, 20))
self.SetSizer(border)
app = wx.App()
frame = wx.Frame(None)
panel = TestPanel(frame)
frame.Show()
app.MainLoop()