X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77f706726cf5c5c4ccda8355cd9592216bb722fd..b14ba1f11722aeb4e4dcd52a686f5a50335776a1:/src/gtk1/button.cpp diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 5d6dda1190..e21402f843 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -59,6 +59,22 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton * button->GetEventHandler()->ProcessEvent(event); } +//----------------------------------------------------------------------------- +// "style_set" from m_widget +//----------------------------------------------------------------------------- + +static gint +gtk_button_style_set_callback( GtkWidget *m_widget, GtkStyle *WXUNUSED(style), wxButton *win ) +{ + if (g_isIdle) + wxapp_install_idle_handler(); + + if (GTK_WIDGET_REALIZED(m_widget)) + win->SetSize( win->m_x, win->m_y, win->m_width, win->m_height ); + + return FALSE; +} + //----------------------------------------------------------------------------- // wxButton //----------------------------------------------------------------------------- @@ -145,9 +161,12 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &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 ); + gtk_signal_connect_after( GTK_OBJECT(m_widget), "style_set", + GTK_SIGNAL_FUNC(gtk_button_style_set_callback), (gpointer*) this ); + m_parent->DoAddChild( this ); PostCreation(size); @@ -234,6 +253,9 @@ void wxButton::SetLabel( const wxString &lbl ) wxString label2 = PrepareLabelMnemonics(label); gtk_button_set_label(GTK_BUTTON(m_widget), wxGTK_CONV(label2)); gtk_button_set_use_stock(GTK_BUTTON(m_widget), FALSE); + + ApplyWidgetStyle( false ); + #else gtk_label_set(GTK_LABEL(BUTTON_CHILD(m_widget)), wxGTK_CONV(GetLabel())); #endif