loading...

A Tcl/Tk version of the svDialogs list selection dialog box

# S3 method for tcltkGUI
dlg_list(
  choices,
  preselect = NULL,
  multiple = FALSE,
  title = NULL,
  ...,
  gui = .GUI
)

Arguments

choices

The list of items. It is coerced to character strings.

preselect

A list of preselections, or NULL (then, the first element is selected in the list). Preselections not in choices are tolerated (but they are ignored without warning or error).

multiple

Is it a multiple selection dialog box?

title

The title of the dialog box, or NULL to use a default title instead.

...

Not used yet.

gui

The 'gui' object concerned by this dialog box.

Value

A character vector with the items that were selected by the user.

Examples

library(svDialogstcltk) # Tcl/Tk dialog boxes are now used by default
if (FALSE) {
# Select one or several months
res <- dlg_list(month.name, multiple = TRUE)$res
if (!length(res)) {
  cat("You cancelled the choice\n")
} else {
  cat("You selected:\n")
  print(res)
}
}