]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/AnimateCtrl.py
The great wxVScrolledWindow refactoring: allow using it both horizontal and
[wxWidgets.git] / wxPython / demo / AnimateCtrl.py
CommitLineData
e19b9131
RD
1
2import wx
3import wx.animate
4from Main import opj
5
6GIFNames = [
7 'bitmaps/AG00178_.gif',
8 'bitmaps/BD13656_.gif',
9 'bitmaps/AG00185_.gif',
10 'bitmaps/AG00039_.gif',
11 'bitmaps/AG00183_.gif',
12 'bitmaps/AG00028_.gif',
13 ]
14
15#----------------------------------------------------------------------
16
17class TestPanel(wx.Panel):
18 def __init__(self, parent, log):
19 self.log = log
20 wx.Panel.__init__(self, parent, -1)
21
22 sizer = wx.FlexGridSizer(2,3,5,5)
23 for name in GIFNames:
24 ani = wx.animate.Animation(opj(name))
25 ctrl = wx.animate.AnimationCtrl(self, -1, ani)
26 ctrl.SetUseWindowBackgroundColour()
27 ctrl.Play()
cbfc9df6 28 sizer.AddF(ctrl, wx.SizerFlags().Border(wx.ALL, 10))
e19b9131
RD
29
30 border = wx.BoxSizer()
cbfc9df6 31 border.AddF(sizer, wx.SizerFlags(1).Expand().Border(wx.ALL, 20))
e19b9131
RD
32 self.SetSizer(border)
33
34
35#----------------------------------------------------------------------
36
37def runTest(frame, nb, log):
38 win = TestPanel(nb, log)
39 return win
40
41#----------------------------------------------------------------------
42
43
44
45overview = """<html><body>
46<h2><center>wx.animate.AnimationCtrl</center></h2>
47
48wx.animate.AnimationCtrl is like a wx.StaticBitmap but is able to
20be5dfc 49display an animation by extracing frames from a multi-image GIF file.
e19b9131
RD
50
51</body></html>
52"""
53
54
55
56if __name__ == '__main__':
57 import sys,os
58 import run
59 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
60