Tablelist supports interactive cell editing with the aid of the Tk core entry, text, spinbox, and checkbutton widgets. These widgets are automatically registered for cell editing, hence the only action needed for using one of them for editing the cells of a given column is as follows:
Use the tablelist widget's columnconfigure
subcommand to set the given column's -editable
option to true
and its -editwindow
option to
entry
, text
,
spinbox
, or checkbutton
,
respectively. (These options are supported at cell level, too, with the
aid of the cellconfigure
subcommand.) Since the default value of the
-editwindow
column configuration option is
entry
, it is not necessary to set it explicitly if the
editing should take place with the aid of an embedded entry widget.
tablelist::tablelist
command for details on the editing
process.-padx
and
-pady
options set to 2
, its
-wrap
option set to none
, and its
initial height set to the number of lines contained in it. In
addition, if the widget callback package Wcb was loaded into the
interpreter (via package require Wcb
or package require wcb
) then the widget's
height will be updated whenever text is inserted into or deleted from it,
which makes the editing much more user-friendly. This is achieved by
using an appropriately defined after-insert
and
after-delete
callback for the edit window. You
can use the script corresponding to the -editstartcommand
tablelist configuration option to define further callbacks for the text
widget or configure it according to your needs.Tab
key is reserved for navigation between the editable
cells, but the user can insert a tabulator character into the text widget
by pressing Control-i
.Return
and KP_Enter
keys insert a newline
character into the text widget. Control-j
can also be
used for inserting a newline. Control-Return
and
Control-KP_Enter
terminate the editing and destroy the edit
window.Control-Home
and Control-End
have their
well-known text widget-specific bindings, just like Meta-<
and Meta->
if tk_strictMotif
is
false. Again, this is different from the behavior of the other
widgets used for interactive cell editing. For jumping into the
first/last editable cell, the user can press
Alt-Home
/Alt-End
or
Meta-Home
/Meta-End
(Command-Home
/Command-End
on Mac OS Classic and
Mac OS X Aqua).-state
option set to
normal
, which makes the widget editable. You can
use the script corresponding to the -editstartcommand
tablelist configuration option to set the state of the spinbox to
readonly
or define validations for it, as well as for
setting its (range of) values and its -wrap
option.-borderwidth
,
-font
, -padx
,
-pady
, and -variable
options.
In an X11 environment it will be created with explicitly set values for its
-borderwidth
, -indicatoron
,
-image
, -selectimage
,
-selectcolor
, and -variable
options. You can use the script corresponding to the
-editstartcommand
tablelist configuration option to set any other configuration options, like
-offvalue
and -onvalue
, according
to the internal values of the cells. Since the default values
of the -offvalue
and -onvalue
checkbutton options are 0
and 1
, you don't need
to change these options if the cells have the same internal values
0
and 1
.