Simple list box


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. treeview = self.tree.get_widget("myTreeView")
  2. liststore = gtk.ListStore(str) # create a list store with just one column (which holds a string)
  3. treeview.set_model(liststore)
  4.  
  5. tc = gtk.TreeViewColumn("TheTitle")
  6. treeview.append_column(tc)
  7.  
  8. cr = gtk.CellRendererText()
  9. tc.pack_start(cr, True)
  10. tc.add_attribute(cr, "text", 0)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.