]>
Commit | Line | Data |
---|---|---|
cf694132 RD |
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 | ||
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 RD |
16 | |
17 | wxButton(self, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(90, 45)) | |
18 | EVT_BUTTON(self, 20, self.OnClick) | |
19 | ||
20 | bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) | |
eec92d76 RD |
21 | # the mask is still having troubles on win95/98... |
22 | #mask = wxMaskColour(bmp, wxBLUE) | |
23 | #bmp.SetMask(mask) | |
24 | ||
cf694132 RD |
25 | wxBitmapButton(self, 30, bmp, wxPoint(140, 20), |
26 | wxSize(bmp.GetWidth()+10, bmp.GetHeight()+10)) | |
27 | EVT_BUTTON(self, 30, self.OnClick) | |
28 | ||
29 | ||
30 | def OnClick(self, event): | |
31 | self.log.WriteText("Click! (%d)\n" % event.GetId()) | |
32 | ||
064f8bf6 | 33 | |
cf694132 RD |
34 | #---------------------------------------------------------------------- |
35 | ||
36 | def runTest(frame, nb, log): | |
37 | win = TestPanel(nb, log) | |
38 | return win | |
39 | ||
40 | #---------------------------------------------------------------------- | |
41 | ||
42 | ||
43 | ||
44 | ||
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | ||
51 | overview = """\ | |
52 | """ | |
53 | ||
54 |