13.2 Using ScrolledLists
Most applications use List widgets in conjunction with ScrolledWindows. By creating a List widget as the child of a
ScrolledWindow, we create what Motif calls a ScrolledList. The ScrolledList is not a widget, but a compound object.
While this chapter describes most of the common resources and functions that deal with ScrolledLists, more detailed
information about ScrolledWindows and ScrollBars can be found in Chapter 9, ScrolledWindows and ScrollBars.
A ScrolledList is built from two widget classes, so we could create and manage the widgets separately using two calls
to XtVaCreateManagedWidget(). However, since ScrolledLists are used so frequently, Motif provides a
convenience function to create this compound object. XmCreateScrolledList() takes the following form:
Widget
XmCreateScrolledList(parent, name, arglist, argcount)
Widget parent;
char *name;
ArgList arglist;
Cardinal argcount;
The arglist parameter is an array of size argcount that contains resources to be passed to both the
ScrolledWindow widget and the List widget. Generally, the two widgets use different resources that are specific to the
widgets themselves, so there isn't any confusion about which resources apply to which widget. However, common
resources, such as Core resources, are interpreted by both widgets, so caution is advised. If you want to set some
resources on one widget, while ensuring that the values are not set on the other widget, you should avoid passing the
values to the convenience ...