]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxStaticBitmap.py
Applied patch [ 827011 ] Event-based processing of item tooltips in wxTreeCtrl
[wxWidgets.git] / wxPython / demo / wxStaticBitmap.py
... / ...
CommitLineData
1# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2#
3# o Updated for wx namespace
4#
5
6import wx
7import images
8
9#----------------------------------------------------------------------
10
11class TestPanel(wx.Panel):
12 def __init__(self, parent, log):
13 wx.Panel.__init__(self, parent, -1)
14 self.log = log
15 self.count = 0
16
17 wx.StaticText(self, -1, "This is a wxStaticBitmap.", (45, 15))
18
19 bmp = images.getTest2Bitmap()
20 mask = wx.MaskColour(bmp, wx.BLUE)
21 bmp.SetMask(mask)
22 wx.StaticBitmap(self, -1, bmp, (80, 50), (bmp.GetWidth(), bmp.GetHeight()))
23
24 bmp = images.getRobinBitmap()
25 wx.StaticBitmap(self, -1, bmp, (80, 150))
26
27 wx.StaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175))
28
29
30#----------------------------------------------------------------------
31
32def runTest(frame, nb, log):
33 win = TestPanel(nb, log)
34 return win
35
36#----------------------------------------------------------------------
37
38overview = """\
39A static bitmap control displays a bitmap.
40
41The bitmap to be displayed should have a small number of colours, such as 16,
42to avoid palette problems.
43
44A bitmap can be derived from most image formats using the wxImage class.
45
46"""
47
48if __name__ == '__main__':
49 import sys,os
50 import run
51 run.main(['', os.path.basename(sys.argv[0])])