'\" t .\" GetSec.sgm /main/8 1996/09/08 20:46:40 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmGetSecondaryResourceData" 3 .SH "NAME" \fBXmGetSecondaryResourceData\fP \(em A function that provides access to secondary widget resource data "XmGetSecondaryResourceData" .SH "SYNOPSIS" .PP .nf #include \fBCardinal \fBXmGetSecondaryResourceData\fP\fR( \fBWidgetClass \fBwidget_class\fR\fR, \fBXmSecondaryResourceData **\fBsecondary_data_return\fR\fR); .fi .SH "DESCRIPTION" .PP Some Motif widget classes (such as Gadget, Text, and VendorShell) have resources that are not accessible through the functions \fBXtGetResourceList\fP and \fBXtGetConstraintResourceList\fP\&. In order to retrieve the descriptions of these resources, an application must use \fBXmGetSecondaryResourceData\fP\&. .PP When a widget class has such resources, this function provides descriptions of the resources in one or more data structures\&. \fBXmGetSecondaryResourceData\fP takes a widget class argument and returns the number of these data structures associated with the widget class\&. If the return value is greater than 0 (zero), the function allocates and fills an array of pointers to the corresponding data structures\&. It returns this array at the address that is the value of the \fIsecondary_data_return\fP argument\&. .PP The type \fBXmSecondaryResourceData\fR is a pointer to a structure with two members that are useful to an application: \fIresources\fP, of type \fBXtResourceList\fP, and \fBnum_resources\fP, of type \fBCardinal\fR\&. The \fIresources\fP member is a list of the widget resources that are not accessible using Xt functions\&. The \fBnum_resources\fP member is the length of the \fIresources\fP list\&. .PP If the return value is greater than 0 (zero), \fBXmGetSecondaryResourceData\fP allocates memory that the application must free\&. Use \fBXtFree\fP to free the resource list in each structure (the value of the \fIresources\fP member), the structures themselves, and the array of pointers to the structures (the array whose address is \fIsecondary_data_return\fP)\&. .IP "\fIwidget_class\fP" 10 Specifies the widget class for which secondary resource data is to be retrieved\&. .IP "\fIsecondary_data_return\fP" 10 Specifies a pointer to an array of \fBXmSecondaryResourceData\fR pointers to be returned by this function\&. If the widget class has no secondary resource data, for example, if the value returned by the function is 0 (zero), the function returns no meaningful value for this argument\&. .SH "RETURN" .PP Returns the number of secondary resource data structures associated with this widget class\&. .SH "EXAMPLE" .PP The following example uses \fBXmGetSecondaryResourceData\fP to print the names of the secondary resources of the Motif Text widget and then frees the data allocated by the function: .PP .nf \f(CWXmSecondaryResourceData * block_array; Cardinal num_blocks, i, j; if (num_blocks = XmGetSecondaryResourceData (xmTextWidgetClass, &block_array)) { for (i = 0; i < num_blocks; i++) { for (j = 0; j < block_array[i]->num_resources; j++) { printf("%s\en", block_array[i]->resources[j]\&.resource_name); } XtFree((char*)block_array[i]->resources); XtFree((char*)block_array[i]); } XtFree((char*)block_array); }\fR .fi .PP .\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:24