]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/button.cpp
Added Lithuanian translations.
[wxWidgets.git] / src / gtk / button.cpp
index 28366f0219fcdf22f349bba903a4e96bcbc8a9c4..cf3fb8b26aea5aaff6be2c5278e78b97a5e25134 100644 (file)
@@ -19,6 +19,7 @@
 #include "wx/stockitem.h"
 
 #include "wx/gtk/private.h"
+#include "wx/gtk/private/list.h"
 
 // ----------------------------------------------------------------------------
 // GTK callbacks
@@ -244,7 +245,6 @@ bool wxButton::DoSetLabelMarkup(const wxString& markup)
 
     return true;
 }
-#endif // wxUSE_MARKUP
 
 GtkLabel *wxButton::GTKGetLabel() const
 {
@@ -253,20 +253,19 @@ GtkLabel *wxButton::GTKGetLabel() const
     {
         GtkWidget* box = gtk_bin_get_child(GTK_BIN(child));
         GtkLabel* label = NULL;
-        GList* list = gtk_container_get_children(GTK_CONTAINER(box));
+        wxGtkList list(gtk_container_get_children(GTK_CONTAINER(box)));
         for (GList* item = list; item; item = item->next)
         {
-            GtkBoxChild* boxChild = static_cast<GtkBoxChild*>(item->data);
-            if ( GTK_IS_LABEL(boxChild->widget) )
-                label = GTK_LABEL(boxChild->widget);
+            if (GTK_IS_LABEL(item->data))
+                label = GTK_LABEL(item->data);
         }
-        g_list_free(list);
 
         return label;
     }
 
     return GTK_LABEL(child);
 }
+#endif // wxUSE_MARKUP
 
 void wxButton::DoApplyWidgetStyle(GtkRcStyle *style)
 {
@@ -281,13 +280,11 @@ void wxButton::DoApplyWidgetStyle(GtkRcStyle *style)
         GtkWidget* box = gtk_bin_get_child(GTK_BIN(child));
         if ( GTK_IS_BOX(box) )
         {
-            GList* list = gtk_container_get_children(GTK_CONTAINER(box));
+            wxGtkList list(gtk_container_get_children(GTK_CONTAINER(box)));
             for (GList* item = list; item; item = item->next)
             {
-                GtkBoxChild* boxChild = static_cast<GtkBoxChild*>(item->data);
-                gtk_widget_modify_style(boxChild->widget, style);
+                gtk_widget_modify_style(GTK_WIDGET(item->data), style);
             }
-            g_list_free(list);
         }
     }
 }