The child_type method
returns the type of children a container can hold. For
example, a GtkMenuShell
(parent class of GtkMenu and
GtkMenuBar) can only hold
children of type
GTK_TYPE_MENU_ITEM. The child_type method allows GUI
builders and scripting languages to determine at
runtime what sort of children a container will accept.
GTK_TYPE_NONE indicates
that a container will not accept children at this time,
for whatever reason.
The GtkBin implementation
accepts GTK_TYPE_WIDGET
if the bin is empty, and
GTK_TYPE_NONE if the bin already contains a
child:
static GtkType
gtk_bin_child_type (GtkContainer *container)
{
if (!GTK_BIN (container)->child)
return GTK_TYPE_WIDGET;
else
return GTK_TYPE_NONE;
}
|