X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19ac2f446a7f2aa76e451b628b151bed42f7075a..ce4fd7b577cdeb1ceb085cb1380c0df97b6ceef4:/src/gtk/button.cpp diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index a4cf62371a..e21402f843 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/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 //----------------------------------------------------------------------------- @@ -148,6 +164,9 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, 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);