NAME

XtManageChildren, XtManageChild, XtUnmanageChildren, XtUnmanageChild, XtChangeManagedSet, XtIsManaged - manage and unmanage children

SYNTAX

typedef Widget *WidgetList; void XtManageChildren(WidgetList _c_h_i_l_d_r_e_n, Cardinal _n_u_m___c_h_i_l_d_r_e_n); void XtManageChild(Widget _c_h_i_l_d); void XtUnmanageChildren(WidgetList _c_h_i_l_d_r_e_n, Cardinal _n_u_m___c_h_i_l_d_r_e_n); void XtUnmanageChild(Widget _c_h_i_l_d); void XtChangeManagedSet(WidgetList _u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n, Cardinal _n_u_m___u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n, XtDoChangeProc _d_o___c_h_a_n_g_e___p_r_o_c, XtPointer _c_l_i_e_n_t___d_a_t_a, WidgetList _m_a_n_a_g_e___c_h_i_l_d_r_e_n, Cardinal _n_u_m___m_a_n_a_g_e___c_h_i_l_d_r_e_n); Boolean XtIsManaged(Widget _w_i_d_g_e_t);

ARGUMENTS

_c_h_i_l_d Specifies the child.
_c_h_i_l_d_r_e_n Specifies a list of child widgets.
_n_u_m___c_h_i_l_d_r_e_n Specifies the number of children.
_w_i_d_g_e_t Specifies the widget.
_m_a_n_a_g_e___c_h_i_l_d_r_e_n Specifies the list of widget children to add to the managed set.
_n_u_m___m_a_n_a_g_e___c_h_i_l_d_r_e_n Specifies the number of entries in the manage_children list.
_u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n Specifies the list of widget children to remove from the managed set.
_n_u_m___u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n Specifies the number of entries in the unmanage_children list.
_d_o___c_h_a_n_g_e___p_r_o_c Specifies the post unmanage, pre manage hook procedure to invoke.
_c_l_i_e_n_t___d_a_t_a Specifies the client data to be passed to the hook procedure.

DESCRIPTION

The _X_t_M_a_n_a_g_e_C_h_i_l_d_r_e_n function performs the following:
· Issues an error if the children do not all have the same parent or
if the parent is not a subclass of _c_o_m_p_o_s_i_t_e_W_i_d_g_e_t_C_l_a_s_s.
· Returns immediately if the common parent is being destroyed;
otherwise, for each unique child on the list, _X_t_M_a_n_a_g_e_C_h_i_l_d_r_e_n ignores the child if it already is managed or is being destroyed and marks it if not.
· If the parent is realized and after all children have been marked,
it makes some of the newly managed children viewable:
- Calls the change_managed routine of the widgets' parent.
- Calls
_X_t_R_e_a_l_i_z_e_W_i_d_g_e_t on each previously unmanaged child that is unrealized.
- Maps each previously unmanaged child that has map_when_managed
_T_r_u_e.

Managing children is independent of the ordering of children and independent of creating and deleting children. The layout routine of the parent should consider children whose managed field is _T_r_u_e and should ignore all other children. Note that some composite widgets, especially fixed boxes, call _X_t_M_a_n_a_g_e_C_h_i_l_d from their insert_child procedure.

If the parent widget is realized, its change_managed procedure is called to notify it that its set of managed children has changed. The parent can reposition and resize any of its children. It moves each child as needed by calling _X_t_M_o_v_e_W_i_d_g_e_t, which first updates the x and y fields and then calls _X_M_o_v_e_W_i_n_d_o_w if the widget is realized.

The _X_t_M_a_n_a_g_e_C_h_i_l_d function constructs a _W_i_d_g_e_t_L_i_s_t of length one and calls _X_t_M_a_n_a_g_e_C_h_i_l_d_r_e_n.

The _X_t_U_n_m_a_n_a_g_e_C_h_i_l_d_r_e_n function performs the following:

· Issues an error if the children do not all have the same parent
or if the parent is not a subclass of _c_o_m_p_o_s_i_t_e_W_i_d_g_e_t_C_l_a_s_s.
· Returns immediately if the common parent is being destroyed;
otherwise, for each unique child on the list, _X_t_U_n_m_a_n_a_g_e_C_h_i_l_d_r_e_n performs the following:
- Ignores the child if it already is unmanaged or is being destroyed
and marks it if not.
- If the child is realized,
it makes it nonvisible by unmapping it.
· Calls the change_managed routine of the widgets' parent
after all children have been marked if the parent is realized.

_X_t_U_n_m_a_n_a_g_e_C_h_i_l_d_r_e_n does not destroy the children widgets. Removing widgets from a parent's managed set is often a temporary banishment, and, some time later, you may manage the children again.

The _X_t_U_n_m_a_n_a_g_e_C_h_i_l_d function constructs a widget list of length one and calls _X_t_U_n_m_a_n_a_g_e_C_h_i_l_d_r_e_n.

The _X_t_C_h_a_n_g_e_M_a_n_a_g_e_d_S_e_t function performs the following:

· Issues an error if the widgets specified in the _m_a_n_a_g_e___c_h_i_l_d_r_e_n
and the _u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n lists to no all have the same parent, or if that parent is not a subclass of compositeWidgetClass.
· Returns immediately if the common parent is being destroyed.
· If no
_C_o_m_p_o_s_i_t_e_C_l_a_s_s_E_x_t_e_n_s_i_o_n is defined, or a _C_o_m_p_o_s_i_t_e_C_l_a_s_s_E_x_t_e_n_s_i_o_n is defined but with an _a_l_l_o_w_s___c_h_a_n_g_e___m_a_n_a_g_e_d___s_e_t field with a value of _F_a_l_s_e, and _X_t_C_h_a_n_g_e_M_a_n_a_g_e_d_S_e_t was invoked with a non-NULL _d_o___c_h_a_n_g_e___p_r_o_c procedure then _X_t_C_h_a_n_g_e_M_a_n_a_g_e_d_S_e_t performs the following:
- Calls
_X_t_U_n_m_a_n_a_g_e_C_h_i_l_d_r_e_n (_u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n, _n_u_m___u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n).
- Calls the _d_o___c_h_a_n_g_e___p_r_o_c specified.
- Calls
_X_t_M_a_n_a_g_e_C_h_i_l_d_r_e_n (_m_a_n_a_g_e___c_h_i_l_d_r_e_n, _n_u_m___m_a_n_a_g_e___c_h_i_l_d_r_e_n) and then returns immediately.
· Otherwise, if a
_C_o_m_p_o_s_i_t_e_C_l_a_s_s_E_x_t_e_n_s_i_o_n is defined with an _a_l_l_o_w_s___c_h_a_n_g_e___m_a_n_a_g_e_d___s_e_t field with a value of _T_r_u_e, or if no _C_o_m_p_o_s_i_t_e_C_l_a_s_s_E_x_t_e_n_s_i_o_n is defined, and _X_t_C_h_a_n_g_e_M_a_n_a_g_e_d_S_e_twas _d_o___c_h_a_n_g_e___p_r_o_c procedure, then the following is performed:
- For each child on the _u_n_m_a_n_a_g_e___c_h_i_l_d_r_e_n list; if the child is
already unmanaged or is being destroyed it is ignored, otherwise it is marked as being unmanaged and if it is realized it is made nonvisible by being unmapped.
- If the _d_o___c_h_a_n_g_e___p_r_o_c procedure is non-NULL then
it is invoked as specified.
- For each child on the _m_a_n_a_g_e___c_h_i_l_d_r_e_n list; if the child is
already managed or it is being destroyed it is ignored, otherwise it is marked as managed
· If the parent is realized and after all children have been marked, the
change_managed method of the parent is invoked and subsequently some of the newly managed children are made viewable by:
- Calling
_X_t_R_e_a_l_i_z_e_W_i_d_g_e_t on each of the previously unmanaged child that is unrealized.
- Mapping each previously unmanaged child that has _m_a_p___w_h_e_n___m_a_n_a_g_e_d
_T_r_u_e.

The _X_t_I_s_M_a_n_a_g_e_d function returns _T_r_u_e if the specified widget is of class RectObj or any subclass thereof and is managed, or _F_a_l_s_e otherwise.

SEE ALSO

XtMapWidget(3Xt), XtRealizeWidget(3Xt)
_X _T_o_o_l_k_i_t _I_n_t_r_i_n_s_i_c_s _- _C _L_a_n_g_u_a_g_e _I_n_t_e_r_f_a_c_e
_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e