Port to new GtkTooltip

This commit is contained in:
Paul Dicker
2025-03-29 09:18:04 +01:00
committed by Stéphane Lesimple
parent 3be61f4b7b
commit 9bbd268aa4
3 changed files with 3 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ typedef void GtkNotebook;
typedef int GtkMessageType;
typedef void GtkScrolledWindow;
typedef void GtkTextBuffer;
typedef void GtkTooltips;
typedef void GtkTooltip;
typedef void GtkWidget;
typedef void GtkWindow;
@@ -348,7 +348,7 @@ typedef struct _GlobalClosure
/*** Widgets of the main window */
GtkWindow *window; /* main window */
GtkTooltips *tooltips; /* our global tooltips structure */
GtkTooltip *tooltips; /* our global tooltips structure */
GdkPixbuf *windowIcon; /* main window icon */
GdkPixbuf *tooltipOn; /* pixbuf of the tooltip icon */
GdkPixbuf *tooltipOff; /* pixbuf of a fully transparent icon */

View File

@@ -439,10 +439,6 @@ void GuiCreateMainWindow(int *argc, char ***argv)
g_signal_connect(window, "destroy", G_CALLBACK(destroy_cb), NULL);
/*** Initialize the tooltips struct */
Closure->tooltips = gtk_tooltips_new();
/*** Create the sub parts of the GUI */
outer_box = gtk_vbox_new(FALSE, 0);

View File

@@ -291,7 +291,7 @@ void GuiAttachTooltip(GtkWidget *widget, char *short_descr, char *long_descr)
g_signal_connect(G_OBJECT(widget), "enter_notify_event", G_CALLBACK(tooltip_cb), (gpointer)long_copy);
g_signal_connect(G_OBJECT(widget), "leave_notify_event", G_CALLBACK(tooltip_cb), (gpointer)long_copy);
gtk_tooltips_set_tip(Closure->tooltips, widget, short_copy, long_copy);
gtk_widget_set_tooltip_text(widget, short_copy);
g_free(short_copy);
FORGET(long_copy); /* long_copy must be kept during programs life */