Implemented run-time checks for the GTK version

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2004-12-05 23:03:09 +00:00
parent d7b995a497
commit 77f706726c
8 changed files with 420 additions and 334 deletions

View File

@@ -487,16 +487,19 @@ bool wxTextCtrl::Create( wxWindow *parent,
gtk_text_view_set_justification( GTK_TEXT_VIEW(m_text), GTK_JUSTIFY_CENTER );
// Left justify (alignment) is the default and we don't need to apply GTK_JUSTIFY_LEFT
}
// gtk_entry_set_alignment was introduced in gtk+-2.3.5
#if GTK_CHECK_VERSION(2, 3, 5)
else
{
if (style & wxTE_RIGHT)
gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 );
else if (style & wxTE_CENTRE)
gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 );
#ifdef __WXGTK24__
// gtk_entry_set_alignment was introduced in gtk+-2.3.5
if (!gtk_check_version(2,4,0))
{
if (style & wxTE_RIGHT)
gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 );
else if (style & wxTE_CENTRE)
gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 );
}
#endif
}
#endif // gtk+-2.3.5
#endif // __WXGTK20__
// We want to be notified about text changes.