Author: Csaba Nemethi
Keywords: tablelist, editing, tile

# Interactive Tablelist Cell Editing Using Tile Widgets

## For Tablelist Version 6.20

### by

## Csaba Nemethi

## Contents

- 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

Start page

## 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

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 fully-qualified names `::ttk::entry`, `::ttk::spinbox`, `::ttk::combobox`, `::ttk::checkbutton`, and `::ttk::menubutton` are also supported. 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.5.9 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` (or to the corresponding fully-qualified name), respectively. (These options are supported at cell level, too, with the aid of the `cellconfigure` subcommand.)

REMARK 1: When using one of the built-in themes, the temporary embedded tile widget used for interactive cell editing will appear properly scaled, according to the display's DPI scaling level, given by the variable `tablelist::scalingpct`. The only exception is the tile checkbutton widget, which will be scaled as expected for the themes `aqua`, `clam`, `classic`, `default`, `vista`, and `xpnative`, but, for technical reasons, cannot be scaled if the theme is `alt` or `winnative`.

REMARK 2: One known limitation of earlier tile versions was that the `(ttk::)style theme use` command could only be used to set the current theme, but not to retrieve it. For this reason, if Tablelist cannot get the current theme with the aid of `ttk::style theme use` then it 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` command. From this it follows that if the tile version being used doesn't support the `ttk::style theme use` command without an argument then 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 library procedure `ttk::setTheme` or `tile::setTheme`, depending on the current tile version. (See also the `tablelist::setTheme` command.)

Contents Start page

## 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

Contents Start page

## 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 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. 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

Contents Start page

## 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 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 combobox to `readonly` 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

Contents Start page

## 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 are `0` and `1`, you don't need to change these options if the cells have the same internal values `0` and `1`.
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 to `0` 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

Contents Start page