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