| dlgInput {svDialogs} | R Documentation |
Enter one (textual) value with this input box.
dlgInput(message = "Enter a value", default = "", ..., gui = .GUI) ## These should not be called directly ## S3 method for class 'gui' dlgInput(message = "Enter a value", default = "", ..., gui = .GUI) ## S3 method for class 'textCLI' dlgInput(message = "Enter a value", default = "", ..., gui = .GUI) ## S3 method for class 'nativeGUI' dlgInput(message = "Enter a value", default = "", ..., gui = .GUI)
message |
the message to display in the dialog box. Use |
default |
the default value in the text box. Single string or
|
... |
pass further arguments to methods. |
gui |
the 'gui' object concerned by this dialog box. |
The modified 'gui' object is returned invisibly. The text entered by the user
at the input box, or an empty string if the dialog box was cancelled can be
obtained from gui$res (see example).
Philippe Grosjean (phgrosjean@sciviews.org)
## Ask something...
user <- dlgInput("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")
}