Re: volunteer needed: event return values
- From: Havoc Pennington <hp redhat com>
- To: srlytle_list yahoo com
- Cc: gtk-devel-list gnome org, otaylor redhat com, wolfgang contre com, timj gtk org
- Subject: Re: volunteer needed: event return values
- Date: 22 Mar 2001 23:56:44 -0500
Hi,
I went through Seth's patch and mostly just applied it, I fixed a few
formatting issues. Looks pretty good. I'll commit in the morning if no
objections, so Tim can go ahead and try out the accumulator stuff. We
need to get that change in CVS so we can see what breaks and get some
testing.
Seth, thanks for the patch!
Havoc
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.1838
diff -u -u -r1.1838 ChangeLog
--- ChangeLog 2001/03/23 00:35:18 1.1838
+++ ChangeLog 2001/03/23 04:48:17
@@ -1,3 +1,72 @@
+2001-03-22 Havoc Pennington <hp pobox com>
+
+ Applied big patch from Seth Lytle to fix event handler return
+ values, slightly modified.
+
+ * gtk/gtkcalendar.c (gtk_calendar_button_press): return TRUE if
+ handled.
+ (gtk_calendar_key_press): return TRUE for GDK_space triggers
+ select_day
+
+ * gtk/gtkclist.c (gtk_clist_button_press): return TRUE if handled
+ (gtk_clist_button_release): return TRUE if handled
+
+ * gtk/gtkcolorsel.c (mouse_release):
+ (palette_activate):
+ (palette_press):
+ (palette_new):
+ (mouse_press):
+ (get_screen_color):
+ fixed return type (void to gboolean), return TRUE,
+ added GTK_SIGNAL_FUNC cast
+
+ * gtk/gtkcombo.c (gtk_combo_popup_button_press): fixed return type
+ (void to gboolean), and return TRUE
+ (gtk_combo_button_release): changed return value to TRUE after
+ gtk_grab_add on combo->popwin
+
+ * gtk/gtkctree.c (gtk_ctree_button_press): return TRUE if triggers a
+ collapse or expand
+
+ * gtk/gtkcurve.c (gtk_curve_graph_events): return TRUE for
+ button/motion
+
+ * gtk/gtkdnd.c (gtk_drag_source_event_cb): return TRUE for button
+ press/release and motion that trigger act
+
+ * gtk/gtkentry.c (gtk_entry_button_release): return TRUE
+
+ * gtk/gtkfontsel.c (gtk_font_selection_size_key_press): return TRUE
+ for GDK_Return
+
+ * gtk/gtklist.c (gtk_list_button_press): return TRUE mostly
+ (gtk_list_button_release): return TRUE if selection
+
+ * gtk/gtklistitem.c (gtk_list_item_button_press): return TRUE on
+ press
+
+ * gtk/gtkmenushell.c (gtk_menu_shell_button_press):
+ (gtk_menu_shell_button_release): chain parent_menu_shell retval
+
+ * gtk/gtknotebook.c (gtk_notebook_button_press): return FALSE if
+ nothing triggered
+ (gtk_notebook_button_release): return TRUE if we do anything
+
+ * gtk/gtkspinbutton.c (gtk_spin_button_button_press):
+ (gtk_spin_button_button_release): return TRUE or chained retval
+
+ * gtk/gtktext.c (gtk_text_button_press):
+ (gtk_text_button_release): return TRUE
+ (gtk_text_key_press): remove redundant retval code
+
+ * gtk/gtktreeitem.c (gtk_tree_item_button_press): return TRUE if button
+ and sensitive
+ (gtk_tree_item_subtree_button_click): changed type to gint, and return
+ TRUE if sensitive
+
+ * gtk/gtktooltips.c (gtk_tooltips_event_handler): deactivate implies
+ return TRUE
+
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb redhat com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
Index: gtk/gtkcalendar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcalendar.c,v
retrieving revision 1.31
diff -u -u -r1.31 gtkcalendar.c
--- gtk/gtkcalendar.c 2001/03/16 20:12:39 1.31
+++ gtk/gtkcalendar.c 2001/03/23 04:48:17
@@ -2305,6 +2305,7 @@
GtkCalendar *calendar;
GtkCalendarPrivateData *private_data;
gint x, y;
+ void (* action_func) (GtkCalendar *);
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_CALENDAR (widget), FALSE);
@@ -2318,23 +2319,23 @@
if (event->window == private_data->main_win)
gtk_calendar_main_button (widget, event);
-
- if (event->type != GDK_BUTTON_PRESS)
- return FALSE; /* Double-clicks? Triple-clicks? No thanks! */
+
+ action_func = NULL;
if (event->window == private_data->arrow_win[ARROW_MONTH_LEFT])
- gtk_calendar_set_month_prev (calendar);
-
- if (event->window == private_data->arrow_win[ARROW_MONTH_RIGHT])
- gtk_calendar_set_month_next (calendar);
-
- if (event->window == private_data->arrow_win[ARROW_YEAR_LEFT])
- gtk_calendar_set_year_prev (calendar);
-
- if (event->window == private_data->arrow_win[ARROW_YEAR_RIGHT])
- gtk_calendar_set_year_next (calendar);
+ action_func = gtk_calendar_set_month_prev;
+ else if (event->window == private_data->arrow_win[ARROW_MONTH_RIGHT])
+ action_func = gtk_calendar_set_month_next;
+ else if (event->window == private_data->arrow_win[ARROW_YEAR_LEFT])
+ action_func = gtk_calendar_set_year_prev;
+ else if (event->window == private_data->arrow_win[ARROW_YEAR_RIGHT])
+ action_func = gtk_calendar_set_year_next;
+
+ /* only call the action on single click, not double */
+ if (event->type == GDK_BUTTON_PRESS)
+ (* action_func) (calendar);
- return FALSE;
+ return action_func != NULL;
}
static gboolean
@@ -2732,6 +2733,7 @@
if (row > -1 && col > -1)
{
+ return_val = TRUE;
gtk_calendar_freeze (calendar);
if (calendar->day_month[row][col] == MONTH_PREV)
Index: gtk/gtkcellrenderertoggle.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcellrenderertoggle.c,v
retrieving revision 1.17
diff -u -u -r1.17 gtkcellrenderertoggle.c
--- gtk/gtkcellrenderertoggle.c 2001/03/23 00:35:19 1.17
+++ gtk/gtkcellrenderertoggle.c 2001/03/23 04:48:17
@@ -317,7 +317,7 @@
guint flags)
{
GtkCellRendererToggle *celltoggle;
- gint retval = FALSE;
+ gboolean retval = FALSE;
celltoggle = GTK_CELL_RENDERER_TOGGLE (cell);
Index: gtk/gtkclist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.c,v
retrieving revision 1.190
diff -u -u -r1.190 gtkclist.c
--- gtk/gtkclist.c 2001/03/19 21:06:37 1.190
+++ gtk/gtkclist.c 2001/03/23 04:48:18
@@ -5024,7 +5024,7 @@
}
}
}
- return FALSE;
+ return TRUE;
}
/* press on resize windows */
@@ -5059,7 +5059,10 @@
if (GTK_CLIST_ADD_MODE(clist))
gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0);
draw_xor_line (clist);
+
+ return TRUE;
}
+
return FALSE;
}
@@ -5113,7 +5116,8 @@
width = new_column_width (clist, i, &x);
gtk_clist_set_column_width (clist, i, width);
- return FALSE;
+
+ return TRUE;
}
if (clist->drag_button == event->button)
@@ -5153,7 +5157,10 @@
break;
}
}
+
+ return TRUE;
}
+
return FALSE;
}
Index: gtk/gtkcolorsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcolorsel.c,v
retrieving revision 1.61
diff -u -u -r1.61 gtkcolorsel.c
--- gtk/gtkcolorsel.c 2001/01/23 15:28:18 1.61
+++ gtk/gtkcolorsel.c 2001/03/23 04:48:19
@@ -598,7 +598,7 @@
palette_paint (drawing_area, &(event->area), data);
}
-static void
+static gint
palette_press (GtkWidget *drawing_area,
GdkEventButton *event,
gpointer data)
@@ -619,6 +619,7 @@
}
gtk_widget_queue_clear (priv->last_palette);
+ return TRUE;
}
static void
@@ -793,9 +794,10 @@
{
priv = colorsel->private_data;
palette_set_color (widget, GTK_COLOR_SELECTION (data), priv->color);
+ return TRUE;
}
- return TRUE;
+ return FALSE;
}
static GtkWidget*
@@ -812,7 +814,7 @@
gtk_widget_set_events (retval, GDK_BUTTON_PRESS_MASK | GDK_EXPOSURE_MASK);
gtk_signal_connect (GTK_OBJECT (retval), "expose_event", palette_expose, colorsel);
- gtk_signal_connect (GTK_OBJECT (retval), "button_press_event", palette_press, colorsel);
+ gtk_signal_connect (GTK_OBJECT (retval), "button_press_event", GTK_SIGNAL_FUNC (palette_press), colorsel);
gtk_drag_dest_set (retval,
GTK_DEST_DEFAULT_HIGHLIGHT |
@@ -902,7 +904,7 @@
grab_color_at_mouse (button, event->x_root, event->y_root, data);
}
-static void
+static gboolean
mouse_release (GtkWidget *button,
GdkEventButton *event,
gpointer data)
@@ -912,14 +914,15 @@
priv = colorsel->private_data;
gtk_signal_disconnect_by_func (GTK_OBJECT (button), mouse_motion, data);
- gtk_signal_disconnect_by_func (GTK_OBJECT (button), mouse_release, data);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (button), GTK_SIGNAL_FUNC (mouse_release), data);
grab_color_at_mouse (button, event->x_root, event->y_root, data);
gdk_pointer_ungrab (0);
+ return TRUE;
}
/* Helper Functions */
-static void
+static gboolean
mouse_press (GtkWidget *button,
GdkEventButton *event,
gpointer data)
@@ -929,8 +932,9 @@
priv = colorsel->private_data;
gtk_signal_connect (GTK_OBJECT (button), "motion_notify_event", mouse_motion, data);
- gtk_signal_connect (GTK_OBJECT (button), "button_release_event", mouse_release, data);
- gtk_signal_disconnect_by_func (GTK_OBJECT (button), mouse_press, data);
+ gtk_signal_connect (GTK_OBJECT (button), "button_release_event", GTK_SIGNAL_FUNC (mouse_release), data);
+ gtk_signal_disconnect_by_func (GTK_OBJECT (button), GTK_SIGNAL_FUNC (mouse_press), data);
+ return TRUE;
}
/* when the button is clicked */
@@ -953,7 +957,7 @@
if (priv->moving_dropper == FALSE)
{
priv->moving_dropper = TRUE;
- gtk_signal_connect (GTK_OBJECT (button), "button_press_event", mouse_press, colorsel);
+ gtk_signal_connect (GTK_OBJECT (button), "button_press_event", GTK_SIGNAL_FUNC (mouse_press), colorsel);
gdk_pointer_grab (button->window,
FALSE,
Index: gtk/gtkcombo.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombo.c,v
retrieving revision 1.46
diff -u -u -r1.46 gtkcombo.c
--- gtk/gtkcombo.c 2001/03/18 04:50:33 1.46
+++ gtk/gtkcombo.c 2001/03/23 04:48:19
@@ -71,7 +71,7 @@
static void gtk_combo_popup_list (GtkCombo *combo);
static void gtk_combo_activate (GtkWidget *widget,
GtkCombo *combo);
-static void gtk_combo_popup_button_press (GtkWidget *button,
+static gboolean gtk_combo_popup_button_press (GtkWidget *button,
GdkEventButton *event,
GtkCombo *combo);
static void gtk_combo_popup_button_leave (GtkWidget *button,
@@ -491,7 +491,7 @@
NULL, NULL, GDK_CURRENT_TIME);
}
-static void
+static gboolean
gtk_combo_popup_button_press (GtkWidget *button,
GdkEventButton *event,
GtkCombo *combo)
@@ -510,6 +510,7 @@
GDK_BUTTON_RELEASE_MASK,
NULL, NULL, event->time);
gtk_grab_add (combo->list);
+ return TRUE;
}
static void
@@ -628,7 +629,7 @@
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK,
NULL, NULL, GDK_CURRENT_TIME);
- return FALSE;
+ return TRUE;
}
}
else
Index: gtk/gtkctree.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkctree.c,v
retrieving revision 1.82
diff -u -u -r1.82 gtkctree.c
--- gtk/gtkctree.c 2001/03/16 20:12:39 1.82
+++ gtk/gtkctree.c 2001/03/23 04:48:20
@@ -824,9 +824,10 @@
else
gtk_ctree_expand (ctree, work);
- return FALSE;
+ return TRUE;
}
}
+
return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event);
}
Index: gtk/gtkcurve.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcurve.c,v
retrieving revision 1.24
diff -u -u -r1.24 gtkcurve.c
--- gtk/gtkcurve.c 2001/03/07 14:49:19 1.24
+++ gtk/gtkcurve.c 2001/03/23 04:48:20
@@ -433,6 +433,7 @@
gfloat rx, ry, min_x;
guint distance;
gint x1, x2, y1, y2;
+ gint retval = FALSE;
w = GTK_WIDGET (c);
width = w->allocation.width - RADIUS * 2;
@@ -519,6 +520,7 @@
break;
}
gtk_curve_draw (c, width, height);
+ retval = TRUE;
break;
case GDK_BUTTON_RELEASE:
@@ -554,6 +556,7 @@
}
new_type = GDK_FLEUR;
c->grab_point = -1;
+ retval = TRUE;
break;
case GDK_MOTION_NOTIFY:
@@ -652,12 +655,14 @@
gdk_window_set_cursor (w->window, cursor);
gdk_cursor_destroy (cursor);
}
+ retval = TRUE;
break;
default:
break;
}
- return FALSE;
+
+ return retval;
}
void
Index: gtk/gtkdnd.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkdnd.c,v
retrieving revision 1.59
diff -u -u -r1.59 gtkdnd.c
--- gtk/gtkdnd.c 2001/01/19 22:39:18 1.59
+++ gtk/gtkdnd.c 2001/03/23 04:48:21
@@ -2466,6 +2466,7 @@
gpointer data)
{
GtkDragSourceSite *site;
+ gboolean retval = FALSE;
site = (GtkDragSourceSite *)data;
switch (event->type)
@@ -2476,6 +2477,7 @@
site->state |= (GDK_BUTTON1_MASK << (event->button.button - 1));
site->x = event->button.x;
site->y = event->button.y;
+ retval = TRUE;
}
break;
@@ -2483,6 +2485,7 @@
if ((GDK_BUTTON1_MASK << (event->button.button - 1)) & site->start_button_mask)
{
site->state &= ~(GDK_BUTTON1_MASK << (event->button.button - 1));
+ retval = TRUE;
}
break;
@@ -2524,7 +2527,7 @@
gtk_drag_set_icon_default (context);
}
- return TRUE;
+ retval = TRUE;
}
}
break;
@@ -2532,7 +2535,8 @@
default: /* hit for 2/3BUTTON_PRESS */
break;
}
- return FALSE;
+
+ return retval;
}
static void
Index: gtk/gtkentry.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentry.c,v
retrieving revision 1.116
diff -u -u -r1.116 gtkentry.c
--- gtk/gtkentry.c 2001/03/21 18:58:15 1.116
+++ gtk/gtkentry.c 2001/03/23 04:48:21
@@ -1348,7 +1348,7 @@
gtk_entry_update_primary_selection (entry);
- return FALSE;
+ return TRUE;
}
static gint
Index: gtk/gtkfontsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfontsel.c,v
retrieving revision 1.45
diff -u -u -r1.45 gtkfontsel.c
--- gtk/gtkfontsel.c 2000/12/20 04:49:48 1.45
+++ gtk/gtkfontsel.c 2001/03/23 04:48:21
@@ -716,6 +716,7 @@
fontsel->font_desc->size = new_size;
gtk_font_selection_load_font (fontsel);
}
+ return TRUE;
}
return FALSE;
Index: gtk/gtklist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklist.c,v
retrieving revision 1.57
diff -u -u -r1.57 gtklist.c
--- gtk/gtklist.c 2001/03/19 21:06:37 1.57
+++ gtk/gtklist.c 2001/03/23 04:48:22
@@ -776,6 +776,8 @@
default:
break;
}
+
+ return TRUE;
}
return FALSE;
@@ -828,6 +830,8 @@
default:
break;
}
+
+ return TRUE;
}
return FALSE;
Index: gtk/gtklistitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklistitem.c,v
retrieving revision 1.26
diff -u -u -r1.26 gtklistitem.c
--- gtk/gtklistitem.c 2001/03/09 13:28:25 1.26
+++ gtk/gtklistitem.c 2001/03/23 04:48:22
@@ -451,8 +451,12 @@
g_return_val_if_fail (event != NULL, FALSE);
if (event->type == GDK_BUTTON_PRESS)
- if (!GTK_WIDGET_HAS_FOCUS (widget))
- gtk_widget_grab_focus (widget);
+ {
+ if (!GTK_WIDGET_HAS_FOCUS (widget))
+ gtk_widget_grab_focus (widget);
+
+ return TRUE;
+ }
return FALSE;
}
Index: gtk/gtkmenushell.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenushell.c,v
retrieving revision 1.40
diff -u -u -r1.40 gtkmenushell.c
--- gtk/gtkmenushell.c 2001/03/21 18:58:17 1.40
+++ gtk/gtkmenushell.c 2001/03/23 04:48:22
@@ -430,7 +430,7 @@
if (menu_shell->parent_menu_shell)
{
- gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event);
+ return gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event);
}
else if (!menu_shell->active || !menu_shell->button)
{
@@ -484,8 +484,7 @@
{
menu_shell->button = 0;
if (menu_shell->parent_menu_shell)
- gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event);
- return TRUE;
+ return gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event);
}
menu_shell->button = 0;
Index: gtk/gtknotebook.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtknotebook.c,v
retrieving revision 1.84
diff -u -u -r1.84 gtknotebook.c
--- gtk/gtknotebook.c 2001/03/22 13:43:59 1.84
+++ gtk/gtknotebook.c 2001/03/23 04:48:23
@@ -1103,9 +1103,10 @@
}
if (!children && !GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
+ return TRUE;
}
- return TRUE;
+ return FALSE;
}
static gint
@@ -1137,9 +1138,11 @@
notebook->click_child = 0;
notebook->button = 0;
gtk_notebook_redraw_arrows (notebook);
-
+
+ return TRUE;
}
- return FALSE;
+ else
+ return FALSE;
}
static gint
Index: gtk/gtkspinbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkspinbutton.c,v
retrieving revision 1.54
diff -u -u -r1.54 gtkspinbutton.c
--- gtk/gtkspinbutton.c 2001/03/19 21:06:37 1.54
+++ gtk/gtkspinbutton.c 2001/03/23 04:48:23
@@ -892,9 +892,10 @@
}
gtk_spin_button_draw_arrow (spin, GTK_ARROW_DOWN);
}
+ return TRUE;
}
else
- GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event);
+ return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event);
}
return FALSE;
}
@@ -954,9 +955,10 @@
spin->click_child = 2;
spin->button = 0;
gtk_spin_button_draw_arrow (spin, click_child);
+ return TRUE;
}
else
- GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event);
+ return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event);
return FALSE;
}
Index: gtk/gtktext.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktext.c,v
retrieving revision 1.97
diff -u -u -r1.97 gtktext.c
--- gtk/gtktext.c 2001/03/19 21:06:37 1.97
+++ gtk/gtktext.c 2001/03/23 04:48:24
@@ -1729,7 +1729,7 @@
}
}
- return FALSE;
+ return TRUE;
}
static gint
@@ -1790,7 +1790,7 @@
find_cursor (text, TRUE);
draw_cursor (text, FALSE);
- return FALSE;
+ return TRUE;
}
static gint
@@ -1907,8 +1907,6 @@
g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
- return_val = FALSE;
-
text = GTK_TEXT (widget);
old_editable = GTK_OLD_EDITABLE (widget);
@@ -2094,8 +2092,6 @@
return_val = TRUE;
}
- else
- return_val = FALSE;
}
if (return_val && (old_editable->current_pos != initial_pos))
Index: gtk/gtktexttag.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktexttag.c,v
retrieving revision 1.33
diff -u -u -r1.33 gtktexttag.c
--- gtk/gtktexttag.c 2001/03/16 19:32:20 1.33
+++ gtk/gtktexttag.c 2001/03/23 04:48:24
@@ -1622,7 +1622,7 @@
GdkEvent *event,
const GtkTextIter *iter)
{
- gint retval = FALSE;
+ gboolean retval = FALSE;
g_return_val_if_fail (GTK_IS_TEXT_TAG (tag), FALSE);
g_return_val_if_fail (GTK_IS_OBJECT (event_object), FALSE);
Index: gtk/gtktextview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextview.c,v
retrieving revision 1.74
diff -u -u -r1.74 gtktextview.c
--- gtk/gtktextview.c 2001/03/19 21:06:37 1.74
+++ gtk/gtktextview.c 2001/03/23 04:48:25
@@ -2848,7 +2848,7 @@
{
GSList *tags;
GSList *tmp;
- gint retval = FALSE;
+ gboolean retval = FALSE;
GtkTextView *text_view;
text_view = GTK_TEXT_VIEW (widget);
@@ -2926,7 +2926,7 @@
static gint
gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
{
- gint retval = FALSE;
+ gboolean retval = FALSE;
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
if (text_view->layout == NULL ||
Index: gtk/gtktooltips.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktooltips.c,v
retrieving revision 1.32
diff -u -u -r1.32 gtktooltips.c
--- gtk/gtktooltips.c 2001/03/15 19:02:22 1.32
+++ gtk/gtktooltips.c 2001/03/23 04:48:25
@@ -486,8 +486,10 @@
tooltips->use_sticky_delay = use_sticky_delay;
}
break;
+
default:
gtk_tooltips_set_active_widget (tooltips, NULL);
+ return TRUE;
break;
}
Index: gtk/gtktreeitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeitem.c,v
retrieving revision 1.47
diff -u -u -r1.47 gtktreeitem.c
--- gtk/gtktreeitem.c 2001/03/09 13:28:26 1.47
+++ gtk/gtktreeitem.c 2001/03/23 04:48:26
@@ -84,7 +84,7 @@
static void gtk_real_tree_item_expand (GtkTreeItem *item);
static void gtk_real_tree_item_collapse (GtkTreeItem *item);
static void gtk_tree_item_destroy (GtkObject *object);
-static void gtk_tree_item_subtree_button_click (GtkWidget *widget);
+static gint gtk_tree_item_subtree_button_click (GtkWidget *widget);
static void gtk_tree_item_subtree_button_changed_state (GtkWidget *widget);
static void gtk_tree_item_map(GtkWidget*);
@@ -172,7 +172,7 @@
}
/* callback for event box mouse event */
-static void
+static gint
gtk_tree_item_subtree_button_click (GtkWidget *widget)
{
GtkTreeItem* item;
@@ -182,12 +182,14 @@
item = (GtkTreeItem*) gtk_object_get_user_data (GTK_OBJECT (widget));
if (!GTK_WIDGET_IS_SENSITIVE (item))
- return;
+ return FALSE;
if (item->expanded)
gtk_tree_item_collapse (item);
else
gtk_tree_item_expand (item);
+
+ return TRUE;
}
/* callback for event box state changed */
@@ -711,7 +713,7 @@
&& !GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
- return FALSE;
+ return (event->type == GDK_BUTTON_PRESS && GTK_WIDGET_IS_SENSITIVE(widget));
}
static gint
Index: gtk/gtktreemodelsort.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreemodelsort.c,v
retrieving revision 1.18
diff -u -u -r1.18 gtktreemodelsort.c
--- gtk/gtktreemodelsort.c 2001/03/09 00:19:11 1.18
+++ gtk/gtktreemodelsort.c 2001/03/23 04:48:26
@@ -1080,7 +1080,7 @@
GValue value_a = {0, };
GValue value_b = {0, };
SortData *sort_data = user_data;
- gint retval;
+ gboolean retval;
gtk_tree_model_get_value (sort_data->model, (GtkTreeIter *) a, sort_data->sort_col, &value_a);
gtk_tree_model_get_value (sort_data->model, (GtkTreeIter *) b, sort_data->sort_col, &value_b);
Index: gtk/gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.61
diff -u -u -r1.61 gtktreeview.c
--- gtk/gtktreeview.c 2001/03/23 00:35:19 1.61
+++ gtk/gtktreeview.c 2001/03/23 04:48:27
@@ -3178,7 +3178,7 @@
GtkTreeViewColumn *column;
GList *list;
gint i;
- gint retval = FALSE;
+ gboolean retval = FALSE;
gint tmpheight;
if (height)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]