Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xmgetsecondaryresourcedata(3x) [osf1 man page]

XmGetSecondaryResourceData(3X)											    XmGetSecondaryResourceData(3X)

NAME
XmGetSecondaryResourceData - A function that provides access to secondary widget resource data SYNOPSIS
#include <Xm/Xm.h> Cardinal XmGetSecondaryResourceData (widget_class, secondary_data_return) WidgetClass widget_class; XmSecondaryResourceData **secondary_data_return; DESCRIPTION
Some Motif widget classes (such as Gadget, Text, and VendorShell) have resources that are not accessible via the functions XtGetRe- sourceList and XtGetConstraintResourceList. To retrieve the descriptions of these resources, an application must use XmGetSecondaryRe- sourceData. When a widget class has such resources, this function provides descriptions of the resources in one or more data structures. XmGetSec- ondaryResourceData 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, 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 secondary_data_return argument. The type XmSecondaryResourceData is a pointer to a structure with two members that are useful to an application: resources, of type XtRe- sourceList, and num_resources, of type Cardinal. The resources member is a list of the widget resources that are not accessible using Xt functions. The num_resources member is the length of the resources list. If the return value is greater than 0, XmGetSecondaryResourceData allocates memory that the application must free. Use XtFree to free the resource list in each structure (the value of the resources mem- ber), the structures themselves, and the array of pointers to the structures (the array with address secondary_data_return). Specifies the widget class for which secondary resource data is to be retrieved. Specifies a pointer to an array of XmSecondaryResourceData pointers to be returned by this function. If the widget class has no secondary resource data (i.e., if the value returned by the function is 0), the function returns no meaningful value for this argument. RETURN VALUES
Returns the number of secondary resource data structures associated with this widget class. EXAMPLES
The following example prints the names of the secondary resources of the Text widget and then frees the data allocated by the function: XmSecondaryResourceData * 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 ", block_array[i]->resources[j].resource_name); } XtFree((char*)block_array[i]->resources); XtFree((char*)block_array[i]); } XtFree((char*)block_array); } XmGetSecondaryResourceData(3X)

Check Out this Related Man Page

XtGetResourceList(3)						   XT FUNCTIONS 					      XtGetResourceList(3)

NAME
XtGetResourceList, XtGetConstraintResourceList - obtain resource list SYNTAX
void XtGetResourceList(WidgetClass class, XtResourceList *resources_return, Cardinal *num_resources_return); void XtGetConstraintResourceList(WidgetClass class, XtResourceList *resources_return, Cardinal *num_resources_return); ARGUMENTS
num_resources_return Specifies a pointer to where to store the number of entries in the resource list. resources_return Specifies a pointer to where to store the returned resource list. The caller must free this storage using XtFree when done with it. widget_class Specifies the widget class. DESCRIPTION
If XtGetResourceList is called before the widget class is initialized (that is, before the first widget of that class has been created), XtGetResourceList returns the resource list as specified in the widget class record. If it is called after the widget class has been ini- tialized, XtGetResourceList returns a merged resource list that contains the resources for all superclasses. The list returned by XtGet- ResourceList should be freed using XtFree when it is no longer needed. If XtGetConstraintResourceList is called before the widget class is initialized (that is, before the first widget of that class has been created), XtGetConstraintResourceList returns the resource list as specified in the widget class Constraint part record. If it is called after the widget class has been initialized, XtGetConstraintResourceList returns a merged resource list that contains the Constraint resources for all superclasses. If the specified class is not a subclass of constraintWidgetClass, *resources_return is set to NULL and *num_resources_return is set to zero. The list returned by XtGetConstraintResourceList should be freed using XtFree when it is no longer needed. SEE ALSO
XtGetSubresources(3), XtOffset(3) X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.4 XtGetResourceList(3)
Man Page