O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Grid

tixGrid pathname [option value...]

The tixGrid command creates a new tixGrid widget named pathName. A tix-Grid widget presents a 2D grid of cells. Each cell may contain one Tix display item and can be formatted with a wide range of attributes.

Standard Options

-background

-borderwidth

-cursor

-font

-foreground

-highlightbackground

-highlightcolor

-highlightthickness

-padx

-pady

-relief

-selectbackground

-selectborderwidth

-selectforeground

-takefocus

-xscrollcommand

-yscrollcommand

 

Widget-Specific Options

-editdonecmd tclCommand (editDoneCmd, EditDoneCmd)

Command to call when the user has edited a grid cell. The column and row numbers of the cell are appended as arguments.

-editnotifycmd tclCommand (editNotifyCmd, EditNotifyCmd)

Command to call when the user tries to edit a grid cell. The column and row numbers of the cell are appended as arguments. The command should Return a boolean value to indicate whether the cell is editable.

-formatcmd tclCommand (formatCmd, FormatCmd)

Command to call when the grid cells need to be formatted on the screen. Five arguments are appended: Type x1 y1 x2 y2. type is the logical type of the region. It may be one of x-region (the horizontal margin), y-region (the vertical margin), s-region (area where margins are joined), or main (any other region). The last four arguments give the column and row numbers of the top left cell and bottom right cell of the af fected region.

-height integer (height, Height)

Number of rows in the grid. The default is 10.

-itemtype tclCommand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required