+ // this is not a native control, size_request is likely to be (0,0)
+ best = wxControlBase::DoGetBestSize();
+ }
+ else
+ {
+ GtkRequisition req;
+ GTK_WIDGET_GET_CLASS(m_widget)->size_request(m_widget, &req);
+ best.Set(req.width, req.height);
+ }
+ CacheBestSize(best);
+ return best;
+}
+
+void wxControl::PostCreation(const wxSize& size)
+{
+ wxWindow::PostCreation();
+
+ // NB: GetBestSize needs to know the style, otherwise it will assume
+ // default font and if the user uses a different font, determined
+ // best size will be different (typically, smaller) than the desired
+ // size. This call ensure that a style is available at the time
+ // GetBestSize is called.
+ gtk_widget_ensure_style(m_widget);
+
+ GTKApplyWidgetStyle();
+ SetInitialSize(size);
+}
+
+// ----------------------------------------------------------------------------
+// Work around a GTK+ bug whereby button is insensitive after being
+// enabled
+// ----------------------------------------------------------------------------
+
+// Fix sensitivity due to bug in GTK+ < 2.14
+void wxControl::GTKFixSensitivity(bool onlyIfUnderMouse)
+{
+ if (gtk_check_version(2,14,0)
+#if wxUSE_SYSTEM_OPTIONS
+ && (wxSystemOptions::GetOptionInt(wxT("gtk.control.disable-sensitivity-fix")) != 1)