Interactive Tablelist Cell Editing Using Tile Widgets
For Tablelist Version 5.13
by
Csaba Nemethi
csaba.nemethi@t-online.deContents
- Overview
- Interactive Cell Editing Using the tile entry Widget
- Interactive Cell Editing Using the tile spinbox Widget
- Interactive Cell Editing Using the tile combobox Widget
- Interactive Cell Editing Using the tile checkbutton Widget
- Interactive Cell Editing Using the tile menubutton Widget
Overview
The tile theme engine is a compiled library extension for Tcl/Tk versions 8.4 or higher. Beginning with Tk 8.5a6, tile is integrated into the Tk core. For earlier Tk versions it can be downloaded from the address
http://sourceforge.net/projects/tktable//files/tile
Tablelist supports interactive cell editing with the aid of the
tile entry, spinbox, combobox, checkbutton, and menubutton widgets,
accessed as ttk::entry
,
ttk::spinbox
,
ttk::combobox
,
ttk::checkbutton
, and
ttk::menubutton
, respectively. The
version of the tile package must be 0.6 or higher (the tile spinbox
requires even tile 0.8.3 or later, or, alternatively, Tk 8.6 or
later). 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 ttk::entry
,
ttk::spinbox
,
ttk::combobox
,
ttk::checkbutton
, or
ttk::menubutton
, respectively. (These
options are supported at cell level, too, with the aid of the
cellconfigure
subcommand.)
One known limitation of the currently available tile versions is
that the style theme use
command
can only be used to set the current theme, but not to retrieve
it. For this reason, Tablelist makes use of the variable
ttk::currentTheme
or
tile::currentTheme
(depending on the tile
version), which is set by the ttk::setTheme
or
tile::setTheme
procedure. From this it
follows that the tile widgets used for interactive cell editing
will only be managed as expected if the platform-specific default
theme is either left unchanged or replaced with another theme by
invoking the procedure ttk::currentTheme
or
tile::setTheme
, depending on the current tile
version. (See also the tablelist::setTheme
command.)
Interactive Cell Editing Using the tile entry Widget
- DESCRIPTION
- The temporary embedded tile entry widget used for interactive
cell editing will be created with an explicitly set value for its
-style
option. Apart from its theme-specific appearance, it behaves just like its Tk core counterpart. - If an application uses the tile entry widget for interactive cell editing and also the Wcb package (even if not for that widget), then the version of Wcb must be 3.1 or higher (because earlier Wcb releases didn't support any tile widgets).
- KEYWORDS
- tablelist, editing, tile, entry
Interactive Cell Editing Using the tile spinbox Widget
- DESCRIPTION
- The temporary embedded tile spinbox widget used for interactive
cell editing will be created with an explicitly set value for its
-style
option and with its-state
option set tonormal
, which makes the widget editable. You can use the script corresponding to the-editstartcommand
tablelist configuration option to set the state of the spinbox toreadonly
or define validations for it, as well as for setting its (range of) values and its-wrap
option. Apart from its theme-specific appearance, it behaves just like its Tk core counterpart. - If an application uses the tile spinbox widget for interactive cell editing and also the Wcb package (even if not for that widget), then the version of Wcb must be 3.2 or higher (because the support for the new tile spinbox widget was added to Wcb in its version 3.2).
- KEYWORDS
- tablelist, editing, tile, spinbox
Interactive Cell Editing Using the tile combobox Widget
- DESCRIPTION
- The temporary embedded tile combobox widget used for
interactive cell editing will be created with an explicitly set
value for its
-style
option and with its-state
option set tonormal
, which makes the widget editable. You can use the script corresponding to the-editstartcommand
tablelist configuration option to set the state of the combobox toreadonly
or define validations for it, as well as for populating its listbox component (with the aid of the combobox widget's-values
option). - If an application uses the tile combobox widget for interactive cell editing and also the Wcb package (even if not for that widget), then the version of Wcb must be 3.1 or higher (because earlier Wcb releases didn't support any tile widgets).
- KEYWORDS
- tablelist, editing, tile, combobox
Interactive Cell Editing Using the tile checkbutton Widget.
- DESCRIPTION
- The temporary embedded tile checkbutton widget used for
interactive cell editing will be created with explicitly set values
for its
-style
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
tile checkbutton options are0
and1
, you don't need to change these options if the cells have the same internal values0
and1
. - KEYWORDS
- tablelist, editing, tile, checkbutton
Interactive Cell Editing Using the tile menubutton Widget.
- DESCRIPTION
- The temporary embedded tile menubutton widget used for
interactive cell editing will be created with explicitly set values
for its
-style
and-textvariable
options. In addition, a menu with its-tearoff
option set to0
and an appropriate script as the value of its-postcommand
option is created and set as the value of the menubutton's-menu
option. In an X11 environment, the menu's appearance is adapted to that of the tablelist widget by setting its-background
,-foreground
,-activebackground
,-activeforeground
, and-activeborderwidth
options to appropriate values. You can use the script corresponding to the-editstartcommand
tablelist configuration option to set any other options of the menubutton and/or its associated menu. You will, however, need this script in the first place for populating the menu, preferably with radiobutton entries. For every radiobutton entry added to the menu, the Tablelist implementation will make sure that its value (which can be specified by setting the entry's-value
or-label
option) will be displayed in the menubutton as its text when the entry is selected. (Tablelist achieves this by setting the menu entry's-variable
option to the value of the menubutton's-textvariable
option.) For menu entries of types other than radiobutton (e.g., for command entries) it is the responsibility of the application to make sure that the selected entry's text will be shown in the menubutton (for example, with the aid of the menu entry's-command
option). - KEYWORDS
- tablelist, editing, tile, menubutton