Posted By

arcturus on 11/02/07


Tagged

python gtk pygtk


Versions (?)

Simple list box


 / Published in: Python
 

  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  

You need to login to post a comment.