ApName()

Return a PhAB name value for the specified widget

Synopsis:

#include <Ap.h>

int ApName( PtWidget_t *widget );

Arguments:

widget
A pointer to the widget whose PhAB name you want to get.

Library:

Ap

Description:

ApName() returns a PhAB name value for the specified widget. You can compare this name value with the global name values that PhAB generates for your application code. These name values make it easier to access and compare widgets in callback functions. It also lets you use the same callback function for more than one widget.

Returns:

A PhAB name value, or -1 if the widget doesn't have a name.

Examples:

my_callback( PtWidget_t *widget, ... )
{
    if ( ApName( widget ) == ABN_widget1 ) {
        /* do widget1 processing */
    } else {
        if ( ApName( widget ) == ABN_widget2 ) {
            /* do widget2 processing */
        } else {
            /* do something else? */
        }
    }
}

Note: ABN_widget1 and ABN_widget2 are name values generated by PhAB for widgets in your application with instance names of widget1 and widget2.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

Variables and manifests in the Working With Code chapter of the Photon Programmer's Guide