Return the widget's instance name string
#include <Ap.h> char * ApInstanceName( PtWidget_t *widget );
Ap
ApInstanceName() returns a widget's instance string name if it's defined. The string name is the name given to the widget in the Widget Instance Name field of the Control Panel. By default, string names are not saved with the widget, in order to save memory.
To embed string names in the widget, you must enable this feature:
The widget's instance name string, or NULL if the widget doesn't have string name data attached.
my_callback( PtWidget_t *widget, ... ) { if ( strcmp( ApInstanceName( widget ), "done_button" ) == 0 ) { /* done button processing */ } }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
“Including instance names” in the Working with Applications chapter of the Photon Programmer's Guide