XTablelist Package
A kind of TclOO code example to show how an existing widget can be extended to add more sub-commands to it.
Purpose
A TclOO class to extend the fabulous tablelist widget.
TclOO naming conventions
- public methods - starts with lower case declaration names, whereas
- private methods - starts with uppercase naming, so we use CamelCase …
Widget commands
xtablelist::xtablelist
xtablelist::configure
xtablelist::cget
xtablelist::xtablelist understands all commands from original tablelist,
for more sub-command refer as well to the public class interfacewidget options:
-xhideoption boolean “yes”,1 / “no”,0 (default: “no”), hide/show a popup-menu which allows to manipulate the tablelist column display
-xshowbuttons boolean (default: “no”), show sidebar action buttons to manipulate the tablelist content
-xsortoption boolean (default: “no”), hide/show popup-menu to modify tablelist column sort order
-xfileread boolean (default: “no”), allows to read-in a previously stored file
-xfilesave boolean (default: “no”) allows to saving tablelist data to a file
-xfilereadpostcmd file read post command (default: “”) if defined, allows to e.g. set widget state of depending action buttons in the caller program
-xdeletepostcmd cmd table entry delete post command (default: “”)
-xrefreshpostcmd cmd executed after a delete / refresh action takes place
-xselectpostcmd cmd specify a command to be executed after selecting an item in the tablelist (default: “”)
-xmoveovereffect boolean (default: “no”), enables visual “move over” effect
Virtual events
<<TLExtDataModified>>- delete, modified or sort action took place<<TLExtDataModifiedUndo>>- undo, nothing changed so far!
Demo Code
The following code will produce this GUI:

The tablelist object is decorated with a side iconbar, which allows to manipulate the tablelist content.
Hint
Some of the options need to be specified when creating the widget and are not fully configurable later on once the widget has been created (open issue to be implemented later on…)
Credits
- tablelist widget: Copyright (c) 2000-2021 Csaba Nemethi
- tooltip: Copyright (c) 1996-2007 Jeffrey Hobbs
- autoscroll: Copyright (c) 2003 Kevin B Kenny
- icons used from: Open Icon Library
Download Link
The package can be downloaded from here:
| File name: | Size / byte: | |
|---|---|---|
| xtablelist0.4.zip | 147353 |
