summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2001-04-23 23:03:53 +0000
committerJonathan Blandford <jrb@src.gnome.org>2001-04-23 23:03:53 +0000
commit60051ff6700171c384257134952110a3db0643e9 (patch)
tree099100b315903540614e248ee26ae0b9d86a2e41 /gtk
parent795466829231c3fdc16f7576ac874ab6091fcdf2 (diff)
downloadgtk+-60051ff6700171c384257134952110a3db0643e9.tar.gz
add missing '}' that got munched by #endif.
Mon Apr 23 18:57:03 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtksocket.c (gtk_socket_filter_func): add missing '}' that got munched by #endif. * gtk/Makefile.am (gtk_plug_c_sources): add missing '\' * gtk/gtktreeview.c: Refactored code to clean up a number of events. * gtk/gtktreemodel.c (gtk_tree_path_compare): Switched return values to make consistent with other functions. Spotted by Jeff Franks <jcf@tpg.com.au>. * gtk/gtktreeview.h (struct _GtkTreeViewClass): Fixes to signal declaration spotted by Jeff Franks <jcf@tpg.com.au>.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/Makefile.am2
-rw-r--r--gtk/gtksocket.c3
-rw-r--r--gtk/gtktreedatalist.c1
-rw-r--r--gtk/gtktreemodel.c8
-rw-r--r--gtk/gtktreeprivate.h20
-rw-r--r--gtk/gtktreeselection.c4
-rw-r--r--gtk/gtktreeview.c350
-rw-r--r--gtk/gtktreeview.h26
8 files changed, 322 insertions, 92 deletions
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 0154bafd4d..8e15fb52d0 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -363,7 +363,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
if USE_X11
gtk_plug_c_sources = @STRIP_BEGIN@ \
gtkplug.c \
- gtksocket.c
+ gtksocket.c \
@STRIP_END@
endif
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index 315e84754f..42eb0e67ad 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -1086,7 +1086,8 @@ gtk_socket_filter_func (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
GDK_WINDOW_XWINDOW (toplevel->window),
RevertToParent, CurrentTime); /* FIXME? */
}
-#endif }
+#endif
+ }
return_val = GDK_FILTER_REMOVE;
break;
case FocusOut:
diff --git a/gtk/gtktreedatalist.c b/gtk/gtktreedatalist.c
index b4f400fb42..5a429ad98b 100644
--- a/gtk/gtktreedatalist.c
+++ b/gtk/gtktreedatalist.c
@@ -103,6 +103,7 @@ _gtk_tree_data_list_check_type (GType type)
return FALSE;
}
+
void
_gtk_tree_data_list_node_to_value (GtkTreeDataList *list,
GType type,
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c
index 982639b303..c79e1fe90d 100644
--- a/gtk/gtktreemodel.c
+++ b/gtk/gtktreemodel.c
@@ -350,8 +350,8 @@ gtk_tree_path_copy (GtkTreePath *path)
* @a: A #GtkTreePath.
* @b: A #GtkTreePath to compare with.
*
- * Compares two paths. If @a appears before @b in a tree, then 1, is returned.
- * If @b appears before @a, then -1 is returned. If the two nodes are equal,
+ * Compares two paths. If @a appears before @b in a tree, then -1, is returned.
+ * If @b appears before @a, then 1 is returned. If the two nodes are equal,
* then 0 is returned.
*
* Return value: The relative positions of @a and @b
@@ -371,12 +371,12 @@ gtk_tree_path_compare (const GtkTreePath *a,
{
if (a->indices[p] == b->indices[q])
continue;
- return (a->indices[p] < b->indices[q]?1:-1);
+ return (a->indices[p] < b->indices[q]?-1:1);
}
while (++p < a->depth && ++q < b->depth);
if (a->depth == b->depth)
return 0;
- return (a->depth < b->depth?1:-1);
+ return (a->depth < b->depth?-1:1);
}
/**
diff --git a/gtk/gtktreeprivate.h b/gtk/gtktreeprivate.h
index 1d6076a93f..0079ff3235 100644
--- a/gtk/gtktreeprivate.h
+++ b/gtk/gtktreeprivate.h
@@ -46,6 +46,7 @@ extern "C" {
#define TREE_VIEW_VERTICAL_SEPARATOR 2
#define TREE_VIEW_HORIZONTAL_SEPARATOR 0
+
#define TREE_VIEW_DRAG_WIDTH 6
typedef enum
@@ -56,7 +57,8 @@ typedef enum
GTK_TREE_VIEW_ARROW_PRELIT = 1 << 3,
GTK_TREE_VIEW_HEADERS_VISIBLE = 1 << 4,
GTK_TREE_VIEW_DRAW_KEYFOCUS = 1 << 5,
- GTK_TREE_VIEW_MODEL_SETUP = 1 << 6
+ GTK_TREE_VIEW_MODEL_SETUP = 1 << 6,
+ GTK_TREE_VIEW_IN_COLUMN_DRAG = 1 << 7,
} GtkTreeViewFlags;
#define GTK_TREE_VIEW_SET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags|=flag); }G_STMT_END
@@ -66,6 +68,20 @@ typedef enum
#define TREE_VIEW_COLUMN_WIDTH(column) (CLAMP (column->width, (column->min_width!=-1)?column->min_width:column->width, (column->max_width!=-1)?column->max_width:column->width))
#define TREE_VIEW_DRAW_EXPANDERS(tree_view) (!GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IS_LIST)&&GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
+ /* This lovely little value is used to determine how far away from the title bar
+ * you can move the mouse and still have a column drag work.
+ */
+#define TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER(tree_view) (10*TREE_VIEW_HEADER_HEIGHT(tree_view))
+
+typedef struct _GtkTreeViewColumnReorder GtkTreeViewColumnReorder;
+struct _GtkTreeViewColumnReorder
+{
+ gint left_align;
+ gint right_align;
+ GtkTreeViewColumn *left_column;
+ GtkTreeViewColumn *right_column;
+};
+
struct _GtkTreeViewPrivate
{
GtkTreeModel *model;
@@ -118,8 +134,10 @@ struct _GtkTreeViewPrivate
gint n_columns;
GList *columns;
gint header_height;
+
GtkTreeViewColumnDropFunc *column_drop_func;
GList *column_drag_info;
+ GtkTreeViewColumnReorder *cur_reorder;
/* Scroll timeout (e.g. during dnd) */
guint scroll_timeout;
diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c
index 4c511bb58b..e868ac7041 100644
--- a/gtk/gtktreeselection.c
+++ b/gtk/gtktreeselection.c
@@ -764,7 +764,7 @@ gtk_tree_selection_real_select_range (GtkTreeSelection *selection,
switch (gtk_tree_path_compare (start_path, end_path))
{
- case -1:
+ case 1:
_gtk_tree_view_find_node (selection->tree_view,
end_path,
&start_tree,
@@ -782,7 +782,7 @@ gtk_tree_selection_real_select_range (GtkTreeSelection *selection,
end_tree = start_tree;
end_node = start_node;
break;
- case 1:
+ case -1:
_gtk_tree_view_find_node (selection->tree_view,
start_path,
&start_tree,
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 719fae4660..99e2c09682 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -70,15 +70,6 @@ struct _GtkTreeViewChild
};
-typedef struct _GtkTreeViewColumnReorder GtkTreeViewColumnReorder;
-struct _GtkTreeViewColumnReorder
-{
- gint left_align;
- gint right_align;
- GtkTreeViewColumn *left_column;
- GtkTreeViewColumn *right_column;
-};
-
enum
{
ROW_ACTIVATED,
@@ -268,6 +259,7 @@ static gboolean gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_v
GdkEventMotion *event);
static void _gtk_tree_view_update_col_width (GtkTreeView *tree_view);
+static void gtk_tree_view_column_reorder_remove_draw (GtkTreeViewColumnReorder *reorder);
static GtkContainerClass *parent_class = NULL;
static guint tree_view_signals[LAST_SIGNAL] = { 0 };
@@ -1649,7 +1641,7 @@ gtk_tree_view_column_button_expose (GtkWidget *button,
button->allocation.width - 2,
button->allocation.height);
gdk_draw_line (button->window,
- button->style->white_gc,
+ button->style->bg_gc[GTK_STATE_SELECTED],
button->allocation.width - 1, 0,
button->allocation.width - 1,
button->allocation.height);
@@ -1664,7 +1656,7 @@ gtk_tree_view_column_button_expose (GtkWidget *button,
1, 0,
1, button->allocation.height);
gdk_draw_line (button->window,
- button->style->white_gc,
+ button->style->bg_gc[GTK_STATE_SELECTED],
0, 0,
0, button->allocation.height);
}
@@ -1672,58 +1664,83 @@ gtk_tree_view_column_button_expose (GtkWidget *button,
return FALSE;
}
+/* Motion Event */
static gboolean
-gtk_tree_view_motion (GtkWidget *widget,
- GdkEventMotion *event)
+gtk_tree_view_motion_resize_column (GtkWidget *widget,
+ GdkEventMotion *event)
{
- GtkTreeView *tree_view;
- GtkRBTree *tree;
- GtkRBNode *node;
- gint new_y;
- GtkRBTree *old_prelight_tree;
- GtkRBNode *old_prelight_node;
+ gint x;
+ gint new_width;
- tree_view = (GtkTreeView *) widget;
+ if (event->is_hint || event->window != widget->window)
+ gtk_widget_get_pointer (widget, &x, NULL);
+ else
+ x = event->x;
- if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE))
- {
- gint x;
- gint new_width;
+ new_width = gtk_tree_view_new_column_width (GTK_TREE_VIEW (widget),
+ GTK_TREE_VIEW (widget)->priv->drag_pos, &x);
+ if (x != GTK_TREE_VIEW (widget)->priv->x_drag)
+ gtk_tree_view_column_set_width (gtk_tree_view_get_column (GTK_TREE_VIEW (widget), GTK_TREE_VIEW (widget)->priv->drag_pos), new_width);
- if (event->is_hint || event->window != widget->window)
- gtk_widget_get_pointer (widget, &x, NULL);
- else
- x = event->x;
+ /* FIXME: Do we need to scroll */
+ _gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
+ return FALSE;
+}
- new_width = gtk_tree_view_new_column_width (GTK_TREE_VIEW (widget), tree_view->priv->drag_pos, &x);
- if (x != tree_view->priv->x_drag)
- {
- gtk_tree_view_column_set_width (gtk_tree_view_get_column (GTK_TREE_VIEW (widget), tree_view->priv->drag_pos), new_width);
- }
+static gboolean
+gtk_tree_view_motion_drag_column (GtkWidget *widget,
+ GdkEventMotion *event)
+{
+ GtkTreeView *tree_view = (GtkTreeView *) widget;
+ GtkTreeViewColumn *column = tree_view->priv->drag_column;
+ GtkTreeViewColumnReorder *reorder = NULL;
+ GList *list;
+ gint x, y;
- /* FIXME: Do we need to scroll */
- _gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
- return FALSE;
- }
+ if (column == NULL)
+ return FALSE;
- if (event->window == tree_view->priv->drag_window)
- {
- GtkTreeViewColumn *column = tree_view->priv->drag_column;
- gint x, y;
+ if (event->window != tree_view->priv->drag_window)
+ return FALSE;
- if (column == NULL)
- return FALSE;
- gdk_window_get_position (tree_view->priv->drag_window, &x, &y);
- x = CLAMP (x + (gint)event->x - column->drag_x, 0,
- MAX (tree_view->priv->width, GTK_WIDGET (tree_view)->allocation.width) - column->button->allocation.width);
+ gdk_window_get_position (tree_view->priv->drag_window, &x, &y);
+ x = CLAMP (x + (gint)event->x - column->drag_x, 0,
+ MAX (tree_view->priv->width, GTK_WIDGET (tree_view)->allocation.width) - column->button->allocation.width);
- gdk_window_move (tree_view->priv->drag_window, x, y);
- return TRUE;
- }
+ gdk_window_move (tree_view->priv->drag_window, x, y);
- /* Sanity check it */
- if (event->window != tree_view->priv->bin_window)
- return FALSE;
+ gdk_window_get_position (tree_view->priv->drag_window, &x, NULL);
+ x += (gint)event->x;
+ for (list = tree_view->priv->column_drag_info; list; list = list->next)
+ {
+ reorder = (GtkTreeViewColumnReorder *) list->data;
+ if (x >= reorder->left_align && x < reorder->right_align)
+ break;
+ reorder = NULL;
+ }
+
+ if (reorder && reorder == tree_view->priv->cur_reorder)
+ return TRUE;
+
+ gtk_tree_view_column_reorder_remove_draw (reorder);
+
+ tree_view->priv->cur_reorder = reorder;
+
+ return TRUE;
+}
+
+static gboolean
+gtk_tree_view_motion_bin_window (GtkWidget *widget,
+ GdkEventMotion *event)
+{
+ GtkTreeView *tree_view;
+ GtkRBTree *tree;
+ GtkRBNode *node;
+ gint new_y;
+ GtkRBTree *old_prelight_tree;
+ GtkRBNode *old_prelight_node;
+
+ tree_view = (GtkTreeView *) widget;
if (tree_view->priv->tree == NULL)
return FALSE;
@@ -1771,6 +1788,27 @@ gtk_tree_view_motion (GtkWidget *widget,
return TRUE;
}
+static gboolean
+gtk_tree_view_motion (GtkWidget *widget,
+ GdkEventMotion *event)
+{
+ GtkTreeView *tree_view;
+
+ tree_view = (GtkTreeView *) widget;
+
+ if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_RESIZE))
+ return gtk_tree_view_motion_resize_column (widget, event);
+
+ /* Drag column */
+ if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG))
+ gtk_tree_view_motion_drag_column (widget, event);
+
+ /* Sanity check it */
+ if (event->window == tree_view->priv->bin_window)
+ return gtk_tree_view_motion_bin_window (widget, event);
+ return FALSE;
+}
+
/* FIXME Is this function necessary? Can I get an enter_notify event
* w/o either an expose event or a mouse motion event?
*/
@@ -2064,6 +2102,10 @@ gtk_tree_view_button_release (GtkWidget *widget,
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
gdk_window_hide (tree_view->priv->drag_window);
+ g_list_foreach (tree_view->priv->column_drag_info, (GFunc) g_free, NULL);
+ g_list_free (tree_view->priv->column_drag_info);
+ tree_view->priv->column_drag_info = NULL;
+
return TRUE;
}
@@ -2827,6 +2869,14 @@ gtk_tree_view_forall (GtkContainer *container,
}
}
+/**
+ * gtk_tree_view_row_activated:
+ * @tree_view: A #GtkTreeView
+ * @path: The #GtkTreePath to be activated.
+ * @column: The #GtkTreeViewColumn to be activated.
+ *
+ * Activates the cell determined by @path and @column.
+ **/
void
gtk_tree_view_row_activated (GtkTreeView *tree_view,
GtkTreePath *path,
@@ -2834,14 +2884,23 @@ gtk_tree_view_row_activated (GtkTreeView *tree_view,
{
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
+ /* FIXME: Actually activate the path internally, not just emit the signal */
g_signal_emit (G_OBJECT(tree_view), tree_view_signals[ROW_ACTIVATED], 0, path, column);
}
+/**
+ * gtk_tree_view_map_expanded_rows:
+ * @tree_view: A #GtkTreeView
+ * @func: A function to be called
+ * @data: User data to be passed to the function.
+ *
+ * Calls @func on all expanded rows.
+ **/
void
-gtk_tree_view_map_open_rows (GtkTreeView *tree_view,
- GtkTreeViewMappingFunc func,
- gpointer data)
+gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view,
+ GtkTreeViewMappingFunc func,
+ gpointer data)
{
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
g_return_if_fail (func != NULL);
@@ -3672,36 +3731,113 @@ gtk_tree_view_unref_tree (GtkTreeView *tree_view,
gtk_tree_path_free (path);
}
-void
-_gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
- GtkTreeViewColumn *column)
+static void
+gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view,
+ GtkTreeViewColumn *column)
{
- GdkEvent send_event;
- GList *list = NULL;
- GList *tmp_list;
- gint left, right;
GtkTreeViewColumn *left_column;
- GtkTreeViewColumn *right_column;
+ GtkTreeViewColumn *cur_column;
+ GtkTreeViewColumnReorder *reorder;
+
+ GList *tmp_list;
+ gint left;
/* We want to precalculate the motion list such that we know what column slots
* are available.
*/
- left = 0;
left_column = NULL;
- for (tmp_list = tree_view->priv->columns; tmp_list; tmp_list = tmp_list->next)
+ /* First, identify all possible drop spots */
+ tmp_list = tree_view->priv->columns;
+
+ while (GTK_TREE_VIEW_COLUMN (tmp_list->data) != column)
+ {
+ g_assert (tmp_list);
+
+ cur_column = GTK_TREE_VIEW_COLUMN (tmp_list->data);
+ tmp_list = tmp_list->next;
+
+ if (cur_column->visible == FALSE)
+ continue;
+
+ reorder = g_new (GtkTreeViewColumnReorder, 1);
+ reorder->left_column = left_column;
+ left_column = reorder->right_column = cur_column;
+
+ tree_view->priv->column_drag_info = g_list_append (tree_view->priv->column_drag_info, reorder);
+ }
+
+ tmp_list = tmp_list->next;
+
+ /* Find the next visible column */
+ while (tmp_list != NULL && ! GTK_TREE_VIEW_COLUMN (tmp_list->data)->visible)
+ tmp_list = tmp_list->next;
+
+ if (tmp_list == NULL)
+ goto done;
+
+ left_column = GTK_TREE_VIEW_COLUMN (tmp_list->data);
+ tmp_list = tmp_list->next;
+
+ while (tmp_list)
{
- GtkTreeViewColumnReorder *reorder;
+ cur_column = GTK_TREE_VIEW_COLUMN (tmp_list->data);
+ tmp_list = tmp_list->next;
- if (GTK_TREE_VIEW_COLUMN (tmp_list->data)->visible == FALSE)
+ if (cur_column->visible == FALSE)
continue;
- right_column = tmp_list->data;
reorder = g_new (GtkTreeViewColumnReorder, 1);
+ reorder->left_column = left_column;
+ left_column = reorder->right_column = cur_column;
+
+ tree_view->priv->column_drag_info = g_list_append (tree_view->priv->column_drag_info, reorder);
+ }
+
+ /* Add the last one */
+ reorder = g_new (GtkTreeViewColumnReorder, 1);
+ reorder->left_column = left_column;
+ reorder->right_column = NULL;
+ tree_view->priv->column_drag_info = g_list_append (tree_view->priv->column_drag_info, reorder);
+
+ done:
+ /* Now we want to fill in the ranges for the columns, now that we've isolated them */
+ left = - TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER (tree_view);
+
+ for (tmp_list = tree_view->priv->column_drag_info; tmp_list; tmp_list = tmp_list->next)
+ {
+ reorder = (GtkTreeViewColumnReorder *) tmp_list->data;
+
reorder->left_align = left;
+ if (tmp_list->next != NULL)
+ {
+ g_assert (tmp_list->next->data);
+ left = reorder->right_align = (reorder->right_column->button->allocation.x +
+ reorder->right_column->button->allocation.width +
+ ((GtkTreeViewColumnReorder *)tmp_list->next->data)->left_column->button->allocation.x)/2;
+ }
+ else
+ {
+ gint width;
+
+ gdk_window_get_size (tree_view->priv->header_window, &width, NULL);
+ reorder->right_align = width + TREE_VIEW_COLUMN_DRAG_DEAD_MULTIPLIER (tree_view);
+ }
}
- /* if (list == NULL)
- return;*/
+}
+
+void
+_gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
+ GtkTreeViewColumn *column)
+{
+ GdkEvent send_event;
+
+ g_return_if_fail (tree_view->priv->column_drag_info == NULL);
+
+ gtk_tree_view_set_column_drag_info (tree_view, column);
+
+ if (tree_view->priv->column_drag_info == NULL)
+ return;
if (tree_view->priv->drag_window == NULL)
{
@@ -3765,6 +3901,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
while (gtk_events_pending ())
gtk_main_iteration ();
+ GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG);
gdk_pointer_grab (tree_view->priv->drag_window,
FALSE,
GDK_POINTER_MOTION_MASK|GDK_BUTTON_RELEASE_MASK,
@@ -4707,6 +4844,15 @@ gtk_tree_view_set_expander_column (GtkTreeView *tree_view,
}
}
+/**
+ * gtk_tree_view_get_expander_column:
+ * @tree_view:
+ *
+ * Returns the offset of the column that is the current expander column. This
+ * column has the expander arrow drawn next to it.
+ *
+ * Return value: The offset of the expander column.
+ **/
gint
gtk_tree_view_get_expander_column (GtkTreeView *tree_view)
{
@@ -6702,3 +6848,67 @@ gtk_tree_view_drag_data_received (GtkWidget *widget,
/* drop dest_row */
set_dest_row (context, NULL, NULL);
}
+
+
+/* GtkTreeViewColumnReorder functions
+ */
+
+static GtkTreeViewColumnReorder *
+gtk_tree_view_column_reorder_new (void)
+{
+ return g_new (GtkTreeViewColumnReorder, 1);
+}
+
+static void
+gtk_tree_view_column_reorder_free (GtkTreeViewColumnReorder *reorder)
+{
+ g_free (reorder);
+}
+
+static void
+gtk_tree_view_column_reorder_begin_draw (GtkTreeViewColumnReorder *reorder)
+{
+ if (reorder == NULL)
+ return;
+
+ if (reorder->right_column)
+ {
+ gtk_widget_queue_draw (reorder->right_column->button);
+ g_signal_handlers_disconnect_matched (G_OBJECT (reorder->right_column->button),
+ G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL,
+ gtk_tree_view_column_button_expose,
+ NULL);
+ }
+ if (reorder->left_column)
+ {
+ gtk_widget_queue_draw (reorder->left_column->button);
+ g_signal_handlers_disconnect_matched (G_OBJECT (reorder->left_column->button),
+ G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL,
+ gtk_tree_view_column_button_expose,
+ NULL);
+ }
+}
+
+static void
+gtk_tree_view_column_reorder_remove_draw (GtkTreeViewColumnReorder *reorder)
+{
+ if (reorder->left_column)
+ {
+ gtk_signal_connect_after (GTK_OBJECT (reorder->left_column->button),
+ "expose_event",
+ (GtkSignalFunc) gtk_tree_view_column_button_expose,
+ GINT_TO_POINTER (TRUE));
+ gtk_widget_queue_draw (reorder->left_column->button);
+ }
+ if (reorder->right_column)
+ {
+ gtk_signal_connect_after (GTK_OBJECT (reorder->right_column->button),
+ "expose_event",
+ (GtkSignalFunc) gtk_tree_view_column_button_expose,
+ GINT_TO_POINTER (FALSE));
+ gtk_widget_queue_draw (reorder->right_column->button);
+ }
+}
+
diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h
index 640128c5c4..61e234321a 100644
--- a/gtk/gtktreeview.h
+++ b/gtk/gtktreeview.h
@@ -65,18 +65,18 @@ struct _GtkTreeViewClass
{
GtkContainerClass parent_class;
- void (* set_scroll_adjustments) (GtkTreeView *tree_view,
- GtkAdjustment *hadjustment,
- GtkAdjustment *vadjustment);
- void (* row_activated) (GtkTreeView *tree_view,
- GtkTreeViewColumn *column);
- gint (* expand_row) (GtkTreeView *tree_view,
- GtkTreeIter *iter,
- GtkTreePath *path);
- gint (* collapse_row) (GtkTreeView *tree_view,
- GtkTreeIter *iter,
- GtkTreePath *path);
-
+ void (* set_scroll_adjustments) (GtkTreeView *tree_view,
+ GtkAdjustment *hadjustment,
+ GtkAdjustment *vadjustment);
+ void (* row_activated) (GtkTreeView *tree_view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column);
+ gboolean (* expand_row) (GtkTreeView *tree_view,
+ GtkTreeIter *iter,
+ GtkTreePath *path);
+ gboolean (* collapse_row) (GtkTreeView *tree_view,
+ GtkTreeIter *iter,
+ GtkTreePath *path);
};
@@ -172,7 +172,7 @@ gboolean gtk_tree_view_collapse_row (GtkTreeView
void gtk_tree_view_row_activated (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column);
-void gtk_tree_view_map_open_rows (GtkTreeView *tree_view,
+void gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view,
GtkTreeViewMappingFunc func,
gpointer data);