Description Usage Arguments Details Value Examples
A table container allows one to organize child widgets in a grid
using matrix notation to indicate where the child should be
placed. The basic assignment is: tbl[i,j] <- gbutton("asdf",
cont=tbl)
. The tbl
object is on the right side, so the
widget has a toplevel and on the left to specify how the layout
will occur. One can specify i and j as a range of values,
or even empty
1 2 |
homogeneous |
equal sized columns/rows? |
spacing |
between cell spacing |
container |
A parent container. In gWidgetsWWW2 a
parent container is not optional (though it can be substituted
with the |
... |
Used to pass along argument to the parent container's
|
width |
width in pixels of component. Sizing in
gWidgetsWWW2 is sometimes necessary as the arguments
|
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 |
The layout is only finalized after call the visible<-
method with a value of TRUE
. One adds all the desired
children, then calls this method. It is at this point the widget
is rendered, so if the widget is added to a box container, say, to
which other components are added this one will appear after any
others that had been added. (So pretty much, add the children then
call visible.)
an ExtContainer object
1 2 3 4 5 6 7 8 9 10 11 12 13 | w <- gwindow("grid layout example")
sb <- gstatusbar("Powered by gWidgetsWWW and Rook", cont=w)
tbl <- glayout(cont=w)
tbl[1,1, anchor=c(1,0)] <- "Name" ## a character maps to a label
tbl[1,2] <- gedit("", cont=tbl) ## tbl needed on right side too
tbl[2,1, anchor=c(1,0)] <- "Rank"
tbl[2,2] <- gedit("", cont=tbl)
tbl[3,2] <- gbutton("click", cont=tbl, handler=function(h,...) {
msg <- whisker.render("{{name}} is a {{rank}}",
setNames(lapply(tbl[,2], svalue)[1:2], c("name", "rank")))
galert(msg, parent=w)
})
visible(tbl) <- TRUE ## This line is needed!
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.