getWvalues             package:tkWidgets             R Documentation

_O_b_t_a_i_n_i_n_g _v_a_l_u_e_s _o_f _w_i_d_g_e_t_s _o_n _a _g_i_v_e_n _w_i_d_g_e_t

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

     This function returns a list containing the values for widgets on
     a widget created by function widgetRender. It takes a list
     defining the widget and returns a named list containing the values
     for each of the widgets.

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

     getWvalues(W)

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

       W: 'W' a list of lists defining the widgets that are used to
          make a widget

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

     For a widget containing 3 widgets each with some associated
     functionalities, the list is defined as this:

     pW1 <- list(Name="AAA", Value="bbb", toText=function(x)
     paste(x,collapse= ","), fromText=NULL, canEdit=TRUE, buttonFun =
     fileBrowser, buttonText = "Browse")

     pW2 <- list(Name="BBB", Value="x,y,z", toText=function(x) paste(x,
     collapse=","), fromText=NULL, canEdit=TRUE, buttonFun = ls,
     buttonText = "List")

     pW3 <- list(Name="CCC", Value="ccc", toText=function(x) paste(x,
     collapse = ","), fromText=NULL, canEdit=TRUE, buttonFun=NULL, 
     buttonText=NULL)

     widget1 <- list(wList = list(a = pW1, b = pW2, c = pW3), preFun  =
     function() "Hi", postFun = function() "Bye")

     widget1 will be used to create a widget with 3 entry boxes. When
     users modify the values through the widget created, new values
     will be kept in the list and widget1 will be returned up exist.
     getWvalues is useful to capture the values for each widgets on the
     widget.

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

     This function returns a list of:

  comp1 : Description of `comp1'

  comp2 : Description of `comp2'

_N_o_t_e:

     This function is part of the Bioconductor project at Dana-Farber
     Cancer Institute to provide Bioinformatics funcitonalities through
     R

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

     Jianhua Zhang

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

     'widgetRender'

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

     # Define the widgets
       pW1 <- list(Name="AAA", Value="bbb",
                 toText=function(x) paste(x,collapse= ","), fromText=NULL,
                 canEdit=TRUE,
                 buttonFun = fileBrowser, buttonText = "Browse")

       pW2 <- list(Name="BBB", Value="x,y,z",
                 toText=function(x) paste(x, collapse=","), fromText=NULL,
                 canEdit=TRUE, buttonFun = ls, buttonText = "List")

       pW3 <- list(Name="CCC", Value="ccc",
                 toText=function(x) paste(x, collapse = ","), fromText=NULL,
                 canEdit=TRUE, buttonFun=NULL,  buttonText=NULL)

       widget1 <- list(wList = list(a = pW1, b = pW2, c = pW3),
                     preFun  = function() "Hi",
                     postFun = function() "Bye")

       if(interactive()){
           tt <- widgetRender(widget1, "try")
           getWvalues(tt)
       }else{
           getWvalues(widget1)
       }

