diff options
Diffstat (limited to 'gtk/a11y/gtknotebookpageaccessible.c')
-rw-r--r-- | gtk/a11y/gtknotebookpageaccessible.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/gtk/a11y/gtknotebookpageaccessible.c b/gtk/a11y/gtknotebookpageaccessible.c index dcdfe16f03..09d089ebe3 100644 --- a/gtk/a11y/gtknotebookpageaccessible.c +++ b/gtk/a11y/gtknotebookpageaccessible.c @@ -36,31 +36,25 @@ G_DEFINE_TYPE_WITH_CODE (GtkNotebookPageAccessible, gtk_notebook_page_accessible static GtkWidget * -find_label_child (GtkContainer *container) +find_label_child (GtkWidget *widget) { - GList *children, *tmp_list; GtkWidget *child; - children = gtk_container_get_children (container); - - child = NULL; - for (tmp_list = children; tmp_list != NULL; tmp_list = tmp_list->next) + for (child = gtk_widget_get_first_child (widget); + child != NULL; + child = gtk_widget_get_next_sibling (child)) { - if (GTK_IS_LABEL (tmp_list->data)) - { - child = GTK_WIDGET (tmp_list->data); - break; - } - else if (GTK_IS_CONTAINER (tmp_list->data)) + if (GTK_IS_LABEL (child)) + return child; + else { - child = find_label_child (GTK_CONTAINER (tmp_list->data)); - if (child) - break; + GtkWidget *w = find_label_child (child); + if (w) + return w; } } - g_list_free (children); - return child; + return NULL; } static GtkWidget * @@ -81,10 +75,7 @@ get_label_from_notebook_page (GtkNotebookPageAccessible *page) if (GTK_IS_LABEL (child)) return child; - if (GTK_IS_CONTAINER (child)) - child = find_label_child (GTK_CONTAINER (child)); - - return child; + return find_label_child (child); } static const gchar * |