Now we test we can unselect nodes before selecting new ones.

Wed Jan  9 19:10:07 2002  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeselection.c
	(_gtk_tree_selection_internal_select_node): Now we test we can
	unselect nodes before selecting new ones.
	(gtk_tree_selection_real_select_node): be careful comparing booleans.
This commit is contained in:
Jonathan Blandford 2002-01-10 00:11:32 +00:00 committed by Jonathan Blandford
parent b99088974e
commit ed50ebfb28
10 changed files with 78 additions and 4 deletions

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -1,3 +1,10 @@
Wed Jan 9 19:10:07 2002 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c
(_gtk_tree_selection_internal_select_node): Now we test we can
unselect nodes before selecting new ones.
(gtk_tree_selection_real_select_node): be careful comparing booleans.
Wed Jan 9 21:31:44 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_sort): pass NULL to

View File

@ -265,11 +265,14 @@ section.
</para>
<!-- ##### FUNCTION gdk_threads_leave ##### -->
<para>
Leaves a critical region begun with gdk_threads_enter().
</para>
<!-- ##### VARIABLE gdk_threads_mutex ##### -->
<para>
The #GMutex used to implement the critical region for

View File

@ -102,6 +102,8 @@ struct _GtkTreeViewPrivate
GtkTreeViewColumn *drag_column;
/* bin_window offset */
GtkTreeRowReference *top_row;
gint top_row_dy;
gint dy;
gint drag_column_x;

View File

@ -994,12 +994,30 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
}
else
{
/* FIXME: We only want to select the new node if we can unselect the
* old one, and we can select the new one. We are currently
* unselecting the old one first, then trying the new one. */
if (anchor_path)
{
dirty = gtk_tree_selection_real_unselect_all (selection);
/* We only want to select the new node if we can unselect the old one,
* and we can select the new one. */
if (selection->user_func)
{
if ((*selection->user_func) (selection, selection->tree_view->priv->model, path,
GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED),
selection->user_data))
dirty = TRUE;
}
else
{
dirty = TRUE;
}
/* if dirty is FALSE, we weren't able to select the new one, otherwise, we try to
* unselect the new one
*/
if (dirty)
dirty = gtk_tree_selection_real_unselect_all (selection);
/* if dirty is TRUE at this point, we successfully unselected the
* old one, and can then select the new one */
if (dirty)
{
if (selection->tree_view->priv->anchor)
@ -1093,6 +1111,8 @@ gtk_tree_selection_real_select_node (GtkTreeSelection *selection,
gboolean selected = FALSE;
GtkTreePath *path = NULL;
select = !! select;
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select)
{
path = _gtk_tree_view_find_path (selection->tree_view, tree, node);