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

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.


Caution: 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:
  1. Get the resource.
  2. Copy the resource to a temporary variable.
  3. Modify the temporary variable.
  4. Using the modified copy, set the resource.

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.


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