Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx
- def TalkJulianMagic():
- print "magic"
- return None
- def TalkJulianSage():
- print "sagery"
- return None
- JB = {'Ask about magic':TalkJulianMagic,
- 'Ask about being a sage':TalkJulianSage,
- 'Leave':None}
- class MyForm(wx.Frame):
- """All-encompassing graphics shell."""
- def __init__(self):
- wx.Frame.__init__(self, None, wx.ID_ANY, "Lobster Talk", size=(600,480))
- self.mainbar = wx.Panel(self, wx.ID_ANY, size=(200,300))
- self.talkbar = wx.Panel(self, wx.ID_ANY, pos=(200,0), size=(300,200))
- self.mainbar.SetBackgroundColour("green")
- self.talkbar.SetBackgroundColour("blue")
- self.leftbox = wx.BoxSizer(wx.HORIZONTAL)
- self.rightbox = wx.BoxSizer(wx.VERTICAL)
- mainbutton = wx.Button(self.talkbar, id=wx.ID_ANY,
- label="Julian text", name="Julian button")
- self.rightbox.Add(mainbutton)
- mainbutton.Bind(wx.EVT_BUTTON, self.SageButton)
- self.Show()
- def SageButton(self, event):
- print "Attempting to talk to Julian"
- magicbutton = wx.Button(self.talkbar, id=wx.ID_ANY, label="Magic")
- sagebutton = wx.Button(self.talkbar, id=wx.ID_ANY, label="Saging")
- self.rightbox.Add(magicbutton)
- self.rightbox.Add(sagebutton)
- self.SetSizer(self.rightbox)
- self.Fit()
- app = wx.App(False)
- GameWindow = MyForm()
- GameWindow.Show()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement