Re: fvwm2

Top Page

Reply to this message
Author: Bruno Hondelatte
Date:  
To: Patrick Dupre LCMI, Linux38
CC: bhondela
Subject: Re: fvwm2
Dans votre message du May 12, 11:11 (intitule :'fvwm2') vous ecrivez :

> ** WARNING **: Creating pixmap from xpm with NULL window and colormap
> control-panel: error in loading shared libraries
> : undefined symbol: gtk_tooltips_set_tips
>
> Ou esr l'erreur, je ne peut plus lancer control-panel, semble-t'il a cause
> de gtk.
> J'ai installe gtk+-1.0.1-1.


Effectivement, la fonction gtk_tooltips_set_tips a disparu en passant de la
version 0.99.x a la version 1 (au profit d'une fonction gtk_tooltips_set_tip
qui n'a pas le meme profil d'ailleurs).

Ce probleme a ete souleve dans la mailing list de gtk, et 2 alternatives ont
ete proposees :

1) Patcher le control-panel (voir le diff qui suit), je pense que c'est la
meilleure solution (et la moins longue) pour le moment :

--- control-panel.c Wed Apr 15 14:21:50 1998
+++ control-panel.c.orig Sun Nov  9 14:50:15 1997
@@ -127,7 +127,7 @@
       /* turn this into a tooltip widget. */
 /*       label = gtk_label_new(items->label); */
 /*       tooltips = gtk_tooltips_new(); */
-      gtk_tooltips_set_tip(tooltips, button, items->label, "" );
+      gtk_tooltips_set_tips(tooltips, button, items->label);


       vbox = gtk_vbox_new(FALSE, 0);


2) Patcher gtk (patch non officiel) :

(NOTE : je n'ai pas teste ce patch, ce qui est ci-dessous est juste une copie
d'un mail de la mailing-list gtk)

--8323328-269167349-893954238=:812
Content-Type: TEXT/plain; CHARSET=US-ASCII
Content-Transfer-Encoding: 8BIT
Content-ID: gtktooltips.patch
Content-Description: gtktooltips.patch

--- gtk/gtktooltips.c Thu Apr 30 11:12:09 1998
+++ gtk/gtktooltips.c Thu Apr 30 11:19:49 1998
@@ -306,6 +306,60 @@
return gtk_object_get_data ((GtkObject*) widget, tooltips_data_key);
}

+/* This is a little hack to gtk to made it compatible with older version */
+void
+gtk_tooltips_set_tips (GtkTooltips *tooltips,
+                       GtkWidget   *widget,
+                       const gchar *tip_text)
+{
+  GtkTooltipsData *tooltipsdata;
+
+  g_return_if_fail (tooltips != NULL);
+  g_return_if_fail (GTK_IS_TOOLTIPS (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 != NULL)
+    {
+      tooltipsdata->tooltips = tooltips;
+      tooltipsdata->widget = widget;
+      gtk_widget_ref (widget);
+
+      tooltipsdata->tip_text = g_strdup (tip_text);
+      
+      gtk_tooltips_layout_text (tooltips, tooltipsdata);
+      tooltips->tips_data_list = g_list_append (tooltips->tips_data_list,
+                                             tooltipsdata);
+      gtk_signal_connect_after(GTK_OBJECT (widget), "event",
+                               (GtkSignalFunc) gtk_tooltips_event_handler,
+                              (gpointer) tooltipsdata);
+
+      gtk_object_set_data (GTK_OBJECT (widget), tooltips_data_key,
+                           (gpointer) tooltipsdata);
+
+      gtk_signal_connect (GTK_OBJECT (widget), "unmap",
+                          (GtkSignalFunc) gtk_tooltips_widget_unmap,
+                          (gpointer) tooltipsdata);
+
+      gtk_signal_connect (GTK_OBJECT (widget), "unrealize",
+                          (GtkSignalFunc) gtk_tooltips_widget_unmap,
+                          (gpointer) tooltipsdata);
+
+      gtk_signal_connect (GTK_OBJECT (widget), "destroy",
+                         (GtkSignalFunc) gtk_tooltips_widget_remove,
+                         (gpointer) tooltipsdata);
+    }
+}
+/* End Of The Little Hack */
+
 void
 gtk_tooltips_set_tip (GtkTooltips *tooltips,
                      GtkWidget   *widget,
--- gtk/gtktooltips.h   Thu Apr 30 11:21:49 1998
+++ gtk/gtktooltips.h   Thu Apr 30 11:25:02 1998
@@ -79,6 +79,13 @@
                                          GtkWidget       *widget,
                                          const gchar     *tip_text,
                                          const gchar     *tip_private);
+
+/* Little Hack to made Gtk 1.0 compatible with older version */
+void             gtk_tooltips_set_tips   (GtkTooltips *tooltips,
+                                          GtkWidget   *widget,
+                                          const gchar *tip_text);
+/* End of the little hack */
+   
 void            gtk_tooltips_set_colors (GtkTooltips     *tooltips,
                                          GdkColor        *background,
                                          GdkColor        *foreground);


--8323328-269167349-893954238=:812--

Fin du courrier de pdupre@??? (Patrick Dupre LCMI)


-- 
    ._______________________________________________________.
    |     Bruno HONDELATTE                |
    |     5, rue Docteur Mazet                |
    |     38000 GRENOBLE                    |
    |     E-mail : Bruno.Hondelatte@???    |
    |_______________________________________________________|