Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx
- class Form1(wx.Panel):
- def __init__(self, parent, id):
- wx.Panel.__init__(self, parent, id)
- self.button =wx.Button(self, 10, "MULTIPLICA", wx.Point(20,10))
- wx.EVT_BUTTON(self, 10, self.OnClick)
- self.button =wx.Button(self, 20, "SOMA", wx.Point(20,100))
- wx.EVT_BUTTON(self, 20, self.OnClick)
- def OnClick(self, event):
- if event.GetId()==10: #Run import
- a = 10
- b = 20
- print a*b
- if event.GetId()==20: #Run import
- a = 10
- b = 20
- print a+b
- if __name__ == "__main__":
- app = wx.PySimpleApp()
- frame = wx.Frame(None, -1, "test GUI", pos=(0,0), size=(200,200))
- Form1(frame,-1)
- frame.Show(1)
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement