Commit 57cc0e95 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

new function, #61923 (gtk_tree_selection_path_is_selected): Ditto

Wed Oct 10 01:19:04 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
	new function, #61923
	(gtk_tree_selection_path_is_selected): Ditto
parent b48389f3
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
Wed Oct 10 01:19:04 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_iter_is_selected):
new function, #61923
(gtk_tree_selection_path_is_selected): Ditto
Tue Oct 9 17:40:24 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreestore.c (gtk_tree_store_finalize): We're a gobject,
......
......@@ -604,6 +604,71 @@ gtk_tree_selection_unselect_iter (GtkTreeSelection *selection,
gtk_tree_path_free (path);
}
/**
* gtk_tree_selection_path_is_selected:
* @selection: A #GtkTreeSelection.
* @path: A #GtkTreePath to check selection on.
*
* Returns %TRUE if the row pointed to by @path is currently selected. If @path
* does not point to a valid location, %FALSE is returned
*
* Return value: %TRUE if @path is selected.
**/
gboolean
gtk_tree_selection_path_is_selected (GtkTreeSelection *selection,
GtkTreePath *path)
{
GtkRBNode *node;
GtkRBTree *tree;
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
g_return_val_if_fail (selection->tree_view != NULL, FALSE);
g_return_val_if_fail (selection->tree_view->priv->model != NULL, FALSE);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if ((node == NULL) || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
return FALSE;
return TRUE;
}
/**
* gtk_tree_selection_iter_is_selected:
* @selection: A #GtkTreeSelection
* @iter: A valid #GtkTreeIter
*
* Returns %TRUE if the row pointed to by @path is currently selected.
*
* Return value: %TRUE, if @iter is selected
**/
gboolean
gtk_tree_selection_iter_is_selected (GtkTreeSelection *selection,
GtkTreeIter *iter)
{
GtkTreePath *path;
gboolean retval;
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (selection->tree_view != NULL, FALSE);
g_return_val_if_fail (selection->tree_view->priv->model != NULL, FALSE);
path = gtk_tree_model_get_path (selection->tree_view->priv->model, iter);
if (path == NULL)
return FALSE;
retval = gtk_tree_selection_path_is_selected (selection, path);
gtk_tree_path_free (path);
return retval;
}
/* Wish I was in python, right now... */
struct _TempTuple {
GtkTreeSelection *selection;
......
......@@ -95,6 +95,10 @@ void gtk_tree_selection_select_iter (GtkTreeSelection
GtkTreeIter *iter);
void gtk_tree_selection_unselect_iter (GtkTreeSelection *selection,
GtkTreeIter *iter);
gboolean gtk_tree_selection_path_is_selected (GtkTreeSelection *selection,
GtkTreePath *path);
gboolean gtk_tree_selection_iter_is_selected (GtkTreeSelection *selection,
GtkTreeIter *iter);
void gtk_tree_selection_select_all (GtkTreeSelection *selection);
void gtk_tree_selection_unselect_all (GtkTreeSelection *selection);
void gtk_tree_selection_select_range (GtkTreeSelection *selection,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment