ggroup: Group, or box, container

Description Usage Arguments Value Examples

View source: R/ggroup.R

Description

Group, or box, container

Shortcut for vertical box containers.

Usage

1
2
3
4
ggroup(horizontal = TRUE, spacing = 2, use.scrollwindow = FALSE,
  container, ..., width = NULL, height = NULL, ext.args = NULL)

gvbox(...)

Arguments

horizontal

left or right (default), or top to bottom (horizontal=FALSE)

spacing

Margin around each child component in pixels. Can be a single number, in which case it is equal pixel space around each child. But for gWidgetsWWW2 one can specify a vector with recycling like function(top, right=top, bottom=top, left=right). A typical pattern is c(5,5,0,0), as otherwise there are 10 = 5 + 5 pixels between adjoing children. To get padding just around interior of box, pass in a value through ext.args, as in ext.args=list(bodyPadding=10).

use.scrollwindow

logical. If given, scrollbars will appear

container

A parent container. In gWidgetsWWW2 a parent container is not optional (though it can be substituted with the parent argument in some circumstances). The parent specifies the widget heirarchy and the ... argument is used to pass along arguments to layout the child component in the parent container. Typically, these are passed to the add method of the parent container.

...

passed to ggroup

width

width in pixels of component. Sizing in gWidgetsWWW2 is sometimes necessary as the arguments expand and fill are not well implemented.

height

height in pixels of the component.

ext.args

The contructors of gWidgetsWWW2 ultimately call an Ext constructor. The options passed to the Ext constructor may be added to or overridden by use of this argument. Values are passed in as named list components and with values converted into JavaScript objects by asJSObject.

Value

a GGroup reference class object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
w <- gwindow()
sb <- gstatusbar("Powered by gWidgetsWWW and Rook", cont=w)
g <- ggroup(cont=w, horizontal=FALSE) ## top to bottom
for(i in 1:10) gbutton(i, cont=g)
## add/delete
ctr <- 1 ### for label
addRow <- function(g) {
g1 <- ggroup(cont=g)
gbutton("x", cont=g1, handler=function(h,...) {delete(g, g1)})
glabel(paste("Click x to delete", ctr), cont=g1)
ctr <<- ctr + 1
}
g1 <- gframe("add/delete", cont=g, horizontal=FALSE)
addRow(g1)
f <- gframe("Adding and deleting", cont=g, horizontal=FALSE)
gbutton("+", cont=f, handler=function(h,...) addRow(f))

jverzani/gWidgetsWWW2 documentation built on Feb. 9, 2020, 5:18 p.m.