[patch] gtk_tooltips_set_tips() multiple use




hi all,

this patch enables multiple use of the
gtk_tooltips_set_tips() function (like e.g. an interface builder needs it).
it is against gtk+970828.tar.gz + gtk-timj-970903-0.patch.


---
ciaoTJ

diff -ru gtk-timj-970903-0/gtk/gtktooltips.c gtk+-U1/gtk/gtktooltips.c
--- gtk-timj-970903-0/gtk/gtktooltips.c	Sun Aug 31 21:53:43 1997
+++ gtk+-U1/gtk/gtktooltips.c	Mon Sep  8 10:11:12 1997
@@ -253,6 +253,9 @@
   g_return_if_fail (tooltips != NULL);
   g_return_if_fail (widget != NULL);
 
+  if (gtk_object_get_data (GTK_OBJECT (widget), "_GtkTooltips") != NULL)
+    gtk_tooltips_widget_remove (widget, NULL);
+  
   tooltipsdata = g_new(GtkTooltipsData, 1);
 
   if (tooltipsdata != NULL)
@@ -582,9 +585,11 @@
       g_list_foreach (tooltipsdata->row, gtk_tooltips_free_string, 0);
       g_list_free (tooltipsdata->row);
       gtk_signal_disconnect_by_data (GTK_OBJECT (tooltipsdata->widget), (gpointer) tooltips);
-      /* gtk_widget_set_events (tooltipsdata->widget,tooltipsdata->old_event_mask); */
+      gtk_widget_set_events (tooltipsdata->widget,tooltipsdata->old_event_mask);
       g_free (tooltipsdata);
     
       tooltips->widget_list = g_list_remove (tooltips->widget_list, tooltipsdata);
     }
+  
+  gtk_object_set_data (GTK_OBJECT (widget), "_GtkTooltips", NULL);
 }





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