Fixes #75510
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org> Fixes #75510 * gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this function work correctly and more sane * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove node->children from rbtree before emitting GtkTreeSelection::changed Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org> * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default, (gtk_cell_renderer_text_class_init): for some reason our default for editable was TRUE, of course this is FALSE. (gtk_cell_renderer_text_set_property): update mode when editable has been changed.
This commit is contained in:
committed by
Kristian Rietveld
parent
0a4977915b
commit
2666ab462e
@ -354,6 +354,7 @@ gtk_tree_selection_get_selected (GtkTreeSelection *selection,
|
||||
GtkRBNode *node;
|
||||
GtkTreePath *anchor_path;
|
||||
gboolean retval;
|
||||
gboolean found_node;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
|
||||
g_return_val_if_fail (selection->type != GTK_SELECTION_MULTIPLE, FALSE);
|
||||
@ -371,30 +372,31 @@ gtk_tree_selection_get_selected (GtkTreeSelection *selection,
|
||||
if (anchor_path == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (iter == NULL)
|
||||
{
|
||||
gtk_tree_path_free (anchor_path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
retval = FALSE;
|
||||
|
||||
if (!_gtk_tree_view_find_node (selection->tree_view,
|
||||
anchor_path,
|
||||
&tree,
|
||||
&node) &&
|
||||
! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
||||
found_node = !_gtk_tree_view_find_node (selection->tree_view,
|
||||
anchor_path,
|
||||
&tree,
|
||||
&node);
|
||||
|
||||
if (found_node && GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
|
||||
{
|
||||
/* we only want to return the anchor if it exists in the rbtree and
|
||||
* is selected.
|
||||
*/
|
||||
if (iter == NULL)
|
||||
retval = TRUE;
|
||||
else
|
||||
retval = gtk_tree_model_get_iter (selection->tree_view->priv->model,
|
||||
iter,
|
||||
anchor_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We don't want to return the anchor if it isn't actually selected.
|
||||
*/
|
||||
retval = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = gtk_tree_model_get_iter (selection->tree_view->priv->model,
|
||||
iter,
|
||||
anchor_path);
|
||||
}
|
||||
|
||||
gtk_tree_path_free (anchor_path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user