Hi,

Am Dienstag, den 14.09.2004, 17:34 +0100 schrieb Keir Lawson:
> im trying to use a list view to show a simple two-collumed list, how
> ever im finding it extremly difficult to perform this simple task,
> throughout the documentation i cannot find a fully worked example of a
> listveiw, only a treeview, could someone point me at an example of give
> me one please.

isnt a listview just a treeview with a ListModel ?


model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
view = gtk.TreeView()
view.set_model(model)

cell0 = gtk.CellRendererText()
col0 = gtk.TreeViewColumn("stuff", cell0, text = 0) # number of the
column in the model
view.append_column(col0)

cell1 = gtk.CellRendererText()
col1 = gtk.TreeViewColumn("stuff2", cell1, text = 1) # number of the
column in the model
view.append_column(col1)

iter = model.append(None)
model.set_value(iter, 0, "stuff")
model.set_value(iter, 1, "there")

sw = gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
sw.add(view)
sw.show_all()

# add sw to your window


Or am I missing something ? :)
> 
> Keir Lawson
> 
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> 
-- 
www.keyserver.net key id A334AEA6

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to