GtkBin doesn't introduce any
new interfaces; it simply adds a data member to each
container instance for storing a single child, and
provides default implementations for the container
methods that operate on this one child. GtkBin implements the add,
remove, forall,
and child_type methods
from GtkContainer; combined
with GtkContainer's default
implementations, simple subclasses of GtkBin (such as
GtkEventBox,
GtkAlignment, and
GtkFrame) do not need to override any GtkContainer methods. Here's the
instance struct:
typedef struct _GtkBin GtkBin;
struct _GtkBin
{
GtkContainer container;
GtkWidget *child;
};
|
And the class struct:
typedef struct _GtkBinClass GtkBinClass;
struct _GtkBinClass
{
GtkContainerClass parent_class;
};
|
No rocket science here.