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