XtVaCreateArgsList(3) XT FUNCTIONS XtVaCreateArgsList(3)NAME
XtVaCreateArgsList - dynamically allocate a varargs list
SYNTAX
XtVarArgsList XtVaCreateArgsList(XtPointer unused, ...);
ARGUMENTS
unused Must be specified as NULL.
... Specifies a variable parameter list of resource name and value pairs.
DESCRIPTION
The XtVaCreateArgsList function allocates memory and copies its arguments into a single list pointer, which may be used with XtVaNest-
edList. The end of both lists is identified by a name entry containing NULL. Any entries of type XtVaTypedArg are copied as specified
without applying conversions. Data passed by reference (including Strings) are not copied, only the pointers themselves; the caller must
ensure that the data remain valid for the lifetime of the created varargs list. The list should be freed using XtFree when no longer
needed.
SEE ALSO
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
X Version 11 libXt 1.1.3 XtVaCreateArgsList(3)
Check Out this Related Man Page
XtVaCreateArgsList() XtVaCreateArgsList()
Name
XtVaCreateArgsList - create a varargs list for use with the XtVaNestedList symbol.
Synopsis
XtVarArgsList XtVaCreateArgsList(unused, ..., NULL)
XtPointer unused;
Inputs
unused This argument is not currently used and must be specified as NULL.
..., NULL A NULL-terminated variable-length list of resource name/value pairs.
Returns
An XtVarArgsList which can be used in future calls to other XtVa functions.
Availability
Release 4 and later.
Description
XtVaCreateArgsList() allocates, copies its arguments into, and returns a pointer to a structure that can be used in future calls to XtVa
functions using the special symbol XtVaNestedList. When this symbol appears in place of a resource name in a variable-length argument
list, the next value is interpreted not as a resource value itself, but as a nested argument list of resource name/resource value pairs.
When an XtVarArgsList is created, any entries in the list of type XtVaTypedArg are copied as specified without applying conversions; they
will be converted when the list is actually used. Pointer types (including strings) passed to XtVaCreateArgsList() are not copied; the
caller must ensure that the data remains valid for the lifetime of the created XtVarArgsList.
When no longer needed, the returned list should be freed using XtFree().
See XtVaSetValues() for full details on the use of variable length argument lists.
Usage
Nested lists can be useful with the XtVa functions in the same circumstances that statically initialized ArgLists are useful to the non-
XtVa functions: when there are a set of resources that will be applied to more than one widget. The example below presents one such case.
Example
You might want to use nested argument lists to define a set of related resources that will be applied to multiple widgets:
XFontStruct *normal_font, *bold_font;
XtVarArgsList caution_resources;
Widget box, commit, abort;
caution_resources = XtVaCreateArgsList(NULL,
XtNFont, bold_font,
XtVaTypedArg, XtNforeground, XtRString, "red", 4,
XtNborderWidth, 4,
NULL);
commit = XtVaCreateWidget("commit", buttonWidgetClass, box,
XtNlabel, "Commit All Changes",
XtVaNestedList, caution_resources,
NULL);
abort = XtVaCreateWidget("abort", buttonWidgetClass, box,
XtNlabel, "Abort Transaction",
XtVaNestedList, caution_resources,
NULL);
/* free the list since I'm not going to use it again */
XtFree(caution_resources);
Structures
The XtVarArgsList type is defined as follows:
typedef XtPointer XtVarArgsList;
See AlsoXtVaSetValues(1).
Xt - Resource Management XtVaCreateArgsList()