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?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|