I need to be able to explore a GTK GUI\'s structure programmatically. I have the GtkWidget and I want to find any children of that widget. Now I know that GtkContainer\'s have a
Yes, there are macros for every GObject type to check whether an object is of that type:
if(GTK_IS_CONTAINER(widget)) {
GList *children = gtk_container_get_children(GTK_CONTAINER(widget));
...
}
If the widget is a GtkBin
it has only one child. In that case, the following is simpler than dealing with a GList
:
if(GTK_IS_BIN(widget)) {
GtkWidget *child = gtk_bin_get_child(GTK_BIN(widget));
...
}