A widget which arranges its children in rows
and columns.
Synopsis
gnocl::table [-option value...]
Screenshot
Options
- -homogeneous boolean (default: 1)
-
Whether all children of the box are given equal space.
-
-rowSpacing integer or one of small, normal or big (default: default)
-
How many space in pixel are between rows.
-
-columnSpacing integer or one of small, normal or big (default: default)
-
How many space in pixel are between columns.
-
-borderWidth integer or one of small, normal or big
-
Space in pixel between the children and the border of the widget.
-
-label string (default: "")
-
Label of the frame.
-
-shadow One of none, in, out, etchedIn or etchedOut (default: none)
-
Shadow type of the frame.
-
-labelAlign float (0 lt xAlign lt 1) or one of left, center or right
(default: 0)
-
Alignment of the label.
-
-dragTargets list of strings
-
List of source targets (e.g. text/plain or application/x-color)
which are supported.
-
-onDragData string (default: "")
-
Tcl command which is executed if data is draged from this the widget
to another. This command must return the data to be draged. Before
evaluation the following percent strings are substituted:
%w widget name %t time %T type of data
-
-dropTargets list of strings
-
List of destination targets (e.g. text/plain or application/x-color)
which are supported.
-
-onDropData string (default: "")
-
Tcl command which is executed if data is dropped on the widget.
Before evaluation the following percent strings are substituted:
%w widget name %d data %l length of data %t time %T type of data %x x coordinate %y y coordinate
-
-tooltip string
-
Message that appear next to this widget when the mouse pointer is
held over it for a short amount of time.
-
-onShowHelp string (default: "")
-
Tcl command which is executed in the global scope if the "show-help"
signal is received, which is normally the case if the user presses
F1 or Ctrl-F1. Before evaluation the following percent strings are substituted:
%w widget name %h help type: either
"whatsThis" or "tooltip"
-
-onPopupMenu string (default: "")
-
Tcl command which is executed if the "popup-menu" signal
is received, which is normally the case if the user presses
Shift-F10. Before evaluation the following percent strings are substituted:
%w widget name -
-name string
-
Name of the widget, can be used to set options in an rc file.
-
-visible boolean (default: 1)
-
Whether or not the item is visible.
-
-sensitive boolean (default: 1)
-
Whether or not the item is sensitive to user input.
-
-heightGroup string (default: "")
-
The -heightGroup option can be an arbitrary string. All widgets with the same
heightGroup request the same height. If packed with the fill flag
set, they will have nevertheless different heights.
-
-widthGroup string (default: "")
-
The -widthGroup option can be an arbitrary string. All widgets with the same
widthGroup request the same width. If packed with the fill flag set,
they will have nevertheless different widths.
-
-sizeGroup string (default: "")
-
The -sizeGroup option can be an arbitrary string. All widgets with the same
sizeGroup request the same size. If packed with the fill flag set,
they will have nevertheless different sizes.
Description
The Gnocl table widget is a combination of the GtkTable and, if
necessary, the GtkFrame widget. The frame options can only changed
via configure if at least one frame option was given on creation of
the table. If the children are scaled or aligned each child is
embedded in a GtkAlignment widget.
Commands
- id delete
-
Deletes the widget and the associated tcl command.
-
id configure [-option
value...]
-
Configures the widget. Option may have any of the values accepted on
creation of the widget.
-
id addRow list-of-widget-IDs
[-option value...]
-
Add widgets at a new row to the table. If a widet-ID is the empty
string ("") the corresponding column is left empty.
-
Options
-
-expand boolean or list of two boolean (default: {1 1})
-
Whether the widgets is to be given extra space allocated to table.
The extra space will be divided evenly between all children of
table. If expand is a list, the first value is for the horizontal
and the second for the vertical expansion.
-
-fill float or list of two floats ( 0 lt fill tl 1) (default: {1
1})
-
Determines whether the allocated space is actually used. The values
can range from 0 (meaning the child uses its minimum size) to 1
(meaning the child fills all of the available space). If fill is a
list, the first value is for the horizontal and the second for the
vertical expansion.
-
-padding integer or one of small, normal or big (default: 0)
-
The number of pixels to put between the widgets.
-
-rowSpan integer (default: 1)
-
How many rows a widget should occupy.
-
-align one of
topLeft, top, topRight, left, center, right, bottomLeft, bottom, or
bottomRight (default: center)
-
Alignment of of the widget in the space allocated in the table.
This option has only an effect if the fill option is not 1.
-
id addColumn list-of-widget-Ids
[-option value...]
-
Same as add but adds a new column. If an widget-ID of the list is
the empty string the corresponding row is left empty. Instead of
-rowSpan an option -columnSpan exists.
-
Options
-
-columnSpan integer (default: 1)
-
How many columns a widget should occupy.
-
id add widget-ID column
row [-option value...]
-
Adds the widget with the ID widget-ID at a given row and column. Row
and column must be either an integer or "end[+-offset]".
The first empty row or column is labeled "end", the
row/column before "end-1" etc. All options of the addRow
and addColumn command are valid.
Example
set table [gnocl::table -homogeneous 1]
$table addRow \ [list [gnocl::button -text "1"] "" [gnocl::button -text "2"]]
$table addColumn \ [list [gnocl::button -text "3"] "" [gnocl::button -text "4"]]
$table add \ [gnocl::button -text "5"] 1 0 \ -rowSpan 3
$table add \ [gnocl::button -text "6"] 2 1 \ -columnSpan 2
gnocl::window \ -title "Table" \ -child $table \ -defaultWidth 120 \ -defaultHeight 120
|
|