http://www.perlmonks.org?node_id=1203414

kikuchiyo has asked for the wisdom of the Perl Monks concerning the following question:

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?