Wildcard Specifications@No@Yes@No User Customization@No@Yes@No Dynamic Updating@Yes@No@Yes
_
27.4 Using Lists Effectively
Lists are a powerful feature of UIL because they give you an alternative to specifying widget children, callbacks, and
arguments directly in a widget definition. Lists also let you specify multiple procedures for a specific callback
resource. The ability to include lists in other lists makes them even more useful, as we'll show you in this section.
27.4.1 Specifying Common Resources
We talked about reusing interface components and callbacks earlier. By using lists, you can take this technique one
step further to the level of widget children, resources, and callbacks. You can reduce the size of your modules by
using lists to factor out common sets of resources. This technique is particularly useful for dealing with Form resource
settings, as this fragment illustrates:
list attachments : arguments {
XmNleftAttachment = XmATTACH_FORM;
XmNleftOffset = 3;
XmNrightAttachment = XmATTACH_FORM;
XmNrightOffset = 3;
};
The attachments list defines some attachments that we can apply to a group of widgets in a Form, as shown in the
following definitions:
object name : XmTextField {
arguments {
arguments attach_args;
XmNtopAttachment = XmATTACH_FORM;
};
};
object phone : XmTextField {
arguments {
arguments attach_args;
XmNtopAttachment = XmATTACH_WIDGET;
XmNtopWidget = name;
XmNbottomAttachment = XmATTACH_FORM;
};
Each TextField definition includes its own attachments and the list, ...