Name
XtOrderProc — Composite function to determine position for new child.
Synopsis
typedef Cardinal (∗XtOrderProc)(Widget);
Widget w;
Arguments
wSpecifies the widget.
Description
Instances of composite widgets may need to specify information about the order in which their children are kept. For example, an application may want a set of command buttons in some logical order grouped by function, and it may want buttons that represent filenames to be kept in alphabetical order. The insert_position function in the Composite widget instance structure does this. You provide this function by setting the XtNinsertPosition resource of a Composite widget to a function.
Composite widgets that allow clients to order their children (usually homogeneous boxes) can call their widget instance’s insert_position method from the class’s insert_child method to determine where a new child should go in its children array. Thus, a client of a composite class can apply different sorting criteria to widget instances of the class, passing in a different insert_position method when it creates each composite widget instance.
The return value of the insert_position method indicates how many children should go before the widget. Returning zero indicates that the widget should go before all other children, and returning num_children indicates that it should go after all other children. The default insert_position method returns num_children and can be overridden by a specific composite widget’s resource list or by the argument list provided when the composite widget is created.