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. The
matrix notation is to specify the space allocated to the widget.
For gWidgetstcltk
, it is necessary for a child widget to have the
layout object as its parent container and to call the [<-
method to add the widget. (See the example.)
As a convenience, if the value to be assigned is a character it will
be turned into a glabel
object before being added.
Like ggroup
, the extra argument expand
can be used to
force the widget to expand to fill all the space allocated to it.
Like ggroup
, the extra argument anchor
can by used to
anchor the child within the space allocated when this space islarger
than needed by the widget. This is specified as a pair of values from
-1,0,1 to indicating the x and y positioning of the widget within the
cell.
Like ggroup
, the extra argument fill
can by used when expand
is given, but not anchor
, to have the widget expand in the x
direction, the y
direction, or both
(the default). (Toolkit specific).
The method [
can be used to subset. In the simplest usage, it
returns the item at index i,j. (The item at i,j may be in other
cells too. The return value is a gwidget if 1x1, a list if 1xn or
mx1 (n>1), or a mxn matrix of items.