X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f7bcb48fd9a642036a3bf5c70e2b0c9576df1b1..de5dd006449a97887afb2aad39c8f20549818d98:/src/gtk1/button.cpp diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index d411a22eda..640ba4139c 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -127,20 +127,25 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, else if (HasFlag(wxBU_BOTTOM)) y_alignment = 1.0; -#if GTK_CHECK_VERSION(2,4,0) - gtk_button_set_alignment(GTK_BUTTON(m_widget), x_alignment, y_alignment); -#else - if (GTK_IS_MISC(BUTTON_CHILD(m_widget))) - gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), - x_alignment, y_alignment); +#if __WXGTK24__ + if (!gtk_check_version(2,4,0)) + { + gtk_button_set_alignment(GTK_BUTTON(m_widget), x_alignment, y_alignment); + } + else #endif + { + if (GTK_IS_MISC(BUTTON_CHILD(m_widget))) + gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), + x_alignment, y_alignment); + } SetLabel(label); if (style & wxNO_BORDER) gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); - gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", + gtk_signal_connect_after( GTK_OBJECT(m_widget), "clicked", GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this ); m_parent->DoAddChild( this ); @@ -209,10 +214,8 @@ void wxButton::SetLabel( const wxString &lbl ) wxString label(lbl); -#ifndef __WXGTK20__ if (label.empty() && wxIsStockID(m_windowId)) label = wxGetStockLabel(m_windowId); -#endif wxControl::SetLabel(label); @@ -224,8 +227,8 @@ void wxButton::SetLabel( const wxString &lbl ) { gtk_button_set_label(GTK_BUTTON(m_widget), stock); gtk_button_set_use_stock(GTK_BUTTON(m_widget), TRUE); + return; } - return; } wxString label2 = PrepareLabelMnemonics(label);