small patch for TreeView search dialog



Hi all,

Here's a small patch for the TreeView search dialog, which was created
twice on activation. Perhaps this fix is too hackish, if somebody has
better ideas to fix it, please tell me. The ChangeLog:

Fri Oct  5 16:34:13 2001  Kristian Rietveld  <kristian planet nl>

        * gtk/gtktreeview.c (gtk_tree_view_leave_notify): should
        destroy the search dialog

        * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
        added check to prevent creation of a search dialog if there's
        already one around


Ok to commit?

regards,


	Kris


Index: gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.150
diff -u -r1.150 gtktreeview.c
--- gtktreeview.c	2001/10/01 18:12:34	1.150
+++ gtktreeview.c	2001/10/05 14:24:58
@@ -2907,6 +2907,7 @@
 gtk_tree_view_leave_notify (GtkWidget        *widget,
 			    GdkEventCrossing *event)
 {
+  GtkWidget *search_dialog;
   GtkTreeView *tree_view;

   g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
@@ -2921,6 +2922,11 @@

   ensure_unprelighted (tree_view);

+  /* destroy interactive search dialog */
+  search_dialog = gtk_object_get_data (GTK_OBJECT (widget), "search-dialog");
+  if (search_dialog)
+    gtk_tree_view_search_dialog_destroy (search_dialog, GTK_TREE_VIEW (widget));
+
 return TRUE;
 }

@@ -6127,9 +6133,14 @@
 {
   GtkWidget *window;
   GtkWidget *entry;
+  GtkWidget *search_dialog;

   if (tree_view->priv->enable_search == FALSE ||
       tree_view->priv->search_column < 0)
+    return;
+
+  search_dialog = gtk_object_get_data (GTK_OBJECT (tree_view), "search-dialog");
+  if (search_dialog)
     return;

   /* set up window */





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]