title: How to link multiple wx.Dialogs in wxPython
body: <p>I want to make a game in wxPython (no other modules) and I want to make it so that you can enter some values in popup screens before the game starts, and then the game will be drawn on a canvas which in turn is drawn on a panel, which is bound to the main game.</p>
  
  <p>I made the gamescreen with all fancy stuff (works solo)
  I made the input screens
  But I cannot link them.</p>
  
  <p>How do I start the game so it will open a dialog box, then on the closure of it open another one, and then open the game ?</p>
  
  <p>I tried the following, but it will not open my canvas:</p>
  
  <pre><code># makes a game by showing 2 dialogs
  # after dialogs have been answered, starts the game by drawing the canvas.
  
  # imports  
  import wx
  import Speelveld3
  
  # globals
  SCRWIDTH = 950
  SCRHEIGHT = 700
  
  # dialogbox class
  class MyDialog1(wx.Dialog):
      def __init__(self, parent):
          wx.Dialog.__init__(self, parent)
  
          self.username = wx.TextCtrl(self)
          self.okButton = wx.Button(self, wx.ID_OK, "OK")
  
  class MyDialog2(wx.Dialog):
      def __init__(self, parent):
          wx.Dialog.__init__(self, parent)
  
          self.canvasWidth = wx.TextCtrl(self)
          self.okButton = wx.Button(self, wx.ID_OK, "OK")
  
  # main class
  class Game(wx.Frame):
      def __init__(self):
          wx.Frame.__init__(self, None, -1, title='My game', size=(SCRWIDTH, SCRHEIGHT))
          self.username = ""
          self.canvasWidth = 10
          # hide the frame for now
          self.Hide()
  
      def OnInit(self):
          #Make your dialogs
          dlg1 = MyDialog1(self)
          #if the user pressed "OK" (i.e. NOT "Cancel" or any other button you might add)
          if dlg1.ShowModal() == wx.ID_OK:
              #get the username from the dialog
              self.username = dlg1.username.GetValue()
          #clean up the dialog (AFTER you get the username)
          dlg1.Destroy()
  
          dlg2 = MyDialog2(self)
          #if the user pressed "OK" (i.e. NOT "Cancel" or any other button you might add)
          if dlg2.ShowModal() == wx.ID_OK:
              #get the username from the dialog
              self.canvasWidth = dlg2.canvasWidth.GetValue()
          #clean up the dialog (AFTER you get the username)
          dlg2.Destroy()
  
  
  
          # Now that you have your settings, Make the gameboard
          # THIS PART IS STILL BROKEN!
          # I can paste the whole board class (structure of it is taken from the tetris tutorial)
          # but that seems a bit much tbh...
          self.gameBoard = Board.Board(self)
          self.gameBoard = SetFocus()
          self.gameBoard.start()
  
          self.Centre()
          self.Show(True) #show the frame
  
  
  
  
  
  if __name__ == '__main__':
  # how can I start the game here?
      app = wx.App()
      frame = Game()
      board = Speelveld3.Speelveld(frame)
      board.start()
      frame.Show()
      app.MainLoop()
  </code></pre>