1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| class MyFrame(wx.Frame):
def __init__(self, parent, ID, title, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE):
wx.Frame.__init__(self, parent, ID, title, pos, size, style)
panel = wx.Panel(self, -1)
button = wx.Button(panel, 1003, "quelle est la variable")
button.SetPosition((15, 15))
self.Bind(wx.EVT_BUTTON, self.OnVar, button)
def OnVar(self, event):
print "coucou"
class MonAppli(wx.App):
def OnInit(self):
frame = MyFrame()
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MonAppli(True)
app.MainLoop() |
Partager