Re: list of all child widgets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Park wrote:
Hi, I just signed up.

How do I get a list of all child widgets, recursively down the
hierarchy?

GList *list = NULL;
gtk_container_foreach (widget, foreach_func, &list);


foreach_func (GtkWidget *widget, GList **list)
{
      *list = g_list_append (*list, widget);
      if (GTK_IS_CONTAINER (widget)) {
          gtk_container_foreach (widget, foreach_func, list);
      }
}

Cheers,
                      -Tristan

Note that you can use gtk_window_list_toplevels(); to get your
top-levels, then you can use the above code to get all widgets
in the application.
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux