]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxButton.py
2e9664e70ac1dfeb33caeab6d1aaeb934e20c67b
2 from wxPython
.wx
import *
6 #----------------------------------------------------------------------
8 class TestPanel(wxPanel
):
9 def __init__(self
, parent
, log
):
10 wxPanel
.__init
__(self
, parent
, -1)
13 b
= wxButton(self
, 10, "Hello", wxPoint(20, 20))
14 EVT_BUTTON(self
, 10, self
.OnClick
)
15 b
.SetBackgroundColour(wxBLUE
)
16 b
.SetForegroundColour(wxWHITE
)
19 b
= wxButton(self
, 20, "HELLO AGAIN!", wxPoint(20, 60), wxSize(90, 45))
20 EVT_BUTTON(self
, 20, self
.OnClick
)
22 b
.SetToolTipString("This is a Hello button...")
24 bmp
= images
.getTest2Bitmap()
25 mask
= wxMaskColour(bmp
, wxBLUE
)
28 wxBitmapButton(self
, 30, bmp
, wxPoint(140, 20),
29 wxSize(bmp
.GetWidth()+10, bmp
.GetHeight()+10))
30 EVT_BUTTON(self
, 30, self
.OnClick
)
33 label
= unichr(21514) + unichr(26984) + unichr(8307) + unichr(29545)
34 wxButton(self
, -1, label
+" (I have no idea what that says...)", (20, 150))
36 def OnClick(self
, event
):
37 self
.log
.WriteText("Click! (%d)\n" % event
.GetId())
40 #----------------------------------------------------------------------
42 def runTest(frame
, nb
, log
):
43 win
= TestPanel(nb
, log
)
46 #----------------------------------------------------------------------