Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Gtk2::TreeView

Reply
Thread Tools

Gtk2::TreeView

 
 
David Green
Guest
Posts: n/a
 
      10-22-2004
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,
--
David Green ()
Hands up for human rights!
http://www.amnesty.org

 
Reply With Quote
 
 
 
 
David Green
Guest
Posts: n/a
 
      10-22-2004
(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
--
David Green ()
Hands up for human rights!
http://www.amnesty.org

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57