ApInstanceName()

Return the widget's instance name string

Synopsis:

#include <Ap.h>

char * ApInstanceName( PtWidget_t *widget );

Arguments:

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

Library:

Ap

Description:

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:

  1. In PhAB, select the Startup Info/Modules command from the Application menu.
  2. In the Application Startup Information dialog, click the Store Names for ApInstanceName() button.

Returns:

The widget's instance name string, or NULL if the widget doesn't have string name data attached.

Examples:

my_callback( PtWidget_t *widget, ... )
{

    if ( strcmp( ApInstanceName( widget ),
                 "done_button" ) == 0 ) {
        /* done button processing */
    }

}

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

Including instance names in the Working with Applications chapter of the Photon Programmer's Guide