WName               package:tkWidgets               R Documentation

_A_c_c_e_s_s_o_r_s _f_o_r _P_r_i_m_i_t_i_v_e _W_i_d_g_e_t _O_b_j_e_c_t_s

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

     Currently primitive widget objects ('pwidget's) are implemented as
     'list's, but this will change.  Users should only rely on these
     accessors functions, not the implementation.

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

     WName(x)
     WValue(x)
     WValue(x) <-  value
     WtoText(x)
     WfromText(x)
     WcanEdit(x)
     WbuttonText(x)
     WbuttonFun(x)
     WwList(x)
     WwList <- value
     WLValue(x, index)
     WLValue(x, index) <- value
     WRButtons(x)
     WpreFun(x)
     WpostFun(x)
     WEnd(x)

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

       x: list of lists with a Name, Value, toText, fromText, canEdit,
          buttonText, buttonFun, preFun, postFun element.

   index: integer or character string as an index or name for the list
          in the first list of a list of lists for a widget.

   value: An R data type that is going to be used to update the value.

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

     'WName(x)' returns the 'Name' element of 'x'. 'WValue(x)' returns
     the 'Value' element of 'x'. 'WValue(x) <- value' will change the
     'Value' element of 'x' to 'value'.

     'WtoText(x)' returns the 'toText' element of 'x'. 'WfromText(x)'
     returns the 'fromText' element of 'x'. 'WcanEdit(x)' returns the
     'canEdit' element of 'x'.

     'WbuttonText(x)' returns the 'buttonText' element of 'x'.
     'WbuttonFun(x)' returns the 'buttonFun' element of 'x'.
     'WwList(x)' returns the 'wList' element of 'x'. 'WwList <- value'
     will update the 'wList' element of a Widget list with 'value'.

     'WLValue(x, index)' returns a list indicated by the index in the
     wList of a widget list. 'WLValue(x, index) <- value' will update
     indicated by the index in the wList of a widget list with the
     value.

     'WpreFun(x)' returns the preFun element of 'x'. 'WpostFun(x)'
     returns  the post element of 'x'. 'WEnd(x)' returns  the end
     element of 'x'.

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

     A character string or R function represented by the element of the
     list whose value is to be retrieved.

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

     Jianhua (John) Zhang

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

     'widgetRender' for references etc.

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

     # Create the list of lists
     pW1 <- list(Name="AAA", Value="bbb",
                 toText = function(x) paste(x,collapse = ","),
                 fromText = NULL, canEdit = TRUE,
                 buttonFun = ls, buttonText = "Browse")

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

     # Call the functions
     WName(pW1)
     WValue(pW1)
     WValue(pW1) <- "lll"
     WtoText(pW1)
     WfromText(pW1)
     WcanEdit(pW1)
     WbuttonText(pW1)
     WbuttonFun(pW1)
     WwList(widget1)
     WwList(widget1) <- list(Name = "New list", Value = "New value")
     WLValue(widget1, 1)
     WLValue(widget1, 1) <- "New value"
     WpreFun(widget1)
     WpostFun(widget1)
     WEnd(widget1)

