X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cdf71be825e114978731ceb33ae0d418f3018a6..89b4415803685b243946e4941522be8232621fa6:/src/gtk/button.cpp diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index bee9497fbc..fabe9a234f 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -100,6 +100,7 @@ bool wxButton::Create(wxWindow *parent, } m_widget = gtk_button_new_with_mnemonic(""); + g_object_ref(m_widget); float x_alignment = 0.5; if (HasFlag(wxBU_LEFT)) @@ -241,9 +242,11 @@ void wxButton::DoApplyWidgetStyle(GtkRcStyle *style) GtkWidget *box = GTK_BIN(child)->child; if ( GTK_IS_BOX(box) ) { - GList *items = gtk_container_get_children(GTK_CONTAINER(box)); - for ( GList *item = items; item; item = item->next ) - gtk_widget_modify_style(GTK_WIDGET(item->data), style); + for (GList* item = GTK_BOX(box)->children; item; item = item->next) + { + GtkBoxChild* boxChild = static_cast(item->data); + gtk_widget_modify_style(boxChild->widget, style); + } } } }