| dlgList {svDialogs} | R Documentation |
Select one or several items in a list.
dlgList(choices, preselect = NULL, multiple = FALSE, title = NULL,
..., gui = .GUI)
## These should not be called directly
## S3 method for class 'gui'
dlgList(choices, preselect = NULL, multiple = FALSE, title = NULL,
..., gui = .GUI)
## S3 method for class 'textCLI'
dlgList(choices, preselect = NULL, multiple = FALSE, title = NULL,
..., gui = .GUI)
## S3 method for class 'nativeGUI'
dlgList(choices, preselect = NULL, multiple = FALSE, title = NULL,
..., gui = .GUI)
choices |
the list of items. It is coerced to character strings. |
preselect |
a list of preselections, or |
multiple |
is it a multiple selection dialog box? |
title |
the title of the dialog box, or |
... |
pass further arguments to methods. |
gui |
the 'gui' object concerned by this dialog box. |
The modified 'gui' object is returned invisibly. A list with selected items,
or a character vector of length 0 if the dialog box was cancelled is available
from gui$res (see examples).
Philippe Grosjean (phgrosjean@sciviews.org)
## Select a month
res <- dlgList(month.name, multiple = TRUE)$res
if (!length(res)) {
cat("You cancelled the choice\n")
} else {
cat("You selected:\n")
print(res)
}