GNOME Bugzilla – Bug 130969
editing-canceled signal for GtkCellRendererText
Last modified: 2011-02-04 16:12:26 UTC
Right now GtkCellRendererText has an "edited" signal that gets emitted when editing is done by pressing Enter. However, if editing is canceled with Esc, there is no way to get notified as the GtkCellEditable is not visible from the public API. The file chooser needs this functionality. The attached patch implements this signal.
Created attachment 23146 [details] [review] Patch that adds an "editing-canceled" signal to GtkCellRendererText
Oh yes please! I have been asking for exactly this for months on #gtk+ :) I just never came around to do a patch... In GIMP, we have a similar problem: In our generic tree views of things (brushes, patterns etc.), there is a "name" column which does not really show the object's name, but a description like "Round Brush (12) (12 x 12)". When the user clicks the name to edit it, it is replaced by the object's real name for editing. Currently we do very evil hacks to figure when editing has been canceled (we somehow need to restore the text with the "(12 x 12)" extension appended). So please please please ;) let this patch go in before 2.4.
Federico, why did you put this signal on GtkCellRendererText as opposed to GtkCellRenderer?
Because the "edited" signal is in GtkCellRendererText. GtkCellRenderer has no signals.
Attaching new patch with the signal on GtkCellRenderer, following JRB's comments.
Created attachment 23452 [details] [review] Updated patch with a GtkCellRenderer::editing-canceled signal
Looks good. Please commit.
Thanks! Committed.