tk2commands {tcltk2}R Documentation

Tk commands associated with the tk2XXX widgets

Description

These commands supplement those available in the tcltk package to ease manipulation of tk2XXX widgets.

Usage

tk2column(widget, action = c("add", "configure", "delete", "names", "cget",
    "nearest"), ...)
tk2insert.multi(widget, where = "end", items)
tk2list.delete(widget, first, last = first)
tk2list.get(widget, first = 0, last = "end")
tk2list.insert(widget, index = "end", ...)
tk2list.set(widget, items)
tk2list.size(widget)
tk2notetraverse(nb)
tk2notetab(nb, tab)
tk2notetab.select(nb, tab)
tk2notetab.text(nb)
tk2state.set(widget, state = c("normal", "disabled", "readonly"))
is.tk()
is.tile()
tile.load(warn = TRUE)
tile.use(use.it = TRUE)
tk2theme.elements()
tk2theme.list()
tk2theme(theme = NULL)

Arguments

widget The widget to which these actions apply
action Which kind of action?
where Where are these item added in the list (by default, at the end)
items The items to add (either a vector for a single line, or a matrix for more items)
... Further arguments to the action
first The 0-based first index to consider in the list
last The 0-based last index to consider in the list, or "end" for using the last element of the list
index The 0-based index where to insert items in the list
nb A tk2notebook or ttk2notebook widget ("tclObj" object)
tab The name (text) of a tab in a notebook
state The new state of the widget
warn Do the function issue a warning in case of fealure?
use.it Do we use tile, or not (even if it is loaded!)
theme A theme to use (character string)

Details

tk2column() manipulate columns of a tk2mclistbox widget, tk2insert.multi() is used to insert multiple field entries in a tk2mclistbox widget, is.tk() determines if the tk package is loaded (on some platforms it is possible to load the tcltk package without tk, for instance, in batch mode) tile.load() is the right way to load the tile Tcl package. It also cares of other stuff like system fonts and correct settings of options(tcltk2.tile = TRUE/FALSE). Test if tile is loaded by using is.tile(). Changing your mind (i.e., you do not want to use tile for further Tcl widgets, even if it is loaded, you should use tile.use(FALSE) instead of changing options(tcltk2.tile = FALSE). That way, a global Tcl variable "tile_use" is also created/updated, and compatible Tcl code could detect it.

Note

Under Windows, tile should be always available (the binaries are included in the tcltk2 package). Under other system, it depends on your particular installation of Tcl/Tk, which needs installed binaires of the tile Tcl package (see http://sourceforge.net/projects/tktable to get tile and Tktable).

By default, tile is loaded and available as soon as you load the tcltk2 package (providing, of course, that it is installed on your system). If you don't want to use tile, despite it is installed, you could issue options(tcltk2.tile = FALSE) before loading the tcltk2 package. In this case, tile will not be used, even if it is installed. You can still load and use it without restarting R by issuing tile.load() at any time.

All tk2XXX() widgets and dialog boxes provided in the tcltk2 package have two forms: one with tile widgets, and another one with conventional Tk widgets, plus a series of additional pure Tcl widgets. That way, you should be able to use them transparently, no mather if you have installed tile or not on your system.

In comparison with traditional Tk widgets, tile proposes an advances mechanism for styling the widgets with "themes". By default, it adapts to the current platform (for instance, under Windows XP with XP theme, all widgets take the appearance of XP themed widgets (even with custom themes applied!). Usual Tk widgets are ALWAYS displayed in old-looking fashion under Windows XP. If you want, you can switch dynamically to a different theme among those avaiable (list them using tk2theme.list(), and switch to another one with tk2theme(newtheme). This is most useful to see how your GUI elements and dialog boxes look like on foreign systems. If you prefer, let's say, a Unix look of the R GUI elements under Windows, these functions are also useful. If you are more advanturous, you can even design your own themes (see the tile documentation).

Author(s)

Philippe Grosjean

See Also

tk2widgets, tk2tip


[Package tcltk2 version 1.0-7.1 Index]