glayout {gWidgets} | R Documentation

## A container for aligning widgets in a table

### Description

A container for laying out widgets in a table. The widgets are added using matrix notation (`[i,j]<-`).

### Usage

    glayout(homogeneous = FALSE, spacing = 10, container = NULL, ..., toolkit = guiToolkit())

### Arguments

`homogeneous` | A logical indicating if the cells are all the same size
`spacing` | Spacing in pixels between cells
`container` | Optional container to attach widget to.
`...` | ignored
`toolkit` | Which GUI toolkit to use

### Details

Widgets are added using matrix notation. A widget can span several cells, for instance `obj[1:2,2:3] <- widget` would place the widget in the first and second rows and second and third columns.

As a convenience, if the value to be assigned is a character it will be turned into a `glabel` object before being added.

For gWidgetsRGtk2, the widget may only be realized once, and once realized can not be modified. As such the process to add a new table is: use `glayout` contstructor to make object. Add widgets with matrix notation. Call `visible<-` method on object to make widget visible.

For gWidgetsrJava the extra argument `anchor` is a pair of values from -1,0,1 to indicate the x and y positioning of the widget within the cell. In gWidgetsRGtk2 such positioning is done by attaching the widget to a ggroup container with the desired postion and then adding the ggroup container to the glayout container.

For gWidgetsrJava the extra argument `expand`, a logical, will force the widget to expand to fill the entire space if `TRUE`.

### Examples

    ## Not run:
      ## show part of mtcars dataframe in a layout
      obj = glayout(container=TRUE)
      for(i in 1:6) {
        for (j in 1:4) obj[i,j] <- glabel(mtcars[i,j])
      }
      visible(obj) <- TRUE

    ## End(Not run)

[Package gWidgets version 0.0-25 Index]