listSelect             package:tkWidgets             R Documentation

_U_t_i_l_i_t_i_e_s _C_r_e_a_t_i_n_g _a _W_i_d_g_e_t _W_i_t_h _S_e_l_e_c_t_i_o_n _B_o_x_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions create a widget with selection boxes allowing
     users to view and make selections of items shown on the interface.

_U_s_a_g_e:

     listSelect(aList, topLbl = "Select Elements From The Following List",
                typeFun = stdType, valueFun = stdView)
     writeSelBox(baseW, aList, typeFun = NULL, valueFun = NULL)
        writeBut(baseW, butList, butWidth = 6)
     writeLabel(baseW, typeFun, valueFun)

_A_r_g_u_m_e_n_t_s:

   aList: list with names and object pairs (e. g. 'a = "AAA"').

  topLbl: character string for the text to be shown as a title.

 typeFun: function that takes an R object as an arguement and returns a
          description of the object.

valueFun: function that takes an R object as an argument and shows the
          content of the object.  The function should get the
          representation of the object and calls 'objViewer' to have
          the representation rendered in a widget.

   baseW: a window widget to which the selection boxes will be put.

 butList: a list with names and function pairs that define the name and
          behavior of buttons to be put on the widget to be generated

butWidth: numerical value specifying the width of buttons to be
          created.

_D_e_t_a_i_l_s:

     Both 'typeFun' and 'valueFun' have to take an argument (the R
     object to be shown).  It works well for the 'valueFun' function to
     call 'objViewer()' with whatever to be shown passed to 'objViewer'
     as an argument.

_V_a_l_u_e:

     'listSelect()' returns a list with the names of the R objects in
     the original list associated with 'TRUE' (selected) or 'FALSE'
     (deselected).

_A_u_t_h_o_r(_s):

     Jianhua Zhang

_S_e_e _A_l_s_o:

     'objViewer'

_E_x_a_m_p_l_e_s:

     aList <- list(a = "AAA", b = c(123, 456, 789),
                   c = as.data.frame(matrix(1:10, ncol = 2)),
                   d = stdType)
     # Since user interference is required, the example code does not run
     # automatically
     if(interactive())
       listSelect(aList)

