


Table()           MISC. REFERENCE MANUAL PAGES            Table()



NAME
     table _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?

DESCRIPTION
     The table command creates  a  2-dimensional  grid  of  cells
     which  can  used to display, or update the contents of a Tcl
     array variable. The table can index into the array on either
     a  row-first  or  column-first  basis.   The  widget  has an
     optional _s_e_l_e_c_t_e_d cell, the contents of which can optionally
     be edited. The widget supports a default style for the cells
     and also multiple _T_a_g_s, which can  be  used  to  change  the
     foreground,  background,  font, relief and anchor for a row,
     column or cell. A cell _f_l_a_s_h can be set  up  so  that  newly
     changing cells will change colour for a few seconds.

     In order to obtain good performance, the Table  widget  sup-
     ports  three drawing modes, two of which are fully Tk compa-
     tible.


WIDGET COMMANDS
     _p_a_t_h_n_a_m_e configure ?_a_r_g _a_r_g ...?
          Configures the widget. These are the same options  that
          can  be specified on the original creation line for the
          widget. With no arguments it prints a  list  of  confi-
          guration options and their values, with one argument it
          prints the value for that option.

          -background
               background colour

          -bg
               synonym for background

          -foreground
               foreground colour

          -fg
               synonym for colour

          -cursorbg
               The colour for the cursor

          -borderwidth
               borderwidth in pixels or units like mm

          -rows
               number of rows

          -cols
               number of cols




Sun Release 4.1           Last change:                          1






Table()           MISC. REFERENCE MANUAL PAGES            Table()



          -width
               default column width in characters in the  default
               font

          -height
               height of default row in pixels (0  means  set  to
               font height)

          -colorigin
               column origin of top left corner  of  screen  into
               the  array  variable  (ie  first  column  maps  to
               array(x, $colorigin)

          -roworigin
               row origin of top left corner of screen  into  the
               array  variable  (ie  first  row  maps to array(x,
               $roworigin)

          -maxwidth
               The max width  in  pixels  that  the  window  will
               request

          -maxwidth
               The max height in  pixels  that  the  window  will
               request

          -rowtitle
               number of rows to use as the title

          -coltitle
               number of columns to use as a title

          -variable
               variable to attach to the array, will create it if
               it doesn't exist

          -relief
               the relief for the cells flat, raised etc.

          -font
               default font

          -anchor
               the anchor point for each of the cells

          -xscrollcmd
               the command issued to the  xscrollbar,  usually  {
               <scrollname> set }

          -yscrollcmd
               the command issued to the  yscrollbar,  usually  {
               <scrollname> set }



Sun Release 4.1           Last change:                          2






Table()           MISC. REFERENCE MANUAL PAGES            Table()



          -rowfirstmode
               if true, the index into  the  array  is  (row,col)
               else it is (col,row)

     _p_a_t_h_n_a_m_e width ?_a_r_g _a_r_g ...?
          sets the width of individual columns to a  multiple  of
          the width of a character in the default font.

          _p_a_t_h_n_a_m_e width
               shows the widths of all columns  not  set  to  the
               default width.

          _p_a_t_h_n_a_m_e width {_c_o_l _w_i_d_t_h} | col ...
               sets or resets the width of the specified column.

     _p_a_t_h_n_a_m_e height ?_a_r_g _a_r_g ...?
          sets the height of individual rows to a number of  pix-
          els.

          _p_a_t_h_n_a_m_e height
               shows the heights of  all  rows  not  set  to  the
               default height.

          _p_a_t_h_n_a_m_e height {_r_o_w _w_i_d_t_h} | row
               sets or resets the height of the specified row.

     _p_a_t_h_n_a_m_e height _r_o_w
          shows the actual height of the row in pixels

     _p_a_t_h_n_a_m_e getwidth _c_o_l
          shows the actual width of the column in characters


     _p_a_t_h_n_a_m_e tag option ?_a_r_g _a_r_g ...?
          calls the tag functions to give  various  styles  to  a
          row, column or cell

          _p_a_t_h_n_a_m_e tag names
               shows the names of all defined tags

          _p_a_t_h_n_a_m_e _t_a_g _d_e_l_e_t_e _t_a_g
               deletes a tag. No error if the tag does not exist

          _p_a_t_h_n_a_m_e tag configure _t_a_g ?_a_r_g _a_r_g ... ?
               configures a tag. The options can all  be  set  to
               null  in which case the attribute from the default
               tag are used instead. Using _c_o_n_f_i_g_u_r_e with  a  new
               _t_a_g  name  adds  the  _t_a_g, with an existing _t_a_g it
               reconfigures it. If there  are  no  arguments,  it
               prints  the  _t_a_g configuration, with one argument,
               it prints the tag information for that  attribute.
               The following attributes can be set per tag



Sun Release 4.1           Last change:                          3






Table()           MISC. REFERENCE MANUAL PAGES            Table()



               -background
                    background colour

               -bg  synonym for background

               -foregroundfR
                    foreground colour

               -fg
                    synonym for colour

               -font
                    font for the tag

               -anchor
                    anchor for the tag

               -relief
                    the relief for the tag

          _p_a_t_h_n_a_m_e tag rowtag _t_a_g row ...
               With no arguments, prints out  the  list  of  rows
               that  use the _t_a_g. Otherwise it sets the specified
               rows to use the tag. If tag is  NULL  ie  {},  the
               rows are reset to use the default tag.

          _p_a_t_h_n_a_m_e tag coltag _t_a_g ?<col> ... ?
               With no arguments, prints out  the  list  of  cols
               that  use the _t_a_g. Otherwise it sets the specified
               cols to use the _t_a_g. If _t_a_g is  NULL  ie  {},  the
               cols are reset to the default =_t_a_g.

          _p_a_t_h_n_a_m_e tag celltag _t_a_g ?{<row> <col>} ... ?
               With no arguments, prints out the  list  of  cells
               that  use the _t_a_g. Otherwise it sets the specified
               cells to use the _t_a_g. If _t_a_g is NULL  ie  {},  the
               cells are reset to the default _t_a_g.

     _p_a_t_h_n_a_m_e toprow ?arg?
          Sets the topmost row in the main body of the display to
          the  given  argument. This is relative to the title row
          ie. if there are three title rows, and toprow is set to
          two,  then  the title rows will be followed by row five
          of the table. If there is no argument  then  it  prints
          the value of the top row.

     _p_a_t_h_n_a_m_e leftcol ?arg?
          Sets the leftmost  column  in  the  main  body  of  the
          display  to the given argument. This is relative to the
          title column ie. if  there  are  two  title  rows,  and
          leftcol  is  set  to  four, then the title cols will be
          followed by row six  of  the  table.  If  there  is  no



Sun Release 4.1           Last change:                          4






Table()           MISC. REFERENCE MANUAL PAGES            Table()



          argument then it prints the value of the left column.

     _p_a_t_h_n_a_m_e whatcell arg arg
          gives the row, column of the cell  at  cursor  position
          (x,y)

     _p_a_t_h_n_a_m_e wheris arg arg
          gives the x, y, width and height of the cell  at  posi-
          tion  (row,  col)  in  pixels.  Useful  for positioning
          menus.

     _p_a_t_h_n_a_m_e setcell ?arg arg?
          With no arguments,  prints  out  the  location  of  the
          current  /fIselected  cell/fR. With two arguments, sets
          the /fIselected cell/fR to that (row, column) position

     _p_a_t_h_n_a_m_e icursor ?arg?
          With no arguments,  prints  out  the  location  of  the
          insertion  cursor  in the current cell.  With one argu-
          ment, sets the cursor to that point in the string. 0 is
          before  the  first character, you can also use 'insert'
          or 'end' for the current insertion point or the end  of
          the text

     _p_a_t_h_n_a_m_e insert arg arg
          the second argument is a text string which is  inserted
          at the cursor position specified by the first argument.
          The cursor is then positioned after the new  text.  The
          position argument can be a number, 'insert' or 'end'

     _p_a_t_h_n_a_m_e delete arg ?arg?
          deletes text from the current selected  cell.  If  only
          one argument is given, deletes the character after that
          argument, otherwise it deletes from the first  argument
          to  the second. The arguments can be a number, 'insert'
          or 'end'.

     _p_a_t_h_n_a_m_e reread
          rereads the old contents of  the  cell  back  into  the
          editing  buffer. Useful for a key binding when <esc> is
          pressed to abort the edit.

     _p_a_t_h_n_a_m_e editmode arg
          sets the editing mode to one of three options

          off  no editing is allowed

          autoclear
               the first keypress deletes the text in the cell

          noclear
               the cell is not cleared on the first keypress



Sun Release 4.1           Last change:                          5






Table()           MISC. REFERENCE MANUAL PAGES            Table()



     _p_a_t_h_n_a_m_e drawmode arg
          sets the drawing mode to one of three options

          slow
               the table is drawn to an offscreen  pixmap,  using
               the  tk  bordering functions. This means there wil
               be no flashing, but this mode is slow for all  but
               small tables.

          compatible
               the table is drawn directly to the  screen,  using
               the  tk  border  functions  it  is faster, but the
               screen may flash on update

          fast the table is drawn directly to the screen and  the
               borders  are  done  with fast X calls, so they are
               always one pixel wide  only.  This  mode  provides
               best  performance  for large tables, but can flash
               on redraw and is not 100%  Tk  compatible  on  the
               border mode

     _p_a_t_h_n_a_m_e flash option ?arg?
          sets the parameters for the flashing for updating cells

          _p_a_t_h_n_a_m_e flash mode on|off
               turns flashing on or off. Note that flashing  will
               only  be turned on by this command if a tag is set
               up for the flashed cells to be painted in.

          _p_a_t_h_n_a_m_e flash tag tagname
               sets the flashing cells to be  painted  with  this
               tag style. The tag must already exist.

          _p_a_t_h_n_a_m_e timeout arg
               sets the number of 1/4 second tics before  a  cell
               reverts to its usual style.

     _p_a_t_h_n_a_m_e batch on|off
          turns batch mode on or off. When it is on, updates  are
          not forced out at any point, the widget waits for Tk to
          be idle before it repaints the screen. When batch  mode
          is  off,  flashes,  variable  updates  and  the  cursor
          changes are forced immediately to the screen.

     _p_a_t_h_n_a_m_e rowstretch option ?arg?
          sets the parameters for stretching  rows  to  fill  the
          assigned window space. Note that if you do not _p_a_c_k the
          table with -_f_i_l_l _b_o_t_h -_e_x_p_a_n_d _o_n  the  packing  manager
          will  not  allocate  extra  space for the window and it
          will not stretch.

          _p_a_t_h_n_a_m_e rowstretch none



Sun Release 4.1           Last change:                          6






Table()           MISC. REFERENCE MANUAL PAGES            Table()



               Rows will not stretch to fill the assigned  window
               space. If the rows are too narrow, there will be a
               blank space at the bottom of the table.

          _p_a_t_h_n_a_m_e rowstretch unset
               Only rows that do not have a specific  height  set
               will be stretched.

          _p_a_t_h_n_a_m_e rowstretch all
               All rows will be stretched by the same  number  of
               pixels  to  fill the window space allocated to the
               table.

     _p_a_t_h_n_a_m_e colstretch option
          sets the parameters for stretching columns to fill  the
          assigned window space. Note that if you do not _p_a_c_k the
          table with -_f_i_l_l _b_o_t_h -_e_x_p_a_n_d _o_n  the  packing  manager
          will  not  allocate  extra  space for the window and it
          will not stretch.

          _p_a_t_h_n_a_m_e colstretch none
               Columns will not stretch to fill the assigned win-
               dow  space.  If  the columns are too narrow, there
               will be a blank space at the right of the table.

          _p_a_t_h_n_a_m_e colstretch unset
               Only columns that do not have a specific width set
               will be stretched.

          _p_a_t_h_n_a_m_e colstretch all
               All columns will be stretched by the  same  number
               of  pixels  to  fill the window space allocated to
               the table.

     The initialization creates class bindings that give the fol-
     lowing default behaviour:

     [1]  Clicking the mouse button in a cell moves the selection
          to that cell.

     [2]  The left, right, up and down arrows move  the  selected
          cell.

     [3]  Control-leftarrow  and  Control-rightarrow   move   the
          insertion cursor within the cell.

     [4]  Backspace deletes the character  before  the  insertion
          cursor.

     [5]  Delete deletes the character after the  insertion  cur-
          sor.




Sun Release 4.1           Last change:                          7






Table()           MISC. REFERENCE MANUAL PAGES            Table()



     [6]  Escape rereads the value from the array variable,  dis-
          carding the edits that have been performed on the cell.

     [7]  Control-minus and Control-equals decrease and  increase
          the width of the column with the selected cell in it.


















































Sun Release 4.1           Last change:                          8



