]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/StaticBitmap.py
Give BitmapButton its own demo, get rid of ErrorDialogs
[wxWidgets.git] / wxPython / demo / StaticBitmap.py
1
2 import wx
3 import images
4
5 #----------------------------------------------------------------------
6
7 class TestPanel(wx.Panel):
8 def __init__(self, parent, log):
9 wx.Panel.__init__(self, parent, -1)
10 self.log = log
11 self.count = 0
12
13 wx.StaticText(self, -1, "This is a wx.StaticBitmap.", (45, 15))
14
15 bmp = images.getTest2Bitmap()
16 mask = wx.MaskColour(bmp, wx.BLUE)
17 bmp.SetMask(mask)
18 wx.StaticBitmap(self, -1, bmp, (80, 50), (bmp.GetWidth(), bmp.GetHeight()))
19
20 bmp = images.getRobinBitmap()
21 wx.StaticBitmap(self, -1, bmp, (80, 150))
22
23 wx.StaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175))
24
25
26 #----------------------------------------------------------------------
27
28 def runTest(frame, nb, log):
29 win = TestPanel(nb, log)
30 return win
31
32 #----------------------------------------------------------------------
33
34 overview = """\
35 A StaticBitmap control displays a bitmap.
36
37 The bitmap to be displayed should have a small number of colours, such as 16,
38 to avoid palette problems.
39
40 A bitmap can be derived from most image formats using the wx.Image class.
41
42 """
43
44 if __name__ == '__main__':
45 import sys,os
46 import run
47 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])