PtDestroyWidget
![]() |
![]() |
![]() |
![]() |
PtDestroyWidget()
Remove a widget from the widget family hierarchy
Synopsis:
int PtDestroyWidget( PtWidget_t *widget );
Library:
ph
Description:
This function performs the following on the specified widget:
- unrealizes it, if necessary
- destroys its children
- removes it from the widget family hierarchy
- flags it for destruction by adding it to the destroyed list.
The widget's resources aren't freed until the return of PtEventHandler().
![]() |
You might get callbacks from the widget after PtDestroyWidget() has
returned.
To determine if this is happening, check the widget's
Pt_DESTROYED flag.
For example:
if (PtWidgetFlags(widget) & Pt_DESTROYED)
{
return( Pt_CONTINUE );
}
|
Returns:
- 0
- Success.
- -1
- An error occurred.
Examples:
See PtContainerBox().
Classification:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
See also:
PtEventHandler(), PtCreateWidget(), PtRealizeWidget(), PtUnrealizeWidget(), PtWidgetFlags()
Pt_ARG_FLAGS, Pt_CB_DESTROYED, Pt_CB_IS_DESTROYED resources of PtWidget in the Widget Reference
“Widget life cycle” in the Introduction to the Photon Programmer's Guide
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)

