diff options
author | Kristian Rietveld <kris@gtk.org> | 2009-08-27 16:22:11 +0200 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2009-08-27 18:12:54 +0200 |
commit | de1c79c72100ea8d630ec15034dca37d9857213b (patch) | |
tree | d8ea8a5b8e1c293c2fc3f3efc38b1efab5fe2065 /gtk/gtkcellrendererspin.c | |
parent | 05b246accc06695c84d940769c36e1207e51a582 (diff) | |
download | gtk+-de1c79c72100ea8d630ec15034dca37d9857213b.tar.gz |
Bug 592883 - Spin cell rendererer problem with double click
Block 2BUTTON and 3BUTTON press events using a button press event
handler in GtkCellRendererSpin, so that they won't be eaten and
processed by tree view.
Diffstat (limited to 'gtk/gtkcellrendererspin.c')
-rw-r--r-- | gtk/gtkcellrendererspin.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkcellrendererspin.c b/gtk/gtkcellrendererspin.c index 92b66926ad..ebd08e275c 100644 --- a/gtk/gtkcellrendererspin.c +++ b/gtk/gtkcellrendererspin.c @@ -271,6 +271,21 @@ gtk_cell_renderer_spin_key_press_event (GtkWidget *widget, return FALSE; } +static gboolean +gtk_cell_renderer_spin_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + /* Block 2BUTTON and 3BUTTON here, so that they won't be eaten + * by tree view. + */ + if (event->type == GDK_2BUTTON_PRESS + || event->type == GDK_3BUTTON_PRESS) + return TRUE; + + return FALSE; +} + static GtkCellEditable * gtk_cell_renderer_spin_start_editing (GtkCellRenderer *cell, GdkEvent *event, @@ -296,6 +311,10 @@ gtk_cell_renderer_spin_start_editing (GtkCellRenderer *cell, spin = gtk_spin_button_new (priv->adjustment, priv->climb_rate, priv->digits); + g_signal_connect (spin, "button-press-event", + G_CALLBACK (gtk_cell_renderer_spin_button_press_event), + NULL); + if (cell_text->text) gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), g_ascii_strtod (cell_text->text, NULL)); |