Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
PtGetResource()
Retrieve one resource value for a widget
Synopsis:
#define PtGetResource( widget, type, value, len ) ...
Arguments:
- widget
- A pointer to the widget whose resource you want to set.
- type
- The resource manifest (e.g. Pt_ARG_COLOR).
- value
- The address of a pointer to the appropriate data type (see the "New resources" tables in the Photon Widget Reference).
- len
- Depends on the resource type.
Library:
ph
Description:
This macro sets a pointer to a resource value within the specified widget.
PtGetResource() doesn't support the nonpointer method of getting resources. For information on getting and setting resources, see the Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.
![]() |
Because PtGetResource() returns a pointer directly into the
internals of the widget, don't modify the resource value
directly. If you wish to retrieve the value of a given resource and
then modify that value:
|
Returns:
- 0
- Success.
- -1
- An error occurred.
Examples:
Determine whether or not a widget is highlighted:
unsigned long *flags;
PtWidget_t *widget;
PtGetResource( widget, Pt_ARG_FLAGS, &flags, 0 );
printf( "Highlighted: %s\n",
*flags & Pt_HIGHLIGHTED ? "Yes":"No" );
Classification:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
See also:
PtArg_t, Pt_ARG(), PtGetResources(), PtSetArg(), PtSetResource(), PtSetResources()
Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
