]> Pileus Git - ~andy/gtk/commitdiff
gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips):
authorMatthias Clasen <matthiasc@src.gnome.org>
Mon, 13 Aug 2001 10:43:28 +0000 (10:43 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 13 Aug 2001 10:43:28 +0000 (10:43 +0000)
Don't remove the tooltip window when the tip text changes. (#15891)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktooltips.c

index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index 660782dd0800119657c671eed8dc69c1c2d81811..3004f0f4bdfe6a14bf5b67eaf8e5b7e6db62f020 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-13  Matthias Clasen  <matthiasc@waldgeist.poet.de>
+
+       * gtk/gtktooltips.c (gtk_tooltips_set_tip, gtk_tooltips_draw_tips): 
+       Don't remove the tooltip window when the tip text changes. (#15891)
+
 Sun Aug 12 12:02:09 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am ($(srcdir)/gtkmarshal.c): Remove extra
index cda5553b34115fc061cd90a0ece350140da720d8..e7263bc63f24d6502c6e57e82fe4906d207d99ff 100644 (file)
@@ -243,43 +243,61 @@ gtk_tooltips_set_tip (GtkTooltips *tooltips,
   g_return_if_fail (widget != NULL);
 
   tooltipsdata = gtk_tooltips_data_get (widget);
-  if (tooltipsdata)
-    gtk_tooltips_widget_remove (tooltipsdata->widget, tooltipsdata);
 
   if (!tip_text)
-    return;
-
-  tooltipsdata = g_new0 (GtkTooltipsData, 1);
+    {
+      if (tooltipsdata)
+       gtk_tooltips_widget_remove (tooltipsdata->widget, tooltipsdata);
+      return;
+    }
+  
+  if (tooltips->active_tips_data 
+      && tooltips->active_tips_data->widget == widget
+      && GTK_WIDGET_DRAWABLE (tooltips->active_tips_data->widget))
+    {
+      g_free (tooltipsdata->tip_text);
+      g_free (tooltipsdata->tip_private);
 
-  if (tooltipsdata != NULL)
+      tooltipsdata->tip_text = g_strdup (tip_text);
+      tooltipsdata->tip_private = g_strdup (tip_private);
+      
+      gtk_tooltips_draw_tips (tooltips);
+    }
+  else 
     {
+      gtk_widget_ref (widget);
+      
+      if (tooltipsdata)
+        gtk_tooltips_widget_remove (tooltipsdata->widget, tooltipsdata);
+      
+      tooltipsdata = g_new0 (GtkTooltipsData, 1);
+      
       tooltipsdata->tooltips = tooltips;
       tooltipsdata->widget = widget;
-      gtk_widget_ref (widget);
 
       tooltipsdata->tip_text = g_strdup (tip_text);
       tooltipsdata->tip_private = g_strdup (tip_private);
 
       tooltips->tips_data_list = g_list_append (tooltips->tips_data_list,
-                                             tooltipsdata);
-      gtk_signal_connect_after(GTK_OBJECT (widget), "event",
+                                                tooltipsdata);
+      gtk_signal_connect_after (GTK_OBJECT (widget), "event",
                                (GtkSignalFunc) gtk_tooltips_event_handler,
-                              (gpointer) tooltipsdata);
+                               tooltipsdata);
 
       gtk_object_set_data (GTK_OBJECT (widget), tooltips_data_key,
-                           (gpointer) tooltipsdata);
+                           tooltipsdata);
 
       gtk_signal_connect (GTK_OBJECT (widget), "unmap",
                           (GtkSignalFunc) gtk_tooltips_widget_unmap,
-                          (gpointer) tooltipsdata);
+                          tooltipsdata);
 
       gtk_signal_connect (GTK_OBJECT (widget), "unrealize",
                           (GtkSignalFunc) gtk_tooltips_widget_unmap,
-                          (gpointer) tooltipsdata);
+                          tooltipsdata);
 
       gtk_signal_connect (GTK_OBJECT (widget), "destroy",
-                         (GtkSignalFunc) gtk_tooltips_widget_remove,
-                         (gpointer) tooltipsdata);
+                          (GtkSignalFunc) gtk_tooltips_widget_remove,
+                          tooltipsdata);
     }
 }
 
@@ -306,10 +324,7 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips)
   if (!tooltips->tip_window)
     gtk_tooltips_force_window (tooltips);
   else if (GTK_WIDGET_VISIBLE (tooltips->tip_window))
-    {
-      gtk_widget_hide (tooltips->tip_window);
-      g_get_current_time (&tooltips->last_popdown);
-    }
+    g_get_current_time (&tooltips->last_popdown);
 
   gtk_widget_ensure_style (tooltips->tip_window);
   style = tooltips->tip_window->style;
@@ -344,7 +359,7 @@ gtk_tooltips_draw_tips (GtkTooltips * tooltips)
   else
     y = y + widget->allocation.height + 4;
 
-  gtk_widget_set_uposition (tooltips->tip_window, x, y);
+  gtk_window_move (tooltips->tip_window, x, y);
   gtk_widget_show (tooltips->tip_window);
 }