[Previous] [Contents] [Index] [Next]

ApName()

Return a PhAB name value for the specified widget

Synopsis:

#include <Ap.h>

int ApName( PtWidget_t *widget );

Description:

ApName() returns a PhAB name value for the specified widget. This name value can be compared with the global name values 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

[Previous] [Contents] [Index] [Next]