Name
change_managed — Composite method to respond to a change in a list of managed widgets.
Synopsis
typedef void (∗XtWidgetProc)(Widget);
Widget w;
Arguments
wSpecifies the widget.
Description
The change_managed method is invoked when the application brings the child under its parent’s management. This happens automatically when the application uses XtCreateManagedWidget to create the widget. change_managed is also invoked when the application removes a widget from the parent’s managed list. Children can be managed explicitly with XtManageChild, XtManageChildren, XtUnmanageChild, and XtUnmanageChildren.
Since there are no additional arguments, the change_managed method must access the widget instance structure to get the child array.
Examples
The change_managed method updates instance fields that contain information about the managed children, and then calculates a new layout. The following is the change_managed method of the Athena Form widget class:
static void ChangeManaged(w)
Widget w;
{
FormWidget fw = (FormWidget)w;
FormConstraints form;
WidgetList children, childP;
int num_children = fw->composite.num_children;
Widget child;
/∗
∗ Reset virtual width and height for all children.
∗/
for (children = childP = fw->composite.children ;
childP - children < num_children; childP++) {
child = ∗childP;
if (XtIsManaged(child)) {
form = (FormConstraints)child->core.constraints;
/∗
∗ Size of one (1) is a special case for the Form widget.
∗/
if ( child->core.width != 1)
form->form.virtual_width = (int) child->core.width;
if ( child->core.height != 1)
form->form.virtual_height = (int) child->core.height;
}
}
RefigureLocations( (FormWidget)w );
}