]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxButton.py
SWIGged updates for wxMac
[wxWidgets.git] / wxPython / demo / wxButton.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
3
96bfd053
RD
4import images
5
cf694132
RD
6#----------------------------------------------------------------------
7
8class TestPanel(wxPanel):
9 def __init__(self, parent, log):
fe953afb
RD
10 wxPanel.__init__(self, parent, -1,
11 style=wxNO_FULL_REPAINT_ON_RESIZE)
cf694132
RD
12 self.log = log
13
5ed3dab2 14 b = wxButton(self, 10, "Hello", wxPoint(20, 20))
cf694132 15 EVT_BUTTON(self, 10, self.OnClick)
5ed3dab2
RD
16 b.SetBackgroundColour(wxBLUE)
17 b.SetForegroundColour(wxWHITE)
9b3d3bc4 18 b.SetDefault()
cf694132 19
5a1eefc7 20 b = wxButton(self, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(120, 45))
cf694132
RD
21 EVT_BUTTON(self, 20, self.OnClick)
22
185d7c3e
RD
23 b.SetToolTipString("This is a Hello button...")
24
96bfd053 25 bmp = images.getTest2Bitmap()
990416e0
RD
26 mask = wxMaskColour(bmp, wxBLUE)
27 bmp.SetMask(mask)
eec92d76 28
5a1eefc7 29 wxBitmapButton(self, 30, bmp, wxPoint(160, 20),
cf694132
RD
30 wxSize(bmp.GetWidth()+10, bmp.GetHeight()+10))
31 EVT_BUTTON(self, 30, self.OnClick)
32
cf694132
RD
33 def OnClick(self, event):
34 self.log.WriteText("Click! (%d)\n" % event.GetId())
35
064f8bf6 36
cf694132
RD
37#----------------------------------------------------------------------
38
39def runTest(frame, nb, log):
40 win = TestPanel(nb, log)
41 return win
42
43#----------------------------------------------------------------------
44
45
46
47
48
49
50
51
52
53
54overview = """\
55"""
56
57