Learn R Programming

svDialogstcltk (version 1.0.0)

dlg_list.tcltkGUI: A Tcl/Tk version of the svDialogs list selection dialog box

Description

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

Usage

# 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.

See Also

svDialogs::dlg_list()

Examples

Run this code
# NOT RUN {
library(svDialogstcltk) # Tcl/Tk dialog boxes are now used by default
# }
# NOT RUN {
# 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)
}
# }

Run the code above in your browser using DataLab