table

Name

table -- A widget which arranges its children in rows and columns.

Synopsis

table [-option value...]

Screenshot

Options

-homogeneous

type: boolean (default: 1)

Whether all children of the box are given equal space.

-rowSpacing

type: integer or one of small, normal or big (default: default)

How many space in pixel are between rows.

-columnSpacing

type: integer or one of small, normal or big (default: default)

How many space in pixel are between columns.

-borderWidth

type: integer or one of small, normal or big

Space in pixel between the children and the border of the widget.

-label

type: string (default: "")

Label of the frame.

-shadow

type: ONEOF none, in, out, etchedIn, etchedOut (default: none)

Shadow type of the frame.

-labelAlign

type: float (0 lt xAlign lt 1) or one of left, center or right (default: 0)

Alignment of the label.

-dragTargets

type: list of strings

List of source targets (e.g. text/plain or application/x-color) which are supported.

-onDragData

type: 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 substituated: TABLE %% | % %w | widget name %t | time %T | type of data TABLE

-dropTargets

type: list of strings

List of destination targets (e.g. text/plain or application/x-color) which are supported.

-onDropData

type: string (default: "")

Tcl command which is executed if data is dropped on the widget. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name %d | data %l | length of data %t | time %T | type of data %x | x coordinate %y | y coordinate TABLE

-tooltip

type: string

Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.

-onShowHelp

type: string (default: "")

Tcl command which is executed in the global scope if the "show-help" signal is recieved, which is normally the case if the user presses F1 or Ctrl-F1. Before evaluation the following percent strings are substituated TABLE %% | % %w | widget name %h | help type: either "whatsThis" or "tooltip" TABLE

-onPopupMenu

type: string (default: "")

Tcl command which is executed if the "popup-menu" signal is recieved, which is normally the case if the user presses Shift-F10. Before evaluation the following percent strings are substituated: %w by widget name.

-name

type: string

Name of the widget, can be used to set options in an rc file.

-visible

type: boolean (default: 1)

Whether or not the item is visible.

-sensitive

type: boolean (default: 1)

Whether or not the item is sensitve to user input.

-heightGroup

type: string (default: "")

heightGroup 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

type: string (default: "")

widthGroup 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

type: string (default: "")

sizeGroup 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

type: 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

type: 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

type: integer or one of small, normal or big (default: 0)

The number of pixels to put between the widgets.

-rowSpan

type: integer (default: 1)

How many rows a widget should occupy.

-align

type: a list of the horizontal and vertical alignment or 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

type: 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 

results in

See also

box, paned, notebook, GtkTable, GtkFrame, GtkAlignment