tk2dialogs: Additional Tk dialog boxes

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Tk dialog boxes to select a font or a list of ordered items.

Usage

1
2
tk2chooseFont(...)
tk2swaplist(items, selection, title = "Select items", ...)

Arguments

items

a vector of numbers, logicals, characters, factor or ordered.

selection

preselected items, in the right order.

title

title of the dialog box.

...

further arguments passed to the dialog box.

Value

The selection made in the dialog box if OK is clicked, "" otherwise for tk2chooseFont(), or an zero-length vector for tk2swaplist().

Note

If you use tile 0.7.2 or above, these dialog boxes will automatically use it. Otherwise, the dialog boxes will use plain Tk widgets (not yet for tk2swaplist()).

Author(s)

Philippe Grosjean

See Also

tk2widgets, tk2commands

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
## These cannot be run by examples() but should be OK when pasted
## into an interactive R session with the tcltk package loaded

tk2chooseFont()
tk2chooseFont(font = "{courier} 9", title = "Choose a fixed font",
    fonttype = "fixed", style = 4, sizetype = "all")
tk2chooseFont(font = "Verdana 12 bold italic underline overstrike",
    fonttype = "prop", style = 2, sizetype = "point")

tk2swaplist(1:10, 1:5) # integer
tk2swaplist(as.numeric(1:10), 1:5) # double
tk2swaplist(paste("V", 1:10), paste("V", 1:5)) # character
tk2swaplist(as.factor(1:10), 1:5) # factor
tk2swaplist(as.ordered(1:10), 1:5) # ordered

## End(Not run)

tcltk2 documentation built on May 2, 2019, 9:37 a.m.