Re: list of all child widgets
- From: Tristan Van Berkom <tvb gnome org>
- To: William Park <opengeometry yahoo ca>
- Cc: gtk-list gnome org
- Subject: Re: list of all child widgets
- Date: Mon, 11 Jul 2005 16:47:14 -0400
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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]