gWidgetsRGtk2 (version 0.0-86)

gdfedit: gWidgets interface for RGtk2Extras data editor widget

Description

An alternative widget for editing a data frame using the RGtk2DfEdit package

Usage

gdfedit(items = NULL,
        name = paste(deparse(substitute(items)), "1", sep="."),
        container = NULL, ..., toolkit = guiToolkit())

Arguments

items

data frame to be edited

name

Name of data frame to save value to

container

An optional container to attach widget to

Can be used to overide default colors.

toolkit

Which GUI toolkit to use

Details

The gdf widget is used for editing data frames, but does not have the most natural keyboard handling. The RGtk2Extras package by Tom Taverner provides a more powerful and easier to use interface for editing data frame, and this wraps that widget into gWidgetsRGtk2.

The addHandlerColumnClicked function can be used to add a handler to the event when a column header is clicked. The component of the first argument column.no contains the column number.

This widget is a bit different from the others as it is not imported from gWidgets. As such, it won't exist until this gWidgetsRGtk2 package is loaded. In practical terms, you need to realize a widget before this one can be realized.

See Also

gtable

Examples

Run this code
# NOT RUN {
w<-gwindow()
g<-ggroup(cont=w)
df<-gdfedit(iris, cont=g)

## check names
names(df)
names(df)[1]<-"new"
rownames(df)
colnames(df)

## check [
df[,]
df[1,]
df[,1]

## no [<- function
## check dim stuff
dim(df)
length(df)

## handler

addHandlerColumnClicked(df, handler<-function(h,...) {
  print(h$column.no)
})

	
# }

Run the code above in your browser using DataCamp Workspace