Gtk2::TreeView

D

David Green

Hey,
I've got a problem getting gtk2's tree-view widget to work, not helped by
the fact the widget is undocumented in the GTK2 api. I can't seem to
decipher the perl bindings for it either.

What I'd like to do is create a tree-structure, ie

Fruit
|
|------Apples
|----Granny Smith
|----Old English
|------Pears
|------Tomatoes

I'm aware I need to use a tree store,
 
D

David Green

(appologies for multipart)
I'm aware I need to use a tree store,

# Define a tree store to expect two strings
my $tree_store = new Gtk2::TreeStore ("Glib::String", "Glib::String");
# Create the first empty row
my $iter = $tree_store->append (undef);
# Add the row
$tree_store->set_value ($iter, "0", "A string", "1", "Some other string");
# ... <snip> more rows added via above method
# Bind the model to the treeView
my $tree_view = new Gtk2::TreeView($tree_store);

I then add the treeview to a container (HBox) and a get a white box with
no content - I've tried various possibilities for set_value but still
accept I could be wholly wrong here?

What am I doing wrong or can anyone suggest any further documentation?

With thanks,
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top