rk.show.message {rkward} | R Documentation |
Multi-purpose pop-up message boxes and selection list using native KDE GUI elements. The message boxes can be used either to show some information or ask some question. The selection list can be used to get a vector of selected items.
rk.show.message(message, caption = "Information", wait = TRUE) rk.show.question(message, caption = "Question", button.yes = "yes", button.no = "no", button.cancel = "cancel") rk.select.list(list, preselect = NULL, multiple = FALSE, title = NULL)
message |
a string for the content of the message box. |
caption |
a string for title of the message box. |
wait |
a logical (not NA) indicating whether the R interpreter should wait for the user's action, or run it asynchronously. |
button.yes |
a string for the text label of the Yes button. Can
be an empty string ( |
button.no |
a string used for the text label of the No button,
similar to |
list |
a vector, coerced into a character vector. |
multiple |
a logical (not NA), when |
title |
a string, for the window title of the displayed list |
button.canel |
a string used for the text label of the Cancel
button, similar to |
preselct |
a vector, coerced into a character vector, items to be preselected. |
For rk.show.question
, the R interpreter always waits for the user's
choice.
rk.select.list
replaces utils::select.list
for the running
session acting as a drop-in replacement for tk_select.list
. Use
.rk.backups$select.list
for the original utils::select.list
function (see Examples).
rk.show.message
always returns TRUE
, invisibly.
rk.show.question
returns TRUE
for Yes, FALSE
for
No, and NULL
for Cancel actions.
rk.select.list
returns the value of select.list
.
Thomas Friedrichsmeier rkward-devel@kde.org
require (rkward) ## Message boxes if (rk.show.question ("Question:\nDo you want to know about RKWard?", button.yes = "Yes, I do!", button.no = "No, I don't care!", button.cancel = "")) { rk.show.message ("Message:\nRKWard is a KDE GUI for R.", "RKWard Info") } else { rk.show.message ("You must be joking!", "RKWard Info", wait = FALSE) ## Run asynchronously } ## Selection lists: rk.select.list (LETTERS, preselect = c("A", "E", "I", "O", "U"), multiple = TRUE, title = "vowels") .rk.backups$select.list (LETTERS, preselect = c("A", "E", "I", "O", "U"), multiple = TRUE, title = "vowels")