Re: Gtk incompatibilitie
- From: mail imaginet fr localhost localdomain
- To: gtk-list redhat com
- Subject: Re: Gtk incompatibilitie
- Date: Mon, 4 May 1998 11:16:34 +0200 (MET DST)
I think it's not a good idea to modify gtk software like control
pannel...
There many software that use the older gtk_tooltips_set_tips() fonction
from gtk 0.99...
I redistribute here the patch to made gtk software working using
gtk_tooltips_set_tips works with gtk1.0...
--
_____________________________ _________________________
|Jobs : System Administrator, | Contact : |
| Security computing, | casper_@cyberdude.com |
| Development. | |
|_____________________________|_________________________|
It's well-known that M$ products don't make a free() after a malloc()...
The linux users wish good luck to M$ for their future products...
Software is like sex... It's better when it's free
[ Linus Torvald ]
--- 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]