gformlayout: A form layout container

Description Usage Arguments Examples

View source: R/gformlayout.R View source: R/gformlayout.R

Description

This convenience container is basically a simpler form of glayout to be used to layout two columns forms with a label on the left. The label can be passed in to the add method of the container as is done with notebook labels

.gformlayout generic for toolkit dispatch

The svalue method for GFormLayout returns a list of values created by calling svalue on each child. The returned list is named by the corresponding labels.

Usage

1
2
3
4
5
6
7
gformlayout(align = c("default", "left", "center"), spacing = 5,
  container = NULL, ..., toolkit = guiToolkit())

.gformlayout(toolkit, align = "left", spacing = 5, container = NULL, ...)

## S3 method for class 'GFormLayout'
svalue(obj, index = NULL, drop = NULL, ...)

Arguments

align

alignment of label. Left justify or center balance. Leave as "default" for underlying toolkit default.

spacing

spacing between columns

container

A parent container. When a widget is created it can be incorporated into the widget heirarchy by passing in a parent container at construction time. (For some toolkits this is not optional, e.g. gWidgets2tcltk or gWidgets2WWW2.)

...

These values are passed to the add method of the parent container. Examples of values are expand, fill, and anchor, although they're not always supported by a given widget. For more details see add. Occasionally the variable arguments feature has been used to sneak in hidden arguments to toolkit implementations. For example, when using a widget as a menubar object one can specify a parent argument to pass in parent information, similar to how the argument is used with gaction and the dialogs.

toolkit

Each widget constructor is passed in the toolkit it will use. This is typically done using the default, which will lookup the toolkit through guiToolkit.

obj

object of method call

index

NULL or logical. If TRUE and widget supports it an index, instead of a value will be returned.

drop

NULL or logical. If widget supports it, drop will work as it does in a data frame or perhaps someother means.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
w <- gwindow("gformlayout", visible=FALSE)
g <- gvbox(container=w)

flyt <- gformlayout(container=g)
gedit("", label="Name:", container=flyt)
gedit("", label="Rank:", container=flyt)
gedit("", label="Serial No.:", container=flyt)

b <- gbutton("Show me", container=g, handler=function(h,...) {
print(svalue(flyt))
})

addSpring(g) ## better with Qt, else flyt expands to fill.
visible(w) <- TRUE

## End(Not run)

gWidgets2 documentation built on May 29, 2017, 9:20 p.m.