roxen.lists.pike.general

Subject Author Date
Re: GTK2.TreeView Lance Dillon <riffraff169[at]yahoo[dot]com> 19-09-2009
The attached test should work, and if so, that would be how you would do it.



----- Original Message ----
From: larcky <<pclar7[at]yahoo.co.uk>>
To: <pike[at]roxen.com>
Sent: Saturday, September 19, 2009 5:29:20 AM
Subject: GTK2.TreeView


Hi all

Has anyone had any success with GTK2.TreeView in Pike (7.8.316)?
I've got as far as setting the TreeView's model (thanks to 
http://www.nabble.com/Getting-GObjects-from-mixin-objects-td3589654.html
James Trike's fix ) - a ListStore with one string - but can't work out how
to use TreeView->append_column().
The module docs seem to suggest you need to set up your own CellRenderer,
whereas in gtkmm you can just use a default renderer for basic types.

Here's a snippet:

my_user_list = GTK2.ListStore( () );
my_tree_view->set_model(my_user_list);

// next 2 lines garbage - but they do give you column header
GTK2.CellRendererText crt = GTK2.CellRendererText();
my_tree_view->append_column( GTK2.TreeViewColumn("Usernames", crt, "", 0) );

// this never gets drawn
GTK2.TreeIter iter = my_user_list->append();
my_user_list->set_value(iter, 0, "someuser");

Thanks in advance for any help,
Matthew

-- 
View this message in context:
http://www.nabble.com/GTK2.TreeView-tp25519989p25519989.html
Sent from the Pike - User mailing list archive at Nabble.com.