Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetresources.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetresources.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetresources.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetresources.html on line 8

PtSetResources()

Set one or more resources for a widget

Synopsis:

int PtSetResources( PtWidget_t *widget,
                    int n_args,
                    PtArg_t const *args );

Library:

ph

Description:

This function sets resources for the specified widget. The args array indicates which resources to set, and n_args indicates the number of items in the args array. Before calling this function, you must initialize the args array with PtSetArg() or Pt_ARG().


Note: If you're setting only one resource, it's easier to call PtSetResource().

For more information, see the Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.

If the widget has been realized, changing its resources may change how it appears on the screen.

Returns:

0
At least one of the given resources was applied to the widget.
-1
The widget wasn't modified because it doesn't contain the given resources or the values of the resources were the same as those already stored in the widget.

Note: A return code of 0 doesn't necessarily mean that all the resources were successfully set. The only way to be sure that a resource was set is to set it, then get it and compare the values.

Examples:

Turn the widget blue and highlight it:

PtArg_t args[2];
PtWidget_t *widget; 

PtSetArg( &args[0], Pt_ARG_FILL_COLOR, Pg_BLUE, 0 );
PtSetArg( &args[1], Pt_ARG_FLAGS, 
          Pt_HIGHLIGHTED, Pt_HIGHLIGHTED );
PtSetResources( widget, 2, args );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtArg_t, Pt_ARG(), PtGetResource(), PtGetResources(), PtSetArg(), PtSetResource()

Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetresources.html on line 160

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetresources.html on line 160