ClassyTcl

  Table

Home    Documentation    Screenshots    Binary distributions    Source distribution   

subclass of Widget
creates a Table of entries or text fields. This acts much like a spreadsheet. It supports scrollbars using the normal methods. The Table must have an associated command. This is used to get the data to display in the Table and te change data when it is edited. The table command will be called with the following parameters:

command object x y ?value?
the parameter object is the name of the Table.
When no value is given, the command must return the value to be s hown in the given cell. When the command fails, the error message will be shown in the affected cell.
When value is given, it is the new value of the cell. If the setcommand fails, the previous value will be restored.

Table specific options

Command-Line Name: -command
Database Name: Command
Database Class: Command
gives the command that will be called to get or set the value of a given cell. It must have the following format:
command object x y ?value?
The parameters given to the command are the Table objects name, the x and y coordinate in the table. If the parameter value is not given, the command should return thew current value of the cell given by coordinates x and y in the table. If value is given, the command should change the value of the cell to this new value. If the setcommand fails, the previous value will be restored.
Command-Line Name: -type
Database Name: Type
Database Class: Type
gives the type of table: this determines the bindings that will be used on the edited cell
Command-Line Name: -cols
Database Name: cols
Database Class: Cols
gives the number of columns in the Table
Command-Line Name: -rows
Database Name: rows
Database Class: rows
gives the number of rows in the Table
Command-Line Name: -colsize
Database Name: colsize
Database Class: colsize
gives the default column size
Command-Line Name: -rowsize
Database Name: rowsize
Database Class: rowsize
gives the default row size
Command-Line Name: -font
Database Name: font
Database Class: Font
Command-Line Name: -background
Database Name: background
Database Class: Background
Command-Line Name: -bg
Database Name: background
Database Class: Background
Command-Line Name: -foreground
Database Name: foreground
Database Class: Foreground
Command-Line Name: -fg
Database Name: foreground
Database Class: Foreground
Command-Line Name: -xresize
Database Name: xResize
Database Class: Resize
Command-Line Name: -yresize
Database Name: yResize
Database Class: Resize
Command-Line Name: -xgridwidth
Database Name: xGridWidth
Database Class: GridWidth
Command-Line Name: -ygridwidth
Database Name: yGridWidth
Database Class: GridWidth
Command-Line Name: -xgridcolor
Database Name: xGridColor
Database Class: GridColor
Command-Line Name: -ygridcolor
Database Name: yGridColor
Database Class: GridColor
Command-Line Name: -xscrollcommand
Database Name: xscrollcommand
Database Class: xscrollcommand
Command-Line Name: -yscrollcommand
Database Name: yscrollcommand
Database Class: yscrollcommand

Table specific methods

pathname set index value
set the value of the cell at $index to $value
pathname cut
puts the data in the selected cells in the selection, and deletes it afterwards
pathname copy
puts the data in the selected cells in the selection
pathname paste ?data?
paste data in the Table. The data will replace the contents of each selected cell.
pathname paste ?data?
paste data in the Table. The data must be a list where each element is a list that contains the values for one row. If no arguments are given, the data in the clipboard is pasted.
pathname movex w step ?sel?
pathname movey w step ?select?
pathname currenty
pathname currentx
pathname see ?index?
pathname xview args
pathname yview args

Peter De Rijk
hosted at SourceForge.net Logo