


XmGetSecondaryResourceData(3X)		       XmGetSecondaryResourceData(3X)
OSF/Motif							    OSF/Motif



NAME
  XXmmGGeettSSeeccoonnddaarryyRReessoouurrcceeDDaattaa - A function that provides	access to secondary
  widget resource data

SYNOPSIS

  ##iinncclluuddee <<XXmm//XXmm..hh>>
  CCaarrddiinnaall XXmmGGeettSSeeccoonnddaarryyRReessoouurrcceeDDaattaa ((_w_i_d_g_e_t__c_l_a_s_s,
	  _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n))
       WWiiddggeettCCllaassss	   _w_i_d_g_e_t__c_l_a_s_s;;
       XXmmSSeeccoonnddaarryyRReessoouurrcceeDDaattaa****_s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n;;

DESCRIPTION

  Some Motif widget classes (such as Gadget, Text, and VendorShell) have
  resources that are not accessible via	the functions XXttGGeettRReessoouurrcceeLLiisstt	and
  XXttGGeettCCoonnssttrraaiinnttRReessoouurrcceeLLiisstt.	To retrieve the	descriptions of	these
  resources, an	application must use XXmmGGeettSSeeccoonnddaarryyRReessoouurrcceeDDaattaa.

  When a widget	class has such resources, this function	provides descriptions
  of the resources in one or more data structures.  XXmmGGeettSSeeccoonnddaarryyRReessoouurrccee--
  DDaattaa 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 _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n argument.

  The type XXmmSSeeccoonnddaarryyRReessoouurrcceeDDaattaa is a	pointer	to a structure with two
  members that are useful to an	application: _r_e_s_o_u_r_c_e_s,	of type	XXttRReessoouurrcceeLL--
  iisstt, and _n_u_m__r_e_s_o_u_r_c_e_s, of type CCaarrddiinnaall.  The _r_e_s_o_u_r_c_e_s member is a list
  of the widget	resources that are not accessible using	Xt functions.  The
  _n_u_m__r_e_s_o_u_r_c_e_s	member is the length of	the _r_e_s_o_u_r_c_e_s list.  If	the return
  value	is greater than	0, XXmmGGeettSSeeccoonnddaarryyRReessoouurrcceeDDaattaa allocates	memory that
  the application must free.  Use XXttFFrreeee to free the resource list in each
  structure (the value of the _r_e_s_o_u_r_c_e_s	member), the structures	themselves,
  and the array	of pointers to the structures (the array with address
  _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n).

  _w_i_d_g_e_t__c_l_a_s_s
      Specifies	the widget class for which secondary resource data is to be
      retrieved.

  _s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n
      Specifies	a pointer to an	array of XXmmSSeeccoonnddaarryyRReessoouurrcceeDDaattaa 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\n", block_array[i]->resources[j].resource_name);
	   }
	   XtFree((char*)block_array[i]->resources);
	   XtFree((char*)block_array[i]);
	 }
	 XtFree((char*)block_array);
       }





















































