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