gWidgets2tcltk-package: gWidgets2tcltk

Description Arguments Details Methods Author(s)


The gWidgets2 package provides a programming interface for making graphical user interfaces within R. The package is a rewrite of the gWidgets package, introducing a few external changes but a significant number of internal ones. The package relies on one of several underlying toolkit packages providing access to the graphical libraries. This package provides the implementation to interface with the underlying tcltk package.

Drag and drop in tcltk is not supported by any underlying toolkit functionality. As such, in gWidgets2tcltk we roll our own. The result is a little limited: a) you can't drop values from other applications b) drop targets aren't allowed to be picky about what they receive (not by mime-type anyways).

GComponent is a parent class for both GContainer and GWidget and inherits its primary interface from gWidgets2::BasicToolkitInterface.

The GDf class provides a means to edit a data frame. We use the add on TK code provided by tablelist as the underlying widget

The main reference methods GTimer are start_timer and stop_timer



passed to constructor


To implement drag and drop, we bind to the toplevel window the events: button1, motion and button1 release. The binding occurs not to to widget, but to the toplevel window containing the widget. This has some advantages, most imporantly it is unlikely the binding will be overwritten by usual gWidgets2tcltk programs. (Recall tkbind will only allow one binding per widget per signal).

The gWidgets2 way of doing drag and drop is implemented here. You add a drop source with a handler that returns the value of what you want to pass via the dnd process. Then you specify a widget as a drop target and give a handler. This handler receives the data through the dropdata component of the "h" argument. Here, the value is generated when the drop occurs, not when the drag initiates. Not sure this makes any difference, but it might.

Simply click on a row and the editor pops up as a modal dialog. The shortcut Shift+Enter will go onto the next case, saving changes provided the auto save featuer is employed.

There is no undo/redo support here. There is no support for editing rownames (just lazy at the moment, holler if you would like that). No support to change the dimensions of the data frame or edit factors, ...



Are we watching for a drag?

add_drag_motion(handler, action = NULL, ...)

Called when motion over widget occurs

add_to_parent(parent, child, expand = NULL, fill = NULL, anchor = NULL, ...)

Add a child to parent if it is ia container and non null. Dispatches to add_child method of parent


Return surround block


is widget sensistive to user input

get_index(drop = NULL, ...)

svalue; index=TRUE


Return tk ID


return id of toplevel

get_value(drop = NULL, ...)

Get main value of widget. From 'svalue' when index = FALSE or NULL


Return widget (not block)


Is widget older style widget


Is widget new style widget?. Override in subclass if not

set_enabled(value, ...)

specify with logical if widget is sensistive to user input

set_size(value, ...)

Set widget size (size request), value=c(width=-1, height=-1)

set_value(value, ..., drop = NULL)

for 'svalue<-' when index = FALSE or NULL


add is just add_child


Update parent property of child and children property of parent container


Return widget (not block)

connect_to_toolkit_signal(signal, decorator, emitter = handler_widget(), ...)

Connect signal of toolkit to notify observer


Remove border by setting relief to none


Get length of object. Needed for sapply.

save_data(nm, where)

Save data set


Set the interval. Need to stop and start active timer to implement.


Start the timer


stop the timer


John Verzani

Maintainer: John Verzani

gWidgets2tcltk documentation built on May 1, 2019, 8:44 p.m.