2 from wxPython
.wx
import *
6 #----------------------------------------------------------------------
8 class TestPanel(wxPanel
):
9 def __init__(self
, parent
, log
):
10 wxPanel
.__init
__(self
, parent
, -1,
11 style
=wxNO_FULL_REPAINT_ON_RESIZE
)
14 b
= wxButton(self
, 10, "Hello", wxPoint(20, 20))
15 EVT_BUTTON(self
, 10, self
.OnClick
)
16 b
.SetBackgroundColour(wxBLUE
)
17 b
.SetForegroundColour(wxWHITE
)
20 b
= wxButton(self
, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(120, 45))
21 EVT_BUTTON(self
, 20, self
.OnClick
)
23 b
.SetToolTipString("This is a Hello button...")
25 bmp
= images
.getTest2Bitmap()
26 mask
= wxMaskColour(bmp
, wxBLUE
)
29 wxBitmapButton(self
, 30, bmp
, wxPoint(160, 20),
30 wxSize(bmp
.GetWidth()+10, bmp
.GetHeight()+10))
31 EVT_BUTTON(self
, 30, self
.OnClick
)
33 def OnClick(self
, event
):
34 self
.log
.WriteText("Click! (%d)\n" % event
.GetId())
37 #----------------------------------------------------------------------
39 def runTest(frame
, nb
, log
):
40 win
= TestPanel(nb
, log
)
43 #----------------------------------------------------------------------