+ GtkShadowType shadow_type;
+
+ if ( flags & wxCONTROL_UNDETERMINED )
+ shadow_type = GTK_SHADOW_ETCHED_IN;
+ else if ( flags & wxCONTROL_CHECKED )
+ shadow_type = GTK_SHADOW_IN;
+ else
+ shadow_type = GTK_SHADOW_OUT;
+#endif
+
+#ifdef __WXGTK3__
+ cairo_t* cr = wxGetGTKDrawable(win, dc);
+ if (cr)
+ {
+ int stateFlags = GTK_STATE_FLAG_NORMAL;
+ if (flags & wxCONTROL_CHECKED)
+ stateFlags = GTK_STATE_FLAG_ACTIVE;
+ if (flags & wxCONTROL_DISABLED)
+ stateFlags |= GTK_STATE_FLAG_INSENSITIVE;
+ if (flags & wxCONTROL_UNDETERMINED)
+ stateFlags |= GTK_STATE_FLAG_INCONSISTENT;
+ if (flags & wxCONTROL_CURRENT)
+ stateFlags |= GTK_STATE_FLAG_PRELIGHT;
+ GtkStyleContext* sc = gtk_widget_get_style_context(button);
+ gtk_style_context_save(sc);
+ gtk_style_context_set_state(sc, GtkStateFlags(stateFlags));
+ gtk_style_context_add_class(sc, GTK_STYLE_CLASS_CHECK);
+ gtk_render_check(sc, cr,
+ rect.x + (rect.width - indicator_size) / 2,
+ rect.y + (rect.height - indicator_size) / 2,
+ indicator_size, indicator_size);
+ gtk_style_context_restore(sc);
+ }
+#else
+ GdkWindow* gdk_window = wxGetGTKDrawable(win, dc);
+ if (gdk_window == NULL)
+ return;
+