+ return s_widget;
+}
+
+static GtkWidget* ToolTipWidget()
+{
+ static GtkWidget* s_widget;
+ if (s_widget == NULL)
+ {
+ s_widget = gtk_window_new(GTK_WINDOW_POPUP);
+ const char* name = "gtk-tooltip";
+#ifndef __WXGTK3__
+ if (gtk_check_version(2, 11, 0))
+ name = "gtk-tooltips";
+#endif
+ gtk_widget_set_name(s_widget, name);
+#ifndef __WXGTK3__
+ gtk_widget_ensure_style(s_widget);
+#endif
+ }
+ return s_widget;
+}
+
+#ifdef __WXGTK3__
+static void bg(GtkWidget* widget, GtkStateFlags state, GdkRGBA& gdkRGBA)
+{
+ GtkStyleContext* sc = gtk_widget_get_style_context(widget);
+ gtk_style_context_get_background_color(sc, state, &gdkRGBA);
+}
+static void fg(GtkWidget* widget, GtkStateFlags state, GdkRGBA& gdkRGBA)
+{
+ GtkStyleContext* sc = gtk_widget_get_style_context(widget);
+ gtk_style_context_get_color(sc, state, &gdkRGBA);
+}
+static void border(GtkWidget* widget, GtkStateFlags state, GdkRGBA& gdkRGBA)
+{
+ GtkStyleContext* sc = gtk_widget_get_style_context(widget);
+ gtk_style_context_get_border_color(sc, state, &gdkRGBA);
+}
+
+wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
+{
+ GdkRGBA gdkRGBA = { 0, 0, 0, 1 };
+ switch (index)
+ {
+ case wxSYS_COLOUR_3DLIGHT:
+ case wxSYS_COLOUR_ACTIVEBORDER:
+ case wxSYS_COLOUR_BTNFACE:
+ case wxSYS_COLOUR_DESKTOP:
+ case wxSYS_COLOUR_INACTIVEBORDER:
+ case wxSYS_COLOUR_INACTIVECAPTION:
+ case wxSYS_COLOUR_SCROLLBAR:
+ case wxSYS_COLOUR_WINDOWFRAME:
+ bg(ButtonWidget(), GTK_STATE_FLAG_NORMAL, gdkRGBA);
+ break;
+ case wxSYS_COLOUR_BTNHIGHLIGHT:
+ case wxSYS_COLOUR_HIGHLIGHT:
+ bg(ButtonWidget(), GTK_STATE_FLAG_SELECTED, gdkRGBA);
+ break;
+ case wxSYS_COLOUR_BTNSHADOW:
+ border(ButtonWidget(), GTK_STATE_FLAG_NORMAL, gdkRGBA);
+ break;
+ case wxSYS_COLOUR_BTNTEXT:
+ case wxSYS_COLOUR_WINDOWTEXT:
+ fg(ButtonWidget(), GTK_STATE_FLAG_NORMAL, gdkRGBA);
+ break;
+ case wxSYS_COLOUR_GRAYTEXT:
+ case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
+ fg(ButtonWidget(), GTK_STATE_FLAG_INSENSITIVE, gdkRGBA);
+ break;
+ case wxSYS_COLOUR_HIGHLIGHTTEXT:
+ fg(ButtonWidget(), GTK_STATE_FLAG_SELECTED, gdkRGBA);
+ break;
+ case wxSYS_COLOUR_HOTLIGHT:
+ {
+ static GtkWidget* s_widget;
+ if (s_widget == NULL)
+ {
+ s_widget = gtk_link_button_new("");
+ gtk_container_add(ContainerWidget(), s_widget);
+ }
+ fg(s_widget, GTK_STATE_FLAG_NORMAL, gdkRGBA);
+ }
+ break;