}
m_widget = gtk_label_new(NULL);
+ g_object_ref(m_widget);
GtkJustification justify;
- if ( style & wxALIGN_CENTER )
+ if ( style & wxALIGN_CENTER_HORIZONTAL )
justify = GTK_JUSTIFY_CENTER;
else if ( style & wxALIGN_RIGHT )
justify = GTK_JUSTIFY_RIGHT;
GTKSetLabelForLabel(GTK_LABEL(m_widget), label);
// adjust the label size to the new label unless disabled
- if ( !HasFlag(wxST_NO_AUTORESIZE) &&
- !IsEllipsized() ) // if ellipsize is ON, then we don't want to get resized!
+ if ( !HasFlag(wxST_NO_AUTORESIZE) &&
+ !IsEllipsized() ) // if ellipsization is ON, then we don't want to get resized!
SetSize( GetBestSize() );
}
}
void wxStaticText::DoSetSize(int x, int y,
- int width, int height,
- int sizeFlags )
+ int width, int height,
+ int sizeFlags )
{
wxStaticTextBase::DoSetSize(x, y, width, height, sizeFlags);
void wxStaticText::DoSetLabel(const wxString& str)
{
- GTKSetLabelForLabel(GTK_LABEL(m_widget), str);
+ // this function looks like GTKSetLabelForLabel() but here we just want to modify
+ // the GTK control without altering any internal wxStaticText variable
+
+ const wxString labelGTK = GTKConvertMnemonics(str);
+ gtk_label_set_text_with_mnemonic(GTK_LABEL(m_widget), wxGTK_CONV(labelGTK));
}
// static