]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/GIFAnimationCtrl.py
compilation fix for WXWIN_COMPATIBILITY_2_2 (bug 1252476)
[wxWidgets.git] / wxPython / demo / GIFAnimationCtrl.py
CommitLineData
2e5aa9c4
RD
1
2import wx
3from wx.animate import GIFAnimationCtrl
4
5from Main import opj
6
7GIFNames = [
6c75a4cf
RD
8 'bitmaps/AG00178_.gif',
9 'bitmaps/BD13656_.gif',
10 'bitmaps/AG00185_.gif',
11 'bitmaps/AG00039_.gif',
12 'bitmaps/AG00183_.gif',
13 'bitmaps/AG00028_.gif',
2e5aa9c4
RD
14 ]
15
16#----------------------------------------------------------------------
17
18class 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
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.GIFAnimationCtrl</center></h2>
47
48wx.animate.GIFAnimationCtrl is like a wx.StaticBitmap but is able to
49display an animation by extracing frames from a multi-images GIF file.
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