]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/wxButton.py
6fa738fa4374abfe0bc7ac046077ef97cacff449
[wxWidgets.git] / utils / wxPython / demo / wxButton.py
1
2 from wxPython.wx import *
3
4 #----------------------------------------------------------------------
5
6 class TestPanel(wxPanel):
7 def __init__(self, parent, log):
8 wxPanel.__init__(self, parent, -1)
9 self.log = log
10
11 wxButton(self, 10, "Hello", wxPoint(20, 20)).SetDefault()
12 EVT_BUTTON(self, 10, self.OnClick)
13
14 wxButton(self, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(90, 45))
15 EVT_BUTTON(self, 20, self.OnClick)
16
17 bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
18 wxBitmapButton(self, 30, bmp, wxPoint(140, 20),
19 wxSize(bmp.GetWidth()+10, bmp.GetHeight()+10))
20 EVT_BUTTON(self, 30, self.OnClick)
21
22 self.testBtn = wxButton(self, 40, "click here", wxPoint(20, 150))
23 EVT_BUTTON(self, 40, self.Test)
24
25
26 def OnClick(self, event):
27 self.log.WriteText("Click! (%d)\n" % event.GetId())
28
29 #----------------------------------------------------------------------
30
31 def runTest(frame, nb, log):
32 win = TestPanel(nb, log)
33 return win
34
35 #----------------------------------------------------------------------
36
37
38
39
40
41
42
43
44
45
46 overview = """\
47 """
48
49