]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-03/double_event_one.py
5 class DoubleEventFrame(wx
.Frame
):
7 def __init__(self
, parent
, id):
8 wx
.Frame
.__init
__(self
, parent
, id, 'Frame With Button',
10 self
.panel
= wx
.Panel(self
, -1)
11 self
.button
= wx
.Button(self
.panel
, -1, "Click Me", pos
=(100, 15))
12 self
.Bind(wx
.EVT_BUTTON
, self
.OnButtonClick
, self
.button
)
13 self
.button
.Bind(wx
.EVT_LEFT_DOWN
, self
.OnMouseDown
)
15 def OnButtonClick(self
, event
):
16 self
.panel
.SetBackgroundColour('Green')
19 def OnMouseDown(self
, event
):
20 self
.button
.SetLabel("Again!")
23 if __name__
== '__main__':
24 app
= wx
.PySimpleApp()
25 frame
= DoubleEventFrame(parent
=None, id=-1)