title: Why Gtk.TreeSelection.select_iter() is not working?
body: <p>I want to implement a feature which will allow user to navigate in Gtk.TreeView widget by arrow keys, unfortunately select_iter() method is not doing what I was expecting from it, i. e. it fails to select parent node of selected node :P</p>
  
  <p>And now I need explanation why it's not working or hint on some kind of workaround of this issue.</p>
  
  <p>Below is ready to run test program which demonstrates this problem. Problematic line of code is tagged with #FIXME.</p>
  
  <pre><code>from gi.repository import Gtk
  from gi.repository import Gdk
  
  
  class WizardManager(Gtk.Dialog):
      '''Dialog window which makes possible to choose type of resource to create by editor.'''
      def __init__(self, parent):
          super().__init__('Wizard manager', parent,  Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT)
          self.set_default_response(Gtk.ResponseType.OK)
          self.set_decorated(False)
          self.set_size_request(640, 480)
          vbox = self.get_content_area()
          self.__tree_store = Gtk.TreeStore(str)
          self.__tree_view = Gtk.TreeView(self.__tree_store)
          self.__tree_view.get_selection().set_mode(Gtk.SelectionMode.SINGLE)
          self.__tree_view.connect('key-press-event', self.__on_tree_view_key_press)
          self.__tree_view.set_headers_visible(False)
          text_renderer = Gtk.CellRendererText()
          text_column1 = Gtk.TreeViewColumn(None, text_renderer)
          text_column1.add_attribute(text_renderer, 'text', 0)
          self.__tree_view.append_column(text_column1)
          scrolled_window = Gtk.ScrolledWindow()
          scrolled_window.add(self.__tree_view)
          vbox.pack_start(scrolled_window, True, True, 0)
          self.__populate_tree_store()
          self.show_all()
  
      def __on_tree_view_key_press(self, tree_view, event):
          # TODO Implement tree navigation with arrow keys
          tree_selection = tree_view.get_selection()
          selected_iter = tree_selection.get_selected()[1]
          if selected_iter:
              selected_tree_path = self.__tree_store.get_path(selected_iter)
              # Right arrow and Return should expand selected node.
              if event.keyval == Gdk.KEY_Right or event.keyval == Gdk.KEY_Return:
                  tree_view.expand_row(selected_tree_path, False)
              # Left arrow should collapse node or select it parent.
              elif event.keyval == Gdk.KEY_Left:
                  if not tree_view.collapse_row(selected_tree_path):
                      # Unable to collapse node it must be empty. select it's parent.
                      parent_iter = selected_iter.copy()
                      if self.__tree_store.iter_parent(parent_iter):
                          # FIXME Why select_iter() executes without error and is not able to select parent node?
                          # same goes for select_path() :P
                          tree_selection.select_iter(parent_iter)
  
      def __populate_tree_store(self):
          # Ordinary resources
          self.__tree_store.append(None, ('File',))
          self.__tree_store.append(None, ('Directory',))
  
          # Python files
          python_dir = self.__tree_store.append(None, ('Python',))
          self.__tree_store.append(python_dir, ('Python module',))
          self.__tree_store.append(python_dir, ('Python package',))
  
          # Django files
          django_dir = self.__tree_store.append(python_dir, ('Django',))
          self.__tree_store.append(django_dir, ('Django project',))
          self.__tree_store.append(django_dir, ('Django app',))
  
  if __name__ == '__main__':
      app = Gtk.Window(Gtk.WindowType.TOPLEVEL)
      app.connect('destroy', lambda a: Gtk.main_quit())
      dlg = WizardManager(app)
      dlg.run()
      dlg.destroy()
      Gtk.main()
  </code></pre>