Avoid GtkAlignment with GTK+4

This commit is contained in:
Paul Cornett
2017-12-19 10:12:04 -08:00
parent 96befc88c0
commit ecda9c2016
5 changed files with 43 additions and 4 deletions

View File

@@ -108,7 +108,13 @@ bool wxStaticText::Create(wxWindow *parent,
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
#ifdef __WXGTK4__
g_object_set(m_widget, "xalign", labelAlignments[justify], NULL);
#else
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
wxGCC_WARNING_RESTORE()
#endif
gtk_label_set_line_wrap( GTK_LABEL(m_widget), TRUE );