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

dlg_list.tcltkGUIR Documentation

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 class '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

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)
}

## End(Not run)

SciViews/svDialogstcltk documentation built on May 12, 2022, 2:47 a.m.