Advertisement
Guest User

Untitled

a guest
May 5th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import wx
  2.  
  3. class Form1(wx.Panel):
  4. def __init__(self, parent, id):
  5. wx.Panel.__init__(self, parent, id)
  6.  
  7. self.button =wx.Button(self, 10, "MULTIPLICA", wx.Point(20,10))
  8. wx.EVT_BUTTON(self, 10, self.OnClick)
  9.  
  10. self.button =wx.Button(self, 20, "SOMA", wx.Point(20,100))
  11. wx.EVT_BUTTON(self, 20, self.OnClick)
  12.  
  13. def OnClick(self, event):
  14.  
  15. if event.GetId()==10: #Run import
  16. a = 10
  17. b = 20
  18. print a*b
  19.  
  20. if event.GetId()==20: #Run import
  21. a = 10
  22. b = 20
  23. print a+b
  24.  
  25.  
  26.  
  27. if __name__ == "__main__":
  28.  
  29. app = wx.PySimpleApp()
  30. frame = wx.Frame(None, -1, "test GUI", pos=(0,0), size=(200,200))
  31. Form1(frame,-1)
  32. frame.Show(1)
  33.  
  34. app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement