title: Save the selected value of a combobox in wxpython
body: <p>I'm working to design a gui using wxpython, a pecie of my code is that i have a class which a fram    </p>
  
  <p>declaration and also i declared variables that i wanna chage their values based on the comboboxes </p>
  
  <p>selection. i did the folowing:</p>
  
  <pre><code>class myMenu(wx.Frame):
  def __init__(self, parent, id, title):
      wx.Frame.__init__(self, parent, id, title, size=(900, 700))
  
      self.ct = 0
      self.phaseSelection = ""
      self.opSelection = ""
      self.instSelection = ""
      self.orgSelection = ""
  
      panel = wx.Panel(self, -1)       
      panel.SetBackgroundColour('#4f3856')
  
      phasesList = ["preOperations", "inOperations", "postOperations"]
  
      self.cbPhases = wx.ComboBox(panel, 500, 'Phase', (50, 150), (160,-1), phasesList, wx.CB_DROPDOWN)
  
      self.Bind(wx.EVT_COMBOBOX, self.OnPhaseSelection, id = self.cbPhases.GetId()) 
  </code></pre>
  
  <p>and this is the code of the "OnPhaseSelection" event :</p>
  
  <pre><code>def OnPhaseSelection(self, event):
      self.phaseSelection = self.cbPhases.GetValue()
  </code></pre>
  
  <p>where i wanna save the selected value in the variable "self.phaseSelection" that i declared it with an </p>
  
  <p>empty string as initial value, then i wanna use this variable with the new saved value, but when i run </p>
  
  <p>the program, the variable contains the default value of the combobox! so please what is the problem in </p>
  
  <p>my work ?</p>