widget-class           package:widgetTools           R Documentation

_C_l_a_s_s "_w_i_d_g_e_t" _c_r_e_a_t_e_s _a _w_i_d_g_e_t _w_i_t_h _p_r_i_m_a_r_y _w_i_d_g_e_t_s _c_o_n_t_a_i_n_e_d _i_n
_t_h_e _l_i_s_t _p_W_i_d_g_e_t_s _r_e_n_d_e_r_e_d

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

     This class takes a list of primary widgets and then creates a
     "widgetView" object that renders the primary widgets

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("widget", ...)'.

_S_l_o_t_s:

     '_w_T_i_t_l_e': Object of class '"character"' - a character string for
          the title of the widget to be created

     '_p_W_i_d_g_e_t_s': Object of class '"list"' - a list of "basicPW" objects
          representing widget elements to be rendered

     '_e_n_v': Object of class '"environment"' - an R environment for the
          object to work within

     '_f_u_n_s': Object of class '"list"' - a list of functions that will
          be associated with buttons on the widget to be rendered. The
          name of the function in the list will be the text appears on
          the button and the function will be executed when the button
          is pressed 

     '_p_r_e_F_u_n': Object of class '"function"' - a function that will be
          executed before the widget is constructed

     '_p_o_s_t_F_u_n': Object of class '"function"' - a function that will be
          executed before the widget is destroyed

_M_e_t_h_o_d_s:

     _e_n_v<- 'signature(object = "widget")': set the value for env

     _e_n_v 'signature(object = "widget")': get the value for env

     _f_u_n_s<- 'signature(object = "widget")': set the value for funs

     _f_u_n_s 'signature(object = "widget")': get the value for funs

     _p_o_s_t_F_u_n_s<- 'signature(object = "widget")': set the value for
          postFuns

     _p_o_s_t_F_u_n 'signature(object = "widget")': get the value for postFuns

     _p_r_e_F_u_n_s<- 'signature(object = "widget")': set the value for preFun

     _p_r_e_F_u_n 'signature(object = "widget")': get the value for preFun

     _p_W_i_d_g_e_t_s<- 'signature(object = "widget")': set the value for
          pWidgets

     _p_W_i_d_g_e_t_s 'signature(object = "widget")': get the value for
          pWidgets

     _u_p_d_a_t_e_C_h_e_c_k 'signature(object = "widget")': update the value of
          check buttons of the widget to be rendered

     _u_p_d_a_t_e_L_i_s_t 'signature(object = "widget")': update the value of
          list box/entry of the widget to be rendered

     _u_p_d_a_t_e_R_a_d_i_o 'signature(object = "widget")': update the value of
          radio buttons of the widget to be rendered

     _u_p_d_a_t_e_T_e_x_t 'signature(object = "widget")': update the value of
          text box of the widget to be rendered

     _w_T_i_t_l_e<- 'signature(object = "widget")': set the value of wTitle

     _w_T_i_t_l_e 'signature(object = "widget")': get the value of wTitle 

_N_o_t_e:

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

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

     Jianhua Zhang

_R_e_f_e_r_e_n_c_e_s:

     Programming with data

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

     'basicPW-class', 'widgetView-class'

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

     PWEnv <- new.env(hash = TRUE, parent = parent.frame(1))

     label1 <- label(wName = "label1", wValue = "File Name: ", wEnv = PWEnv)
     entry1 <- entryBox(wName = "entry1", wValue = "Feed me using browse",
                        wEnv = PWEnv)
     browse2Entry1 <- function(){
         tempValue <- fileBrowser()
         temp <- get(wName(entry1), wEnv = PWEnv)
         wValue(temp) <- paste(tempValue, sep = "", collapse = ";")
         assign(wName(entry1), temp, env = PWEnv)
     }
     button1 <- button(wName = "button1", wValue = "Browse",
                          wFuns = list(command = browse2Entry1), wEnv = PWEnv)
     list1 <- listBox(wName = "list1", wValue = c(Option1 = TRUE, Option2 = FALSE,
                                      Option3 = FALSE), wEnv = PWEnv)
     text1 <- textBox(wName = "text1", wValue = "Feed me something",
                      wEnv = PWEnv)
     label2 <- label(wName = "label2", wValue = "Select one:  ", wEnv = PWEnv)
     radios1 <- radioButton(wName = "radios1", wValue = c(radio1 = TRUE,
                            radio2 = FALSE, radio3 = FALSE), wEnv = PWEnv)
     label3 <- label(wName = "label3", wValue = "Select one to many: ",
     wEnv = PWEnv)
     checks1 <- checkButton(wName = "checks1", wValue = c(check1 = TRUE,
                            check22 = FALSE, check3 = FALSE), wEnv = PWEnv)
     pWidgets <- list(topRow = list(label1 = label1, entry1 = entry1,
                      button1 = button1), textRow = list(list1 = list1,
                      text1 = text1), radGroup = list(label2 = label2,
                      radios1 = radios1), chkGroup = list(label3 = label3,
                                          checks1 = checks1))

     ## Not run: 
     ## These cannot be run by examples() but should be OK when pasted
     ## into an interactive R session with the widgetTools package loaded

     aWidget <- widget(wTitle = "A test widget", pWidgets, funs = list(),
                      preFun = function() print("Hello"),
                      postFun = function() print("Bye"), env = PWEnv)
     ## End(Not run)

