Say I have a Gtk2 application with a list that contains text columns, implemented by CellRendererTexts. There is a complete working example in Lists in Gtk2 example.
This example (and all others on the web) connect the 'edited' signal to a function that writes back the value into the model. There is one problem with this approach: the 'edited' signal does not always fire. This can be seen in the program in the linked node: when you start editing a text cell, then immediately click on one of the buttons, your modifications will be discarded - which is very annoying, especially, as in my application, the list is part of a dialog box and the button is the OK button of that dialog. I and the end user both would expect that clicking OK would acknowledge and save any modifications, and having to remember to click outside the cell but inside the list before clicking ok is extremely frustrating.
I see that Gtk2::CellRenderer can also emit an editing-changed signal, which does seem to be fired even edited is not - but the editing-changed signal does not get the row and the edited text as parameters, and I don't see where else would I get these.
So: how to do it properly?
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||