modalDialog           package:dynamicGraph           R Documentation

_M_o_d_a_l _d_i_a_l_o_g _w_i_n_d_o_w _f_o_r _r_e_t_u_r_n_i_n_g _a _t_e_x_t _s_t_r_i_n_g

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

     Ask for a text string in a pop up window.

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

     modalDialog(title, question, entryInit, top = NULL, entryWidth = 20, 
                 returnValOnCancel = "ID_CANCEL", do.grab = FALSE)

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

   title: Text string for the title bar of the appering window. 

question: Text string for the 'question'. 

entryInit: Default value of answer. 

     top: Text string for the 'TclTk' 'top'. 

entryWidth: Integer for the 'entryWidth'. 

returnValOnCancel: Text string for the returned value on 'Cancel'. 

 do.grab: Logical.  'tkgrab.set' resulted in fail for some systems. 

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

     The text string entered, or 'returnValOnCancel'.

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

     From the examples compiled by James Wettenhall.

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

     <URL:
     http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/modalDialog.h
     tml>

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

     Menus <- 
      list(MainUser = 
           list(label = "Test of user drag down menu - Position of \"vertices\"",
                command = function(object, ...) 
                  print(Positions(list(...)$Arguments$vertexList))),
           MainUser = 
           list(label = "Test of user drag down menu - modalDialog",
                command = function(object, ...) {
                  Args <- list(...)$Arguments
                  ReturnVal <- modalDialog("Test modalDialog Entry", "Enter name",
                                           Args$control$title, 
                                           graphWindow = Args$graphWindow)
                  print(ReturnVal)
                  if (ReturnVal == "ID_CANCEL")
                    return() } )
          )

