editable text cell problems



in gtk+-2.2.1, GtkCellRendererText aborts editing if its GtkEntry
gets a focus-out event. this causes various problems, the button3
popup menu doesn't work on the entry, because editing is aborted
as soon as the menu pops up and the entry thus looses focus.
leaving the active gtk window with the mouse pointer, will also
abort editing, this prevents implementation of editable cell
renderers with popup dialogs.

not aborting edits upon focus changes is also a bad idea, as
the GUI becomes mildly confusing if various editing fields in
multiple tree views can be popped up. the desirable behaviour
is actually to abort edits if the focus widget inside the cells
toplevel changes, which can be achived by changing
gtkcellrenderertext.c towards:

static void
gtk_cell_renderer_text_entry_focus_change (GtkWidget           *entry,
                                           GParamSpec          *pspec,
                                           GxkCellRendererText *self)
{
  // g_print ("entry: is_focus: %u\n", gtk_widget_is_focus (entry));
  if (!gtk_widget_is_focus (entry))
    gtk_cell_renderer_text_editing_done (GTK_CELL_EDITABLE (entry), self);
}

/* after the entry got created */
  g_object_connect (entry,
                    "signal::notify::is-focus", gtk_cell_renderer_text_entry_focus_change, cell_renderer,
                    NULL);
/* watch out to use "is-focus" and not "is_focus" as property name */

[code adapted from beast/beast-gtk/gxk/gxkcellrendererpopup.c]


on a related topic, i've described another bug recently (jrb
field this as #108035) where the editable cells allocation
isn't updated while the tree view scrolls.
simply aborting edits of editable cells when vertically
scrolling will fix that. is there disagreement about fixing
things that way, or does it just take someone to come up
with a patch and apply it?

---
ciaoTJ







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]