unroff-website/www/examples/XtSetArg.3.html

127 lines
4.1 KiB
HTML

<html>
<head>
<!-- This file has been generated by unroff 1.0, 03/21/96 19:25:31. -->
<!-- Do not edit! -->
<link rev="made" href="mailto:net@informatik.uni-bremen.de">
<!-- Copyright 1993 X Consortium -->
<!-- Permission is hereby granted, free of charge, to any person obtaining -->
<!-- a copy of this software and associated documentation files (the -->
<!-- "Software"), to deal in the Software without restriction, including -->
<!-- without limitation the rights to use, copy, modify, merge, publish, -->
<!-- distribute, sublicense, and/or sell copies of the Software, and to -->
<!-- permit persons to whom the Software is furnished to do so, subject to -->
<!-- the following conditions: -->
<!-- The above copyright notice and this permission notice shall be -->
<!-- included in all copies or substantial portions of the Software. -->
<!-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -->
<!-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!-- IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!-- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!-- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!-- OTHER DEALINGS IN THE SOFTWARE. -->
<!-- Except as contained in this notice, the name of the X Consortium shall -->
<!-- not be used in advertising or otherwise to promote the sale, use or -->
<!-- other dealings in this Software without prior written authorization -->
<!-- from the X Consortium. -->
<!-- send an index entry to the stderr -->
<!-- Note End -- doug kraft 3/85 -->
<title>Manual page for XtSetArg(3Xt)</title>
</head>
<body>
<h2>
XtSetArg, XtMergeArgLists - set and merge ArgLists
<hr></h2>
<h2>SYNTAX</h2>
XtSetArg(<i>arg</i>, <i>name</i>, <i>value</i>)
<br>
Arg <i>arg</i>;
<br>
String <i>name</i>;
<br>
XtArgVal <i>value</i>;
<p>
ArgList XtMergeArgLists(<i>args1</i>, <i>num_args1</i>, <i>args2</i>, <i>num_args2</i>)
<br>
ArgList <i>args1</i>;
<br>
Cardinal <i>num_args1</i>;
<br>
ArgList <i>args2</i>;
<br>
Cardinal <i>num_args2</i>;
<h2>ARGUMENTS</h2>
<dl>
<dt><i>arg</i><dd>
Specifies the name-value pair to set.<tt> </tt>
<dt><i>args1</i><dd>
Specifies the first
<b>ArgList</b>.<tt> </tt>
<dt><i>args2</i><dd>
Specifies the second
<b>ArgList</b>.<tt> </tt>
<dt><i>num_args1</i><dd>
Specifies the number of arguments in the first argument list.<tt> </tt>
<dt><i>num_args2</i><dd>
Specifies the number of arguments in the second argument list.<tt> </tt>
<dt><i>name</i><dd>
Specifies the name of the resource.<tt> </tt>
<dt><i>value</i><dd>
Specifies the value of the resource if it will fit in an
<b>XtArgVal</b>
or the address.<tt> </tt>
</dl>
<h2>DESCRIPTION</h2>
The
<b>XtSetArg</b>
function is usually used in a highly stylized manner to
minimize the probability of making a mistake; for example:
<p>
<pre>
Arg args[20];
int n;
n = 0;
XtSetArg(args[n], XtNheight, 100); n++;
XtSetArg(args[n], XtNwidth, 200); n++;
XtSetValues(widget, args, n);
</pre>
<p>
Alternatively, an application can statically declare the argument list
and use
<b>XtNumber</b>:
<p>
<pre>
static Args args[] = {
{XtNheight, (XtArgVal) 100},
{XtNwidth, (XtArgVal) 200},
};
XtSetValues(Widget, args, XtNumber(args));
</pre>
<p>
Note that you should not use auto-increment or auto-decrement
within the first argument to
<b>XtSetArg</b>.<tt> </tt>
<b>XtSetArg</b>
can be implemented as a macro that dereferences the first argument twice.<tt> </tt>
<p>
The
<b>XtMergeArgLists</b>
function allocates enough storage to hold the combined
<b>ArgList</b>
structures and copies them into it.<tt> </tt>
Note that it does not check for duplicate entries.<tt> </tt>
When it is no longer needed,
free the returned storage by using
<b>XtFree</b>.<tt> </tt>
<h2>SEE ALSO</h2>
XtOffset(3Xt)
<br>
<i>X Toolkit Intrinsics - C Language Interface</i>
<br>
<i>Xlib - C Language X Interface</i>
<p><hr>
Markup created by <em>unroff</em> 1.0,&#160;<tt> </tt>&#160;<tt> </tt>March 21, 1996.
</body>
</html>