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

PtReParentWidget()

"Reparent" a widget to a new container

Synopsis:

int PtReParentWidget( PtWidget_t *widget,
                      PtWidget_t *parent );

Description:

This function takes the specified widget from its current parent and gives it to the specified parent. The parent must be a container widget.

Returns:

0
Successful completion.
-1
The widget couldn't be re-parented.

Examples:

PtWidget_t  *label, *window1, *window2;

/* create widget within window1 */
...
label = PtCreateWidget( PtLabel, window1, 5, args );

/* use widget within window1 */
...

/* re-parent label to window2 */
PtReParentWidget( label, window2 );

/* use widget within window2 */
...

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtCreateWidget(), PtFindGuardian(), PtGetParent(), PtValidParent(), PtWidgetParent()

"Ordering widgets" in the Creating Widgets in Application Code chapter of the Photon Programmer's Guide


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