title: wxpython: How to make a tab active once it is opened via an event handler?
body: <p>I am making this GUI tool using wxpython. For that I have a menu and a few menu-items. Now, when I click on a particular menu-item, I have written the code for the event that handles the menu-item click. It creates a new sheet(panel, and a listctrl inside it) and adds the page to the already-created <code>wx.Notebook</code> object. Now, when I click on one menu-item after another, I want the tabs opened successively to be active (that is, the one that is shown to the user at that moment), whereas what actually happens is that the first tab opened is the one that stays active. May I please know how this can be achieved?</p>
  
  <p>Here is the code for the event-handlers:</p>
  
  <pre><code># code for one menu-item click - 
  def displayApps(self, event):
      self.appsTab = TabPanel(self.notebook)
      self.notebook.AddPage(self.appsTab, "List of applications running on each node") 
      self.apps = wx.ListBox(self.appsTab, 12, (10, 40),(450,150), self.appslist, wx.LB_SINGLE) #creating the listbox inside the panel in the tab
  
  # code for another menu-item click - 
  def displayFreeNodes(self, event):
      #displays the list of free nodes in panel1
      self.freenodesTab = TabPanel(self.notebook)
      self.notebook.AddPage(self.freenodesTab, "List of free nodes in the cluster")
      self.freenodes = wx.ListBox(self.freenodesTab, 13, (10,40),(200,130), self.freenodeslist, wx.LB_SINGLE)
      #self.boxsizer1.Add(self.freenodes, 1)
  </code></pre>