+ return ret;
+}
+
+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 but calling
+ // gtk_label_set_line_wrap() from here is a bad idea as it queues another
+ // size request by calling gtk_widget_queue_resize() and we end up in
+ // infinite loop sometimes (notably when the control is in a toolbar)
+ // With GTK3 however, there is no simple alternative, and the sizing loop
+ // no longer seems to occur.
+#ifdef __WXGTK3__
+ gtk_label_set_line_wrap(GTK_LABEL(m_widget), false);
+#else
+ GTK_LABEL(m_widget)->wrap = FALSE;
+#endif
+ wxSize size = wxStaticTextBase::DoGetBestSize();
+#ifdef __WXGTK3__
+ gtk_label_set_line_wrap(GTK_LABEL(m_widget), true);
+#else
+ GTK_LABEL(m_widget)->wrap = TRUE; // restore old value
+#endif
+
+ // Adding 1 to width to workaround GTK sometimes wrapping the text needlessly
+ size.x++;
+ CacheBestSize(size);
+ return size;
+}
+
+bool wxStaticText::GTKWidgetNeedsMnemonic() const
+{
+ return true;
+}
+
+void wxStaticText::GTKWidgetDoSetMnemonic(GtkWidget* w)
+{
+ gtk_label_set_mnemonic_widget(GTK_LABEL(m_widget), w);
+}
+
+
+// These functions should be used only when GTK+ < 2.6 by wxStaticTextBase::UpdateLabel()
+
+wxString wxStaticText::DoGetLabel() const
+{
+ GtkLabel *label = GTK_LABEL(m_widget);
+ return wxGTK_CONV_BACK( gtk_label_get_text( label ) );
+}
+
+void wxStaticText::DoSetLabel(const wxString& str)
+{
+ GTKSetLabelForLabel(GTK_LABEL(m_widget), str);