Learn R Programming

svDialogstcltk (version 1.0.0)

dlg_input.tcltkGUI: A Tcl/Tk version of the svDialogs input a string or value dialog box

Description

Prompt for some data in a modal dialog box.

Usage

# S3 method for tcltkGUI
dlg_input(message = "Enter a value", default = "", ..., gui = .GUI)

Arguments

message

The message to display in the dialog box. Use \\n for line break, or provide a vector of character strings, one for each line.

default

The default value in the text box. Single string or NULL.

...

Not used yet.

gui

The 'gui' object concerned by this dialog box.

Value

The string the user wrote in the dialog box.

See Also

svDialogs::dlg_input()

Examples

Run this code
# NOT RUN {
library(svDialogstcltk) # Tcl/Tk dialog boxes are now used by default
# }
# NOT RUN {
# Ask something...
user <- dlg_input("Who are you?", Sys.info()["user"])$res
if (!length(user)) {# The user clicked the 'cancel' button
  cat("OK, you prefer to stay anonymous!\n")
} else {
  cat("Hello", user, "\n")
}
# }

Run the code above in your browser using DataLab