+
+wxSize wxStaticText::DoGetBestSize() const
+{
+ // Do not return any arbitrary default value...
+ wxASSERT_MSG( m_widget, wxT("wxStaticText::DoGetBestSize called before creation") );
+
+ // GetBestSize is supposed to return unwrapped size
+ gtk_label_set_line_wrap( GTK_LABEL(m_widget), FALSE );
+
+ GtkRequisition req;
+ req.width = -1;
+ req.height = -1;
+ (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
+ (m_widget, &req );
+
+ gtk_label_set_line_wrap( GTK_LABEL(m_widget), TRUE );
+
+ // Adding 1 to width to workaround GTK sometimes wrapping the text needlessly
+ return wxSize (req.width+1, req.height);
+}
+
+bool wxStaticText::SetForegroundColour(const wxColour& colour)
+{
+ // First, we call the base class member
+ wxControl::SetForegroundColour(colour);
+ // Then, to force the color change, we set the label with the current label
+ SetLabel(GetLabel());
+ return true;
+}
+
+bool wxStaticText::GTKWidgetNeedsMnemonic() const
+{
+ return true;
+}
+
+void wxStaticText::GTKWidgetDoSetMnemonic(GtkWidget* w)
+{
+ gtk_label_set_mnemonic_widget(GTK_LABEL(m_widget), w);
+}
+
+// static
+wxVisualAttributes
+wxStaticText::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+ return GetDefaultAttributesFromGTKWidget(gtk_label_new);
+}
+
+#endif // wxUSE_STATTEXT