Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PtSetResource()

Set one resource for a widget

Synopsis:

#define PtSetResource( widget, type, value, len ) ...

Library:

ph

Description:

This function sets a resource for the specified widget. The type argument contains the resource manifest and value contains the value of the argument being passed. The way the len argument is used depends on the resource type.

For information on getting and setting resources, 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
The given resources was applied to the widget.
-1
The widget wasn't modified because it doesn't contain the given resource or the value of the resource was the same as that already stored in the widget.

Examples:

Turn the widget blue:

PtWidget_t *widget; 

PtSetResource( widget, Pt_ARG_FILL_COLOR, Pg_BLUE, 0 );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

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

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