title: How can I update a wxPython ListBox based on some search string?
body: <p><strong>The Problem:</strong></p>
  
  <p>How can I update a <code>wx.ListBox</code> based on some search string ? 
  In practical terms:
  - I have 2 objs: <code>wx.TextCtrl</code> + <code>wx.ListBox</code>
  - action: once a text is written down in <code>wx.TextCtrl</code>, the list <code>wx.ListBox</code> should be updated with matches  </p>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>def updateList(event):
      # Get all values from wx.ListBox obj 
      searchTerm = str([textareaExpectedResults.GetString(i) for i in range(textareaExpectedResults.GetCount())])
      print searchTerm
      # Get match
      matchValues =  sorted(['entry', 'test'])   
      textareaExpectedResults.Clear()
      i = 0
      for item in matchValues:
          if searchTerm.lower() in item.lower():
               i += 1
               textareaExpectedResults.Append(item)
          else:
               print "not found"
               pass
  
  # Bind the function to search box
  searchExpectedResults.Bind(wx.EVT_CHAR, updateList)
  </code></pre>
  
  <p><strong>Current Output:</strong></p>
  
  <p>not found when I start writting.</p>
  
  <p><strong>Desired Output:</strong></p>
  
  <p>fetch matches, when I start writting. (If I type: "en" then the app should fetch the option "entry". Naturally that entry is present in listbox)
  Please share a hint on this.</p>
  
  <p>EDIT 1: </p>
  
  <pre><code># Basic app 
  
  import wx
  app = wx.App(redirect=False)
  top = wx.Frame(None)
  top.SetSize(320,280)
  sizer = wx.GridBagSizer()
  
  def on_char(event):
      getValue = searchExpectedResults.GetValue() # get the entered string in TextCtrl with GetValue method
      print getValue
      search_items = sorted(['test', 'entry']) # Create a list of all searchable items in a list
      for item in search_items:            
              if getValue in item:
                  print item 
                  textareaExpectedResults.Clear()
                  textareaExpectedResults.Append(item) # Clear the ListBox and append the matching strings in search_items to the ListBox
  
  searchExpectedResults = wx.TextCtrl(top, -1, "", size=(175, -1))
  sizer.Add(searchExpectedResults,(2,8),(2,14),wx.EXPAND)
  searchExpectedResults.Bind(wx.EVT_CHAR, on_char) # Bind an EVT_CHAR event to your TextCtrl
  search_items = sorted(['test', 'entry'])
  textareaExpectedResults = wx.ListBox(top, choices=search_items,  size=(270,250))
  sizer.Add(textareaExpectedResults,(6,8),(2,14),wx.EXPAND)
  top.Sizer = sizer
  top.Sizer.Fit(top)
  top.Show()
  app.MainLoop()
  </code></pre>