gWidgets-dialogs          package:gWidgets          R Documentation

_B_a_s_i_c _d_i_a_l_o_g _c_o_n_s_t_r_u_c_t_o_r_s

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

     A dialog is a widget that draws its own window. These dialogs are
     used for simple things - confirming a choice, gathering a single
     line of input, etc. Dialogs are always modal, meaning they must be
     closed before R can be interacted with again.

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

     gmessage(message, title="message",
     icon = c("info", "warning", "error", "question"), 
          handler = NULL, 
         action = NULL, ..., toolkit=guiToolkit()) 

     ginput(message, text="", title="Input", icon = c("info", "warning", "error", "question"),  handler = NULL, action = NULL,..., toolkit=guiToolkit())

     gconfirm(message, title="Confirm", icon = c("info", "warning", "error", "question"),
      handler = NULL, action = NULL, ..., toolkit=guiToolkit())

     gbasicdialog(title = "Dialog", widget, handler = NULL, action=NULL, ..., toolkit=guiToolkit())

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

 message: Message shown for widget

   title: Title of window

    icon: Which icon to show

    text: default value for ginput text

  widget: Widget to place in basic dialog

 handler: Handler called on OK selection.

  action: Value passed to handler

     ...: Ignored

 toolkit: Toolkit to use for GUI

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

     These basic dialogs do slightly different things.

     The 'gmessage' dialog shows a message with an icon and a dismiss
     button. This dialog returns 'TRUE' or 'FALSE' as appropriate. 

     The 'gconfirm' dialog shows a message with an icon and an OK
     button and a dismiss button. A handler may be attached to the OK
     button selection. This dialog returns 'TRUE' or 'FALSE' as
     appropriate. 

     The 'ginput' dialog adds an edit box for gathering user
     information. The 'text' argument sets the default value. This is
     then passed to the handler via the component 'input' of the first
     argument of the handler. This dialog returns the value of the
     string if OK is clicked, otherwise 'NA'.

     The 'gbasicdialog' dialog wraps a widget around an OK and dismiss
     button. The handler is called when the OK button is clicked. This
     dialog returns the 'TRUE' when OK is clicked, otherwise 'FALSE'.

     These dialogs are modal. This means that the R session freezes
     until the dialog is dismissed. This may be confusing to users if
     the window should appear below a currently drawn window.

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

     ## Not run: 
        gmessage("Hi there")
        gconfirm("Are we having fun?", handler = function(h,...)
        print("Yes"))

        ginput("Enter your name", icon="question", handler = function(h,...) cat("Hi",h$input,"\n"))

     ## End(Not run)

