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/ptgetresource.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/ptgetresource.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/ptgetresource.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/ptgetresource.html on line 8
Retrieve one resource value for a widget
#define PtGetResource( widget, type, value, len ) …
- 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.
ph
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:
- Get the resource.
- Copy the resource to a temporary variable.
- Modify the temporary variable.
- Using the modified copy, set the resource.
|
- 0
- Success.
- -1
- An error occurred.
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" );
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PtArg_t,
Pt_ARG(),
PtGetResources(),
PtSetArg(),
PtSetResource(),
PtSetResources()
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/ptgetresource.html on line 181
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/ptgetresource.html on line 181