Commit 9d03f7d6 authored by Anders Carlsson's avatar Anders Carlsson Committed by Anders Carlsson

Add a small test case.

2002-04-17  Anders Carlsson  <andersca@gnu.org>

	* tests/testtreeedit.c (button_press_event): Add a small
	test case.
parent 3140315f
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small
test case.
Wed Apr 17 00:21:36 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_insert_before): fix docs
......
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small
test case.
Wed Apr 17 00:21:36 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_insert_before): fix docs
......
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small
test case.
Wed Apr 17 00:21:36 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_insert_before): fix docs
......
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small
test case.
Wed Apr 17 00:21:36 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_insert_before): fix docs
......
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small
test case.
Wed Apr 17 00:21:36 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_insert_before): fix docs
......
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small
test case.
Wed Apr 17 00:21:36 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_insert_before): fix docs
......
......@@ -80,6 +80,20 @@ edited (GtkCellRendererText *cell,
gtk_tree_path_free (path);
}
static gboolean
button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer callback_data)
{
/* Deselect if people click outside any row. */
if (event->window == gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget))
&& !gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
event->x, event->y, NULL, NULL, NULL, NULL)) {
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)));
}
/* Let the default code run in any case; it won't reselect anything. */
return FALSE;
}
gint
main (gint argc, gchar **argv)
{
......@@ -102,6 +116,7 @@ main (gint argc, gchar **argv)
tree_model = create_model ();
tree_view = gtk_tree_view_new_with_model (tree_model);
g_signal_connect (tree_view, "button_press_event", G_CALLBACK (button_press_event), NULL);
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
......
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