]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/button.cpp
native apple event support for osx cocoa
[wxWidgets.git] / src / gtk / button.cpp
index bee9497fbccaea9ff0c39cacd5048c17b65e2a54..fabe9a234f7666b626b294b19d378db16f926108 100644 (file)
@@ -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<GtkBoxChild*>(item->data);
+                gtk_widget_modify_style(boxChild->widget, style);
+            }
         }
     }
 }