tk_select.list {utilitiesR} | R Documentation |
This function is identical to
tcltk::tk_select.list
, *except* that it adds in an
additional tkwait.visibility
to the code prior to
calling tkgrab.set
.
tk_select.list(choices, preselect = NULL, multiple = FALSE, title = NULL)
choices |
a character vector of items. |
preselect |
a character vector, or |
multiple |
logical: can more than one item be selected? |
title |
optional character string for window title,
or |
This gets around the problem that sometimes occurs (on
Linux? Unable to reliably reproduce), where one uses
tcltk::tk_select.list
, and gets the error
[tcl] grab failed: window not viewable
.
A bit of googling into tcltk suggests that this occurs when one attempts to set grab on a window that is not yet mapped to the screen (i.e. visible).
The solution is to add a tkwait.visibility(dlg)
*before* calling tkgrab.set(dlg)
. That is what
this function does.
Other ui: dir.browse
,
file.browse
, Filters
,
gui.dir.choose
,
gui.file.choose
, gui.menu
,
gui.readline
, gui.yesno
,
tk_entry.dialog