A Tcl/Tk version of the svDialogs message box
# S3 method for tcltkGUI
dlg_message(
message,
type = c("ok", "okcancel", "yesno", "yesnocancel"),
...,
gui = .GUI
)
The message to display in the dialog box.
The type of dialog box: 'ok'
, 'okcancel'
, 'yesno'
or
'yesnocancel'
.
Not used yet.
The 'gui' object concerned by this dialog box.
The button pressed by the user.
library(svDialogstcltk) # Tcl/Tk dialog boxes are now used by default
if (FALSE) {
# A simple information box
dlg_message("Hello world!")$res
# Ask to continue
dlg_message(c("This is a long task!", "Continue?"), "okcancel")$res
# Ask a question
dlg_message("Do you like apples?", "yesno")$res
# Idem, but one can interrupt too
res <- dlg_message("Do you like oranges?", "yesnocancel")$res
if (res == "cancel")
cat("Ah, ah! You refuse to answer!\n")
}