Name
delete_child — Composite method called when a child is destroyed.
Synopsis
typedef void (∗XtWidgetProc)(Widget);
Widget w;
Arguments
wSpecifies the widget.
Description
While removing a child from a parent’s children array, XtDestroyWidget eventually causes a call to the Composite parent’s delete_child method.
Most widgets inherit the delete_child method from their superclass. Composite widgets that create companion widgets define their own delete_child method to remove these companion widgets.
Note that the insert_child and delete_child methods exploit internal common data structures, so it would be unwise to inherit one and not the other.
Examples
The following is the delete_child method of the Athena Paned widget class:
static void DeleteChild(w)
Widget w;
{
/∗ remove the subwidget info and destroy the grip ∗/
if ( IsPane(w) && HasGrip(w) ) XtDestroyWidget(PaneInfo(w)->grip);
/∗ delete the child widget in the composite children list with the ∗/
/∗ superclass delete_child routine. ∗/
(∗SuperClass->composite_class.delete_child) (w);
} /∗ DeleteChild ∗/