Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Gtk3 TreeView

by zentara (Archbishop)
on Jul 02, 2012 at 09:01 UTC ( [id://979396]=note: print w/replies, xml ) Need Help??


in reply to Gtk3 TreeView

It says that I need to update the liststore manually using the edited signal. Problem is that I can't seem to find a way

This is from Gtk2 code, but should work on Gtk3.

..... .... #this will create a treeview, specify $tree_store as its model my $tree_view = Gtk2::TreeView->new($tree_store); #create a Gtk2::TreeViewColumn to add to $tree_view my $tree_column = Gtk2::TreeViewColumn->new(); $tree_column->set_title ("Select Something"); #for editing my $renderer = Gtk2::CellRendererText->new; $renderer->set_property('editable' => TRUE); $renderer->signal_connect (edited => \&cell_edited, $tree_store); ..... ..... sub cell_edited { my ($cell, $path_string, $new_text, $model) = @_; my $path = Gtk2::TreePath->new_from_string ($path_string); my $column = $cell->get_data ("column"); my $iter = $model->get_iter ($path); $model->set_value ($iter, $column, $new_text); }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://979396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-23 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found