Advertisement
Guest User

wxpython dummy code

a guest
Jan 25th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. import wx
  2.  
  3. def TalkJulianMagic():
  4. print "magic"
  5. return None
  6. def TalkJulianSage():
  7. print "sagery"
  8. return None
  9.  
  10. JB = {'Ask about magic':TalkJulianMagic,
  11. 'Ask about being a sage':TalkJulianSage,
  12. 'Leave':None}
  13.  
  14. class MyForm(wx.Frame):
  15. """All-encompassing graphics shell."""
  16. def __init__(self):
  17. wx.Frame.__init__(self, None, wx.ID_ANY, "Lobster Talk", size=(600,480))
  18. self.mainbar = wx.Panel(self, wx.ID_ANY, size=(200,300))
  19. self.talkbar = wx.Panel(self, wx.ID_ANY, pos=(200,0), size=(300,200))
  20. self.mainbar.SetBackgroundColour("green")
  21. self.talkbar.SetBackgroundColour("blue")
  22. self.leftbox = wx.BoxSizer(wx.HORIZONTAL)
  23. self.rightbox = wx.BoxSizer(wx.VERTICAL)
  24. mainbutton = wx.Button(self.talkbar, id=wx.ID_ANY,
  25. label="Julian text", name="Julian button")
  26. self.rightbox.Add(mainbutton)
  27. mainbutton.Bind(wx.EVT_BUTTON, self.SageButton)
  28.  
  29. self.Show()
  30.  
  31. def SageButton(self, event):
  32. print "Attempting to talk to Julian"
  33. magicbutton = wx.Button(self.talkbar, id=wx.ID_ANY, label="Magic")
  34. sagebutton = wx.Button(self.talkbar, id=wx.ID_ANY, label="Saging")
  35. self.rightbox.Add(magicbutton)
  36. self.rightbox.Add(sagebutton)
  37. self.SetSizer(self.rightbox)
  38. self.Fit()
  39.  
  40.  
  41. app = wx.App(False)
  42. GameWindow = MyForm()
  43. GameWindow.Show()
  44. app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement