home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xtdestroywidget.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  8.4 KB  |  265 lines

  1.  
  2.  
  3.  
  4. XtCreateWidget(3Xt)       XT FUNCTIONS          XtCreateWidget(3Xt)
  5.  
  6.  
  7. NNAAMMEE
  8.        XtCreateWidget, XtVaCreateWidget, XtCreateManagedWidget,
  9.        XtVaCreateManagedWidget, XtDestroyWidget - create and
  10.        destroy widgets
  11.  
  12. SSYYNNTTAAXX
  13.        Widget XtCreateWidget(_n_a_m_e, _w_i_d_g_e_t___c_l_a_s_s, _p_a_r_e_n_t, _a_r_g_s,
  14.        _n_u_m___a_r_g_s)
  15.          String _n_a_m_e;
  16.          WidgetClass _w_i_d_g_e_t___c_l_a_s_s;
  17.          Widget _p_a_r_e_n_t;
  18.          ArgList _a_r_g_s;
  19.          Cardinal _n_u_m___a_r_g_s;
  20.  
  21.        Widget XtVaCreateWidget(_n_a_m_e, _w_i_d_g_e_t___c_l_a_s_s, _p_a_r_e_n_t, ...)
  22.          String _n_a_m_e;
  23.          WidgetClass _w_i_d_g_e_t___c_l_a_s_s;
  24.          Widget _p_a_r_e_n_t;
  25.  
  26.        Widget XtCreateManagedWidget(_n_a_m_e, _w_i_d_g_e_t___c_l_a_s_s, _p_a_r_e_n_t,
  27.        _a_r_g_s, _n_u_m___a_r_g_s)
  28.          String _n_a_m_e;
  29.          WidgetClass _w_i_d_g_e_t___c_l_a_s_s;
  30.          Widget _p_a_r_e_n_t;
  31.          ArgList _a_r_g_s;
  32.          Cardinal _n_u_m___a_r_g_s;
  33.  
  34.        Widget XtVaCreateManagedWidget(_n_a_m_e, _w_i_d_g_e_t___c_l_a_s_s, _p_a_r_e_n_t,
  35.        ...)
  36.          String _n_a_m_e;
  37.          WidgetClass _w_i_d_g_e_t___c_l_a_s_s;
  38.          Widget _p_a_r_e_n_t;
  39.  
  40.        void XtDestroyWidget(_w)
  41.          Widget _w;
  42.  
  43. AARRGGUUMMEENNTTSS
  44.        _a_r_g_s     Specifies the argument list to override the
  45.          resource defaults.
  46.  
  47.        _n_a_m_e     Specifies the resource name for the created wid-
  48.          get, which is used for retrieving resources and,
  49.          for that reason, should not be the same as any
  50.          other widget that is a child of same parent.
  51.  
  52.        _n_u_m___a_r_g_s     Specifies the number of arguments in the argu-
  53.          ment list.
  54.  
  55.        _p_a_r_e_n_t     Specifies the parent widget.
  56.  
  57.        _w     Specifies the widget.
  58.  
  59.        _w_i_d_g_e_t___c_l_a_s_s
  60.          Specifies the widget class pointer for the
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XtCreateWidget(3Xt)       XT FUNCTIONS          XtCreateWidget(3Xt)
  71.  
  72.  
  73.          created widget.
  74.  
  75.        _._._.     Specifies the variable argument list to override
  76.          the resource defaults.
  77.  
  78. DDEESSCCRRIIPPTTIIOONN
  79.        The _X_t_C_r_e_a_t_e_W_i_d_g_e_t function performs much of the boiler-
  80.        plate operations of widget creation:
  81.  
  82.        +o    Checks to see if the class_initialize procedure has
  83.         been called for this class and for all superclasses
  84.         and, if not, calls those necessary in a superclass-
  85.         to-subclass order.
  86.  
  87.        +o    Allocates memory for the widget instance.
  88.  
  89.        +o    If the parent is a subclass of _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s,
  90.         it allocates memory for the parent's constraints and
  91.         stores the address of this memory into the con-
  92.         straints field.
  93.  
  94.        +o    Initializes the core nonresource data fields (for
  95.         example, parent and visible).
  96.  
  97.        +o    Initializes the resource fields (for example, back-
  98.         ground_pixel) by using the resource lists specified
  99.         for this class and all superclasses.
  100.  
  101.        +o    If the parent is a subclass of _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s,
  102.         it initializes the resource fields of the constraints
  103.         record by using the constraint resource list speci-
  104.         fied for the parent's class and all superclasses up
  105.         to _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s.
  106.  
  107.        +o    Calls the initialize procedures for the widget by
  108.         starting at the _C_o_r_e initialize procedure on down to
  109.         the widget's initialize procedure.
  110.  
  111.        +o    If the parent is a subclass of _c_o_m_p_o_s_i_t_e_W_i_d_g_e_t_C_l_a_s_s,
  112.         it puts the widget into its parent's children list by
  113.         calling its parent's insert_child procedure.  For
  114.         further information, see Section 3.5.
  115.  
  116.        +o    If the parent is a subclass of _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s,
  117.         it calls the constraint initialize procedures, start-
  118.         ing at _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s on down to the parent's
  119.         constraint initialize procedure.
  120.  
  121.        Note that you can determine the number of arguments in an
  122.        argument list by using the _X_t_N_u_m_b_e_r macro.  For further
  123.        information, see Section 11.1.
  124.  
  125.        The _X_t_C_r_e_a_t_e_M_a_n_a_g_e_d_W_i_d_g_e_t function is a convenience rou-
  126.        tine that calls _X_t_C_r_e_a_t_e_W_i_d_g_e_t and _X_t_M_a_n_a_g_e_C_h_i_l_d.
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XtCreateWidget(3Xt)       XT FUNCTIONS          XtCreateWidget(3Xt)
  137.  
  138.  
  139.        The _X_t_D_e_s_t_r_o_y_W_i_d_g_e_t function provides the only method of
  140.        destroying a widget, including widgets that need to
  141.        destroy themselves.  It can be called at any time, includ-
  142.        ing from an application callback routine of the widget
  143.        being destroyed.     This requires a two-phase destroy pro-
  144.        cess in order to avoid dangling references to destroyed
  145.        widgets.
  146.  
  147.        In phase one, _X_t_D_e_s_t_r_o_y_W_i_d_g_e_t performs the following:
  148.  
  149.        +o    If the being_destroyed field of the widget is _T_r_u_e,
  150.         it returns immediately.
  151.  
  152.        +o    Recursively descends the widget tree and sets the
  153.         being_destroyed field to _T_r_u_e for the widget and all
  154.         children.
  155.  
  156.        +o    Adds the widget to a list of widgets (the destroy
  157.         list) that should be destroyed when it is safe to do
  158.         so.
  159.  
  160.        Entries on the destroy list satisfy the invariant that if
  161.        w2 occurs after w1 on the destroy list then w2 is not a
  162.        descendent of w1.  (A descendant refers to both normal and
  163.        pop-up children.)
  164.  
  165.        Phase two occurs when all procedures that should execute
  166.        as a result of the current event have been called (includ-
  167.        ing all procedures registered with the event and transla-
  168.        tion managers), that is, when the current invocation of
  169.        _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t is about to return or immediately if not
  170.        in _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.
  171.  
  172.        In phase two, _X_t_D_e_s_t_r_o_y_W_i_d_g_e_t performs the following on
  173.        each entry in the destroy list:
  174.  
  175.        +o    Calls the destroy callback procedures registered on
  176.         the widget (and all descendants) in post-order (it
  177.         calls children callbacks before parent callbacks).
  178.  
  179.        +o    If the widget's parent is a subclass of _c_o_m_p_o_s_i_t_e_W_i_d_-
  180.         _g_e_t_C_l_a_s_s and if the parent is not being destroyed, it
  181.         calls _X_t_U_n_m_a_n_a_g_e_C_h_i_l_d on the widget and then calls
  182.         the widget's parent's delete_child procedure (see
  183.         Section 3.4).
  184.  
  185.        +o    If the widget's parent is a subclass of
  186.         _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s, it calls the constraint
  187.         destroy procedure for the parent, then the parent's
  188.         superclass, until finally it calls the constraint
  189.         destroy procedure for _c_o_n_s_t_r_a_i_n_t_W_i_d_g_e_t_C_l_a_s_s.
  190.  
  191.        +o    Calls the destroy methods for the widget (and all
  192.         descendants) in post-order.     For each such widget, it
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. XtCreateWidget(3Xt)       XT FUNCTIONS          XtCreateWidget(3Xt)
  203.  
  204.  
  205.         calls the destroy procedure declared in the widget
  206.         class, then the destroy procedure declared in its
  207.         superclass, until finally it calls the destroy proce-
  208.         dure declared in the Core class record.
  209.  
  210.        +o    Calls _X_D_e_s_t_r_o_y_W_i_n_d_o_w if the widget is realized (that
  211.         is, has an X window).  The server recursively
  212.         destroys all descendant windows.
  213.  
  214.        +o    Recursively descends the tree and deallocates all
  215.         pop-up widgets, constraint records, callback lists
  216.         and, if the widget is a subclass of
  217.         _c_o_m_p_o_s_i_t_e_W_i_d_g_e_t_C_l_a_s_s, children.
  218.  
  219. SSEEEE AALLSSOO
  220.        XtAppCreateShell(3Xt), XtCreatePopupShell(3Xt)
  221.        _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
  222.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.