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


Indicate the widgets likely to be encountered in a widget database


#include <Ap.h>

int ApAddClass( 
        char const * class_name_string,
        PtWidgetClassRef_t * const *wgt_class);


This function lets you indicate which widget classes you're likely to encounter when you call ApOpenDBaseFile(). The class_name_string is the name of the class (for example, "PtButton"). The wgt_class is a predefined widget class; specify the name of the class preceded by an ampersand (for example, &PtButton).

When you link your application, only those widgets it needs are linked into it. If you access widgets that aren't in your application because they're in an external database, you must add them to your internal class table so that they can be linked in at compile time.

Any widgets used when you build a PhAB application are automatically included in the internal class table (see the generated abmain.c file). When you use widgets from an external database, PhAB doesn't know which widgets you need to access, so you'll have to use this function to include them.

Note: This function keeps a pointer to the string pointed to by class_name_string; don't modify this string after calling ApAddClass().


Failure-there isn't enough memory to add the widget class


base_setup ( ... )

    ApAddClass ("RtProgress", &RtProgress);
    return (Pt_CONTINUE);



Interrupt handler No
Signal handler No
Thread No

See also:


Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide

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