Determine the widget that initiated a link callback
#include <Ap.h> PtWidget_t *ApWidget( PtCallbackInfo_t *cbinfo );
ApWidget() is used within module setup functions to determine the widget that initiated the link callback.
A pointer to the initiating widget.
mysetup_function( ..., PtCallbackInfo_t cbinfo ) { if (ApName(ApWidget(cbinfo)) == ABN_widget1) { /* setup based on widget1 */ } else { if (ApName(ApWidget(cbinfo)) == ABN_widget2) { /* setup based on widget2 */ } else { /* common setup */ } } return( Pt_CONTINUE ); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
For another method of determining the widget that initiated a link callback, see the ApInfo_t structure.