- GtkWidget* widget = gtk_window_new(GTK_WINDOW_POPUP);
-#if GTK_CHECK_VERSION(2, 10, 0)
- if (!gtk_check_version(2, 10, 0))
- gtk_window_set_type_hint((GtkWindow*)widget, GDK_WINDOW_TYPE_HINT_TOOLTIP);
-#endif
- const char* name = "gtk-tooltip";
- if (gtk_check_version(2, 11, 0))
- name = "gtk-tooltips";
- gtk_widget_set_name(widget, name);
- gtk_widget_ensure_style(widget);
-
- GdkColor c = widget->style->bg[GTK_STATE_NORMAL];
- gs_objects.m_colTooltip = wxColor(c);
- c = widget->style->fg[GTK_STATE_NORMAL];
- gs_objects.m_colTooltipText = wxColor(c);
-
- gtk_widget_destroy(widget);
+ static GtkWidget* s_widget;
+ if (s_widget == NULL)
+ {
+ s_widget = gtk_window_new(GTK_WINDOW_POPUP);
+ const char* name = "gtk-tooltip";
+ if (gtk_check_version(2, 11, 0))
+ name = "gtk-tooltips";
+ gtk_widget_set_name(s_widget, name);
+ gtk_widget_ensure_style(s_widget);
+ }
+ return s_widget->style;