Find the record associated with a resource
PtResourceRec_t const * PtFindResourceRecord( long type, PtWidgetClass_t const *a_class );
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.
A pointer to a resource record, or NULL if an error occurred.
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 ); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |