[Previous] [Contents] [Index] [Next]

PtFindResourceRecord()

Find the record associated with a resource

Synopsis:

PtResourceRec_t const * PtFindResourceRecord( 
    long type,
    PtWidgetClass_t const *a_class );

Description:

This function finds the resource record for the resource given by type in the a_class class or any of its superclasses. This function may be used in your own Set Resource/Get Resource methods.

Returns:

A pointer to a resource record, or NULL if an error occurred.

Examples:

my_label_setcolor( PtWidget_t *widget, PgColor_t color )
{
  PtResourceRec_t *res_rec;
  PtArg_t argt;
  PtSetArg( &argt, Pt_ARG_COLOR, color, 0 );
  // This should actually check for NULL failure
  res_rec = PtFindResourceRecord( Pt_ARG_COLOR, 
                                  PtLabel->wclass );
  PtSetValue( widget, res_rec, &argt );
}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtSetValue()


[Previous] [Contents] [Index] [Next]