title: How can i Refresh the Listview with python gtk?
body: <p>i am new to python, I put a button to refresh the listview and get the information from a .txt file, but it doesn't works :(</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import gtk
  
  
  actresses = [i.strip().replace("'", "").split() for i in open("lista.txt").readlines()]
  
  
  class PyApp(gtk.Window): 
      def __init__(self):
          super(PyApp, self).__init__()
  
          self.set_size_request(350, 250)
          self.set_position(gtk.WIN_POS_CENTER)
  
          self.connect("destroy", gtk.main_quit)
          self.set_title("ListView")
  
          self.Boton = gtk.Button("click")
          self.Boton.connect("clicked",self.create_list)
  
          self.Boton.show()
  
          vbox = gtk.VBox(False, 8)
  
          sw = gtk.ScrolledWindow()
          sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
          sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
  
          vbox.pack_start(sw, True, True, 0)
          vbox.pack_start(self.Boton, True, True, 0)
  
          store = self.create_model()
  
          treeView = gtk.TreeView(store)
          treeView.connect("row-activated", self.on_activated)
          treeView.set_rules_hint(True)
          sw.add(treeView)
  
          self.create_columns(treeView)
          self.statusbar = gtk.Statusbar()
  
          vbox.pack_start(self.statusbar, False, False, 0)
  
          self.add(vbox)
          self.show_all()
  
  
      def create_model(self):
          store = gtk.ListStore(str, str, str)
  
          for act in actresses:
              store.append([act[0], act[1], act[2]])
  
          return store
  
  
      def create_columns(self, treeView):
  
          rendererText = gtk.CellRendererText()
          column = gtk.TreeViewColumn("Nombre", rendererText, text=0)
          column.set_sort_column_id(0)    
          treeView.append_column(column)
  
          rendererText = gtk.CellRendererText()
          column = gtk.TreeViewColumn("apellido", rendererText, text=1)
          column.set_sort_column_id(1)
          treeView.append_column(column)
  
          rendererText = gtk.CellRendererText()
          column = gtk.TreeViewColumn("Tamaño", rendererText, text=2)
          column.set_sort_column_id(2)
          treeView.append_column(column)
  
  
      def on_activated(self, widget, row, col):
  
          model = widget.get_model()
          text = model[row][0] + ", " + model[row][1] + ", " + model[row][2]
          self.statusbar.push(0, text)
      if model[row][0] == "lol":
         print "Funciona"
  
      def create_list(self, widget):
          # create a TreeView object which will work with our model (ListStore)
          self.listview = self.create_model()
          self.treeView = gtk.TreeView(self.listview)
          self.treeView.set_rules_hint(True)
  
  PyApp()
  gtk.main()
  </code></pre>