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

ApCopyWidget()

Copy a widget from a PhAB widget database

Synopsis:

#include <Ap.h>

int ApCopyWidget( ApDBase_t const *from_dbase,
                  char const *from_name,
                  ApDBase_t *to_dbase,
                  char const *to_name );

Description:

ApCopyWidget() copies a widget from one PhAB widget database to another. The from_name parameter indicates which widget to copy from the database, and to_name lets you rename the copy. Only one widget can be copied at a time. If you copy a container-class widget, only the container widget is copied, not its children.

Returns:

0
Success.
-1
Failure.

Examples:

ApDBase_t *from_dbase, *to_dbase;

from_dbase = ApOpenDBaseFile( "/home/me/mydbase.wgtp" );
to_dbase   = ApOpenDBaseFile( "/home/joe/his_dbase.wgtp" );
ApCopyWidget( from_dbase, "my_icon", to_dbase, "his_icon" );
ApSaveDBaseFile( to_dbase, "/home/joe/his_dbase.wgtp" );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApOpenDBase(), ApOpenDBaseFile(), ApSaveDBaseFile()


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