treeview looks like a list not as a tree
- From: anguila <anguila gmail com>
- To: "gtk-perl-list gnome org List" <gtk-perl-list gnome org>
- Subject: treeview looks like a list not as a tree
- Date: Thu, 23 Jul 2009 21:46:28 +0200
Hi
I dont understand why in my treeview looks like a list and not as a tree, i have added a parent in each set and the child doesnt added:
I have a sub. to create the treeview:
sub crear_llista_links{
my $tree_view= $programa->get_widget('llista_links');
$tree_store = Gtk2::TreeStore->new(qw(Glib::String Gtk2::Gdk::Pixbuf Glib::Double));
$tree_view->set_model($tree_store);
my $tree_column = Gtk2::TreeViewColumn->new();
my $link= Gtk2::CellRendererText->new;
my $pixbuf= Gtk2::CellRendererPixbuf->new();
my $pbar = Gtk2::CellRendererProgress->new();
$tree_column->pack_start($link,0);
$tree_column->pack_start($pixbuf,0);
$tree_column->set_attributes($link,'text'=>0);
$tree_column->set_attributes($pixbuf,'pixbuf'=>1);
my $tree_column2 = Gtk2::TreeViewColumn->new();
$tree_column2->pack_start($pbar,0);
$tree_column2->set_attributes($pbar, 'value' => 2);
$tree_view->append_column($tree_column);
$tree_view->append_column($tree_column2);
return $tree_store;
}
and there in a piece of code i use that:
...
my $obj= $tree_store->append(undef);
$tree_store->set($obj,0=>$def_link, 1=>$logo_server);
my $child= $tree_store->append($obj);
$tree_store->set($fill,0=>"CHILD",1=>$logo_server);
....
$obj is the parent and after i make a child of this parent and set it the text value to CHILD, but this set doesnt added at the list, and i dont really understand why..
Any idea?
Thanks.
David
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]