hi perl monkies, I need help in creating a simple editable treeview. Back in Gtk2, I am using Gtk2::SimpleList. Now I am having a problem because the SimpleList was removed on the Gtk3.

Now I did my research and end up with this...

my $model = Gtk3::ListStore->new('Glib::String'); my $list = Gtk3::TreeView->new(); $list->set_model($model); my $cell = Gtk3::CellRendererText->new(); $cell->set('editable'=>1); my $column = Gtk3::TreeViewColumn->new_with_attributes('name',$cell,'t +ext',$i); $list->append_column($column);

The problem here is that if I added a new row and tries to edit the contents of it by double clicking and typing a new text after I press enter, the new text is not updated. So I did googling around and found this site.

http://python-gtk-3-tutorial.readthedocs.org/en/latest/cellrenderers.h +tml#cellrenderertext

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 to properly get the iterator of the row so that I could update the liststore manually by using:

$list->set($iter,0,'edited text here');

Please help. Thanks in Advance

Mabuhay Civil Engineers! :D

In reply to Gtk3 TreeView by renegadex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.