Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtVaCreateA(3x) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtVaSetValues(1)

 

NAME

XtVaCreateArgsList − create a varargs list for use with the XtVaNestedList symbol. 

Synopsis

XtVarArgsList XtVaCreateArgsList(unused, ..., NULL)

      XtPointer unused;

Inputs

unusedThis argument is not currently used and must be specified as NULL. 

..., NULLA 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 = XtCreateVarArgsList(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 Also

XtVaSetValues(1). 

Copyright O’Reilly & Assoc.  —  X Toolkit Intrinsics Reference Manual © O’Reilly & Associates

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026