From: Václav Slavík Date: Sun, 15 Aug 2004 18:39:25 +0000 (+0000) Subject: compilation fix for GTK2 < 2.4 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a650b927dafff6decbafdab9b3a2aaeac5e25670 compilation fix for GTK2 < 2.4 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index e3a010662f..7b8ef4ed8c 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -127,11 +127,12 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, else if (HasFlag(wxBU_BOTTOM)) y_alignment = 1.0; -#ifdef __WXGTK20__ +#if GTK_CHECK_VERSION(2,4,0) gtk_button_set_alignment(GTK_BUTTON(m_widget), x_alignment, y_alignment); #else - gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), - x_alignment, y_alignment); + if (GTK_IS_MISC(BUTTON_CHILD(m_widget))) + gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), + x_alignment, y_alignment); #endif if (!label.empty()) diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index e3a010662f..7b8ef4ed8c 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -127,11 +127,12 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, else if (HasFlag(wxBU_BOTTOM)) y_alignment = 1.0; -#ifdef __WXGTK20__ +#if GTK_CHECK_VERSION(2,4,0) gtk_button_set_alignment(GTK_BUTTON(m_widget), x_alignment, y_alignment); #else - gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), - x_alignment, y_alignment); + if (GTK_IS_MISC(BUTTON_CHILD(m_widget))) + gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), + x_alignment, y_alignment); #endif if (!label.empty())