Determine whether a widget belongs to a specified class
int PtWidgetIsClassMember( PtWidget_t *widget, PtWidgetClassRef_t *class );
This function determines whether or not the specified widget is a member of the specified widget class. You can use this function to determine whether the widget is of the specified class or a subclass of the specified class.
Test to see if widget belongs to the PtGraphic class (i.e. is it a line, rectangle, polygon, etc.):
if( PtWidgetIsClassMember( widget, PtGraphic ) ) printf( "PtGraphic-class widget\n" ); else printf( "non-PtGraphic-class widget\n" );
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |