Index: DESCRIPTION.txt ================================================================== --- DESCRIPTION.txt +++ DESCRIPTION.txt @@ -2,15 +2,16 @@ Title: Tk Standard Library Description: This package is intended to be a collection of Tcl packages that provide utility functions useful to a large collection of Tk programmers. Rights: BSD -Version: 0.6 +Version: 0.7 URL: http://core.tcl.tk/tklib/ Architecture: tcl Contributor: Aaron Faupell -Contributor: Andreas Kupries +Contributor: Andreas Kupries +Contributor: Andreas Kupries (AS Senior Dev) Contributor: Arjen Markus Contributor: Csaba Nemethi Contributor: David N. Welton Contributor: George Peter Staplin Contributor: Jean-Luc Fontaine Index: embedded/man/files/modules/datefield/datefield.n ================================================================== --- embedded/man/files/modules/datefield/datefield.n +++ embedded/man/files/modules/datefield/datefield.n @@ -1,10 +1,11 @@ '\" '\" Generated from file 'datefield\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) Keith Vetter +'\" Copyright (c) Thomas Wunderlich '\" -.TH "datefield" n 0\&.2 tklib "Tk datefield widget" +.TH "datefield" n 0\&.3 tklib "Tk datefield widget" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. @@ -274,19 +275,28 @@ .SH NAME datefield \- Tk datefield widget .SH SYNOPSIS package require \fBTk \fR .sp -package require \fBdatefield ?0\&.2?\fR +package require \fBdatefield ?0\&.3?\fR .sp \fB::datefield::datefield\fR \fIwidgetpath\fR ?\fIoptions\fR? +.sp +\fI-format\fR .sp .BE .SH DESCRIPTION The \fBdatefield\fR package provides the datefield widget which -is an enhanced text entry widget for the purpose of date entry\&. Only -valid dates of the form MM/DD/YYYY can be entered\&. +is an enhanced text entry widget for the purpose of date entry\&. There +are three valid formats for the dates which can be entered: +.IP [1] +English form MM/DD/YYYY using \fI-format "%m/%d/%Y"\fR (default) +.IP [2] +German form DD\&.MM\&.YYYY using \fI-format "%d\&.%m\&.%Y"\fR +.IP [3] +ISO form YYYY-MM-DD using \fI-format "%Y-%m-%d"\fR +.PP .PP The datefield widget is, in fact, just an entry widget with specialized bindings\&. This means all the command and options for an entry widget apply equally here\&. .SH COMMANDS @@ -293,11 +303,18 @@ .TP \fB::datefield::datefield\fR \fIwidgetpath\fR ?\fIoptions\fR? Creates and configures a date field widget\&. .PP .SH OPTIONS -See the \fBentry\fR manual entry for details on all available options\&. +.TP +\fI-format\fR +One of "%m/%d/%Y" (English, default if option left), "%d\&.%m\&.%Y" (German), +or "%Y-%m-%d" (ISO)\&. +.PP +.PP +See the \fBentry\fR manual entry for details on all remaining/available +options\&. .SH EXAMPLE .CS package require datefield @@ -307,11 +324,11 @@ set now [clock scan $::myDate] set ::myDate2 [clock format $now -format %A] } trace variable myDate w DayOfWeek - ::datefield::datefield \&.df -textvariable myDate + ::datefield::datefield \&.df -textvariable myDate -format "%m/%d/%Y" label \&.l1 -text "Enter a date:" -anchor e label \&.l2 -text "That date is a:" -anchor e label \&.l3 -textvariable myDate2 -relief sunken -width 12 grid \&.l1 \&.df -sticky ew @@ -333,7 +350,8 @@ .SH CATEGORY Widget .SH COPYRIGHT .nf Copyright (c) Keith Vetter +Copyright (c) Thomas Wunderlich .fi Index: embedded/man/files/modules/widgetPlus/widgetPlus.n ================================================================== --- embedded/man/files/modules/widgetPlus/widgetPlus.n +++ embedded/man/files/modules/widgetPlus/widgetPlus.n @@ -611,7 +611,14 @@ namespace import widgetPlus::* entryPlus \&.cb\&.e -undo 1 -maxundo 0 .CE +.SH "BUGS, IDEAS, FEEDBACK" +This document, and the package it describes, will undoubtedly contain +bugs and other problems\&. +Please report such in the category \fIwidgetPlus\fR of the +\fITklib Trackers\fR [http://core\&.tcl\&.tk/tklib/reportlist]\&. +Please also report any ideas for enhancements you may have for either +package and/or documentation\&. .SH "SEE ALSO" BWidget, ComboBox, Entry, entry, persistentSelection, spinbox, text, ttk::combobox, ttk::entry, ttk::spinbox Index: embedded/www/tklib/files/modules/datefield/datefield.html ================================================================== --- embedded/www/tklib/files/modules/datefield/datefield.html +++ embedded/www/tklib/files/modules/datefield/datefield.html @@ -91,11 +91,11 @@ } --> -
[ Tklib Home @@ -105,11 +105,11 @@ | Categories | Modules | Applications ]
-

datefield(n) 0.2 tklib "Tk datefield widget"

+

datefield(n) 0.3 tklib "Tk datefield widget"

Name

datefield - Tk datefield widget

Table Of Contents

    @@ -128,21 +128,27 @@

Synopsis

  • package require Tk
  • -
  • package require datefield ?0.2?
  • +
  • package require datefield ?0.3?

Description

The datefield package provides the datefield widget which -is an enhanced text entry widget for the purpose of date entry. Only -valid dates of the form MM/DD/YYYY can be entered.

+is an enhanced text entry widget for the purpose of date entry. There +are three valid formats for the dates which can be entered:

+
    +
  1. English form MM/DD/YYYY using -format "%m/%d/%Y" (default)

  2. +
  3. German form DD.MM.YYYY using -format "%d.%m.%Y"

  4. +
  5. ISO form YYYY-MM-DD using -format "%Y-%m-%d"

  6. +

The datefield widget is, in fact, just an entry widget with specialized bindings. This means all the command and options for an entry widget apply equally here.

COMMANDS

@@ -150,11 +156,17 @@
::datefield::datefield widgetpath ?options?

Creates and configures a date field widget.

OPTIONS

-

See the entry manual entry for details on all available options.

+
+
-format
+

One of "%m/%d/%Y" (English, default if option left), "%d.%m.%Y" (German), +or "%Y-%m-%d" (ISO).

+
+

See the entry manual entry for details on all remaining/available +options.

EXAMPLE

  package require datefield
  wm title . "Datefield example"
@@ -161,11 +173,11 @@
  proc DayOfWeek {args} {
      set now [clock scan $::myDate]
      set ::myDate2 [clock format $now -format %A]
  }
  trace variable myDate w DayOfWeek
- ::datefield::datefield .df -textvariable myDate
+ ::datefield::datefield .df -textvariable myDate -format "%m/%d/%Y"
  label .l1 -text "Enter a date:"   -anchor e
  label .l2 -text "That date is a:" -anchor e
  label .l3 -textvariable myDate2 -relief sunken -width 12
  grid .l1 .df -sticky ew
  grid .l2 .l3 -sticky ew
@@ -188,8 +200,9 @@
 

Category

Widget

ADDED embedded/www/tklib/files/modules/mentry/datetime1.png Index: embedded/www/tklib/files/modules/mentry/datetime1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/datetime1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/mentry/datetime2.png Index: embedded/www/tklib/files/modules/mentry/datetime2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/datetime2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/mentry/ethernetaddr.png Index: embedded/www/tklib/files/modules/mentry/ethernetaddr.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/ethernetaddr.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/mentry/index.html Index: embedded/www/tklib/files/modules/mentry/index.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/index.html @@ -0,0 +1,47 @@ + + + + The Multi-Entry Widget Package Mentry 3.10 + + + + + + +
+

The Multi-Entry Widget Package Mentry 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Mentry Programmer's Guide

+ +

The mentry::mentry + Command

+ +

Multi-Entry Widgets for Date and + Time

+ +

Multi-Entry Widgets for Real Numbers in + Fixed-Point Format

+ +

Multi-Entry Widgets for IP Addresses

+ +

Multi-Entry Widgets for IPv6 + Addresses

+ +

Commands Related to Tile Themes

+ +

Wcb Command Reference

+ + ADDED embedded/www/tklib/files/modules/mentry/mentry.html Index: embedded/www/tklib/files/modules/mentry/mentry.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentry.html @@ -0,0 +1,1196 @@ + + + + Mentry Programmer's Guide + + + + + + + + +
+

Mentry Programmer's Guide

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Overview

+ + + +

Examples

+ + + + + +
+ +

Overview

+ +

What Is Mentry?

+ +

Mentry is a library package for Tcl/Tk versions 8.0 or higher, written in + pure Tcl/Tk code.  It contains:

+ +
    +
  • the implementation of the multi-entry + mega-widget mentry, including a general utility module for + mega-widgets;
  • + +
  • procedures that facilitate the use of multi-entry widgets for + displaying and editing date and time in a + great variety of formats, real numbers in + fixed-point format, as well as IP(v4) + addresses and IPv6 addresses;
  • + +
  • two richly commented demo scripts containing the typical steps needed + to create and handle a mentry widget for a particular purpose;
  • + +
  • two demo scripts that show how to use the date- and time-related + procedures;
  • + +
  • tile-based counterparts of the above-mentioned demo scripts;
  • + +
  • this tutorial;
  • + +
  • reference pages in HTML format.
  • +
+ +

A multi-entry widget consists of any number of entry widgets separated by + labels, all embedded in a frame.  Appropriately chosen configuration + options make this conglomerate look like one single entry containing + preinserted text pieces having invariant positions within the widget.  + The initial width of an entry child also determines the maximal number of + characters that can be inserted into it; when reaching this limit in an entry + having the input focus, the latter is set automatically to the next enabled + entry child.  The same action is triggered by typing a character + contained in the label following the current entry, if the latter is + non-empty.

+ +

Within a mentry widget, the Left, Right, + Home, End, and BackSpace keys work + across entry boundaries, while Control-Left and + Control-Right play the same role as Tab and + Shift-Tab in the case of ordinary entries.

+ +

Some of the above features are implemented with the aid of the widget + callback package Wcb, written in pure Tcl/Tk code as well.  The + Mentry package requires version 3.1 or higher of Wcb, whose download + location is

+ +
+
+ http://www.nemethi.de +
+
+ +

It is very easy to create a multi-entry widget.  For + example, the command

+ +
+
+mentry::mentry .me -body {3 - 3 - 4}
+
+
+ +

will create a mentry widget consisting of two entries of width 3 and one + of width 4, separated by "-" characters.  With the + command

+ +
+
+foreach w [.me entries] {
+    wcb::cbappend $w before insert wcb::checkStrForNum
+}
+
+
+ +

you can make sure that the three entries will only accept numeric input, + thus providing a comfortable and safe user interface for editing 10-digit + phone numbers.

+ +

How to Get It?

+ +

Mentry is available for free download from the same URL as Wcb.  The + distribution file is mentry3.10.tar.gz for UNIX and + mentry3_10.zip for Windows.  These files contain the same + information, except for the additional carriage return character preceding + the linefeed at the end of each line in the text files for Windows.

+ +

Mentry is also included in tklib, which has the address

+ +
+
+ http://core.tcl.tk/tklib +
+
+ +

How to Install It?

+ +

Install the package as a subdirectory of one of the directories given by + the auto_path variable.  For example, you can install it as + a directory at the same level as the Tcl and Tk script libraries.  The + locations of these library directories are given by the + tcl_library and tk_library variables, + respectively.

+ +

To install Mentry on UNIX, cd to the desired directory + and unpack the distribution file mentry3.10.tar.gz:

+ +
+
+gunzip -c mentry3.10.tar.gz | tar -xf -
+
+
+ +

On most UNIX systems this can be replaced with

+ +
+
+tar -zxf mentry3.10.tar.gz
+
+
+ +

Both commands will create a directory named mentry3.10, with + the subdirectories demos, doc, and + scripts.

+ +

On Windows, use WinZip or some other program capable of unpacking + the distribution file mentry3_10.zip into the directory + mentry3.10, with the subdirectories demos, + doc, and scripts.

+ +

The file mentryThemes.tcl in the scripts + directory is only needed for applications using the package Mentry_tile (see + next section).

+ +

Notice that in tklib the Mentry demos directory is replaced + with the subdirectory mentry of the examples + directory.  Please take this into account when reading the examples below.

+ +

How to Use It?

+ +

The Mentry distribution provides two packages, called Mentry and + Mentry_tile.  The main difference between the two is that + Mentry_tile enables the tile-based, theme-specific appearance of mentry + widgets; this package requires Tcl/Tk 8.4 or higher and tile 0.6 or + higher.  It is not possible to use both packages in one and the same + application, because both are implemented in the same mentry + namespace and provide identical commands.

+ +

To be able to access the commands and variables defined in the package + Mentry, your scripts must contain one of the lines

+ +
+
+package require mentry ?version?
+package require Mentry ?version?
+
+
+ +

You can use either one of the two statements above because the file + mentry.tcl contains both lines

+ +
+
+package provide mentry ...
+package provide Mentry ...
+
+
+ +

Likewise, to be able to access the commands and variables defined in the + package Mentry_tile, your scripts must contain one of the lines

+ +
+
+package require mentry_tile ?version?
+package require Mentry_tile ?version?
+
+
+ +

Again, you can use either one of the two statements above because the file + mentry_tile.tcl contains both lines

+ +
+
+package provide mentry_tile ...
+package provide Mentry_tile ...
+
+
+ +

You are free to remove one of the above lines from mentry.tcl + and mentry_tile.tcl, respectively, if you want to prevent the + corresponding packages from making themselves known under two different names + each.  Of course, by doing so you restrict the argument of  + package require  to a single name per package.

+ +

Please note that ActiveTcl versions 8.5 and later use a modified + package mechanism, which only exports the all-lowercase names + mentry and mentry_tile.  For this reason, + the examples below use the statement  + package require mentry,  and their tile-based counterparts + invoke the command  package require mentry_tile.

+ +

Since the packages Mentry and Mentry_tile are implemented in the + mentry namespace, you must either invoke the

+ +
+
+namespace import mentry::pattern ?mentry::pattern ...?
+
+
+ +

command to import the procedures you need, or use qualified names + like mentry::mentry.  In the examples below we have chosen + the latter approach.

+ +

To access Mentry variables, you must use qualified + names.  There are only three Mentry variables (and one more when using + Mentry_tile) that are designed to be accessed outside the namespace + mentry:

+ +
    +
  • The variable mentry::version holds the current version + number of the Mentry package.
  • + +
  • The variable mentry::library holds the location of the + Mentry installation directory.
  • + +
  • The read-only variable mentry::usingTile has the value + 0 in the package Mentry and the value 1 in + Mentry_tile.
  • + +
  • In Mentry_tile the array mentry::themeDefaults holds the + theme-specific default values of a series of Mentry configuration + options.
  • +
+ +

More on Mentry_tile

+ +

As mentioned above, a mentry widget consists of entry and label widgets, + embedded in a frame.  While in the Mentry package all of these + components are Tk widgets, the Mentry_tile package uses both Tk frame, tile + entry, and Tk label widgets.  Due to several incompatibilities between + Tk and tile, it is currently not possible to replace all Tk widgets making up + a mentry with their tile counterparts.  Actually, the entry components + of a tile-based mentry are embedded into Tk frame widgets, which in turn, + together with the labels, are packed into a specially constructed tile entry + rather than a frame.  This somewhat complicated layout is needed because + in several themes it is not possible to draw flat, borderless tile enty + widgets.

+ +

From the above it follows that the package Mentry_tile will only work + as expected if the Tk frame and label commands + haven't been overridden by using  namespace import -force + ttk::*  at global scope.  While earlier tile releases + suggested using this command at global scope for the really adventurous, in + newer tile versions this is considered a Really Bad Idea, causing many things + to break.  Instead, you should explicitly invoke + ttk::frame, ttk::label, etc. whenever you want to + use a tile widget.

+ +

Another restriction to be taken into account (as of tile version 0.8) is + due to the fact that the  (ttk::)style theme use  + command can only be used to set the current theme, but not to retrieve + it.  For this reason, the package Mentry_tile 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-based mentry widgets will only have the expected appearance if the + platform-specific default theme is either left unchanged or replaced with + another theme by invoking the procedure ttk::setTheme or + tile::setTheme, depending on the current tile version.  + (See also the mentry::setTheme command.)

+ +

After these cautions concerning the use of tile, the rest of this section + describes the differences between the packages Mentry and Mentry_tile.

+ +

The Mentry_tile package checks whether the required Tk and tile versions + are present, by executing the commands

+ +
+
+package require Tk 8.4
+if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
+    package require tile 0.6
+}
+
+
+ +

The second command above reflects the fact that, beginning with Tk 8.5a6, + tile is integrated into the Tk core and therefore it should only be loaded + explicitly when using an earlier Tk version.

+ +

Apart from this and the _tile suffix in the  + package require  command, the only difference (from the + programmer's point of view) between the packages Mentry and Mentry_tile is + related to the supported configuration options:  The following Tk + (entry) widget options, present in the Mentry package, are not supported by + Mentry_tile, because they are not available for tile (entry) widgets: + -borderwidth, -disabledbackground, + -disabledforeground, -highlightbackground, + -highlightcolor, -highlightthickness, + -insertbackground, -insertborderwidth, + -insertofftime, -insertontime, + -insertwidth, -readonlybackground, + -relief, -selectbackground, + -selectborderwidth, and -selectforeground.

+ +

Notice that the -background option doesn't work as expected + if the current theme is plastik, tileqt, + vista, or xpnative, because these themes silently + ignore any attempt to change the background color of a tile entry widget.

+ +

Finally, take into account that, when using the tileqt theme, + the version number of the tile::theme::tileqt package must be + 0.4 or higher, and tileqt itself won't work with tile versions + earlier than 0.7.

+ +
+

Contents     Start page

+
+ +
+ +

Examples

+ +

A mentry Widget for Phone Numbers

+ +

Let's resume the example mentioned in the + Overview in a bit more systematical manner.  First, we will write a + procedure for creating a mentry widget that allows to display and edit + 10-digit phone numbers and accepts any configuration options supported by the + mentry::mentry command:

+ +
+
+#------------------------------------------------------------------------------
+# phoneNumberMentry
+#
+# Creates a new mentry widget win that allows to display and edit 10-digit
+# phone numbers.  Sets the type attribute of the widget to PhoneNumber and
+# returns the name of the newly created widget.
+#------------------------------------------------------------------------------
+proc phoneNumberMentry {win args} {
+    #
+    # Create a mentry widget consisting of two entries of width 3 and one of
+    # width 4, separated by "-" characters, and set its type to PhoneNumber
+    #
+    eval [list mentry::mentry $win] $args
+    $win configure -body {3 - 3 - 4}
+    $win attrib type PhoneNumber
+
+    #
+    # Allow only decimal digits in all entry children; use
+    # wcb::cbappend (or wcb::cbprepend) instead of wcb::callback
+    # in order to keep the wcb::checkEntryLen callback,
+    # registered by mentry::mentry for all entry children
+    #
+    for {set n 0} {$n < 3} {incr n} {
+        wcb::cbappend [$win entrypath $n] before insert wcb::checkStrForNum
+        $win adjustentry $n "0123456789"
+    }
+
+    return $win
+}
+
+
+ +

The first argument win is the name of the widget, and the + keyword args represents a list of configuration options and + their values, just like in the case of the standard Tk widgets.  The + value  {3 - 3 - 4}  of the -body option specifies that the mentry + should consist of two entries of width 3 and one of width 4, separated by + labels displaying the "-" character.

+ +

Each mentry widget may have any number of private attributes, which + can be set and retrieved with the aid of the attrib subcommand of the Tcl procedure + corresponding to the widget.  We use this subcommand to define the + type attribute of the newly created widget and set it to the + value "PhoneNumber".  Although this is not strictly + necessary, it will enable us to distinguish a phone number mentry from other + multi-entry widgets.

+ +

The mentry::mentry command registers the wcb::checkEntryLen callback with each entry + child of the mentry widget to restrict the number of characters that can be + inserted into it to the initial width specified in the -body + option.  Besides this constraint, we want our entries to accept only + decimal digits, therefore we use the wcb::cbappend command to add the + procedure wcb::checkStrForNum + to the callback list of each entry child.  By invoking wcb::callback instead of + wcb::cbappend (or wcb::cbprepend), we would replace + the callback list with the one consisting of the single element + wcb::checkStrForNum.

+ +

Now we know that each entry child of the mentry widget will only accept a + limited number of decimal digits.  But are the widths of the entry + children large enough to hold the maximal number of 3 or 4 decimal digits, + respectively?  In the case of a fixed-width font the answer is + definitely "yes", and the same holds true for most proportionally-spaced + fonts.  There are, however, fonts in which not all decimal digits have + the same width.  For this reason, we invoke the adjustentry subcommand for each + entry child, passing to it as last argument a string consisting of the + allowed characters, which in this example are the decimal digits.  This + subcommand will increase the entry widget's width if needed, to make it just + large enough for texts of the child-specific maximal length, consisting of + characters specified by that string.

+ +

Our second procedure outputs a phone number to a mentry widget having a + type attribute value of "PhoneNumber":

+ +
+
+#------------------------------------------------------------------------------
+# putPhoneNumber
+#
+# Outputs the phone number num to the mentry widget win of type PhoneNumber.
+# The phone number must be a string of length 10, consisting of decimal digits.
+#------------------------------------------------------------------------------
+proc putPhoneNumber {num win} {
+    #
+    # Check the syntax of num
+    #
+    if {[string length $num] != 10 || ![regexp {^[0-9]*$} $num]} {
+        return -code error "expected 10 decimal digits but got \"$num\""
+    } 
+
+    #
+    # Check the widget and display the properly formatted phone number
+    #
+    checkIfPhoneNumberMentry $win
+    $win put 0 [string range $num 0 2] [string range $num 3 5] \
+               [string range $num 6 9]
+}
+
+
+ +

We use the put subcommand + of the Tcl procedure corresponding to the mentry widget to display the three + substrings of the given phone number in the corresponding entries, starting + with the entry child whose index is specified as the first argument following + the word put.

+ +

Next, we need a procedure that returns the phone number contained in a + mentry widget having a type attribute value of + "PhoneNumber":

+ +
+
+#------------------------------------------------------------------------------
+# getPhoneNumber
+#
+# Returns the phone number contained in the mentry widget win of type
+# PhoneNumber.
+#------------------------------------------------------------------------------
+proc getPhoneNumber win {
+    #
+    # Check the widget
+    #
+    checkIfPhoneNumberMentry $win
+
+    #
+    # Generate an error if any entry child is empty or incomplete
+    #
+    for {set n 0} {$n < 3} {incr n} {
+        if {[$win isempty $n]} {
+            focus [$win entrypath $n]
+            return -code error EMPTY
+        }
+        if {![$win isfull $n]} {
+            focus [$win entrypath $n]
+            return -code error INCOMPL
+        }
+    }
+
+    #
+    # Return the phone number built from the
+    # values contained in the entry children
+    #
+    $win getarray strs
+    return $strs(0)$strs(1)$strs(2)
+}
+
+
+ +

The procedure runs over the indices of the entry children of the given + mentry widget and invokes the isempty and isfull subcommands of the Tcl command + corresponding to the given mentry widget.  If one of the entries is + found to be empty or incomplete, the procedure gets its path name by calling + the entrypath + subcommand, sets the focus to that entry, raises an error, and returns the + value "EMPTY" or "INCOMPL", respectively.  The + application invoking this procedure should then display an appropriate error + message corresponding to the return value.

+ +

Notice that the number 3 in the for loop above + is nothing else than  [$win entrycount].  Also, it would + be sufficient to check whether all entry children are full, because an empty + entry is at the same time incomplete.  The preliminary check whether an + entry is empty is just made for the user's convenience.

+ +

To build the phone number from the values contained in the entry children, + we use a temporary array variable and invoke the getarray subcommand, which copies the + contents of the entries to the corresponding array elements.

+ +

The last two procedures presented above contain an invocation of the + command checkIfPhoneNumberMentry, which is implemented as + folows:

+ +
+
+#------------------------------------------------------------------------------
+# checkIfPhoneNumberMentry
+#
+# Generates an error if win is not a mentry widget of type PhoneNumber.
+#------------------------------------------------------------------------------
+proc checkIfPhoneNumberMentry win {
+    if {![winfo exists $win]} {
+        return -code error "bad window path name \"$win\""
+    }
+
+    if {[string compare [winfo class $win] "Mentry"] != 0 ||
+        [string compare [$win attrib type] "PhoneNumber"] != 0} {
+        return -code error \
+               "window \"$win\" is not a mentry widget for phone numbers"
+    }
+}
+
+
+ +

This procedure retrieves the value of the type attribute of + its argument to check whether the latter denotes a mentry widget for phone + numbers (remember that this attribute was set to the value + "PhoneNumber" in the procedure + phoneNumberMentry).

+ +

The four procedures discussed above are implemented in the file + phonenumber.tcl, contained in the demos + directory.  This script also puts them together to build a small + application displaying the following figure:

+ +
+ Phone Number +
+ +

Here is the relevant code fragment:

+ +
+
+package require mentry
+
+set title "Phone Number"
+wm title . $title
+
+#
+# Add some entries to the Tk option database
+#
+source [file join [file dirname [info script]] option.tcl]
+
+. . .
+
+#
+# Frame .f with a mentry displaying a phone number
+#
+frame .f
+label .f.l -text "A mentry widget for phone numbers:"
+phoneNumberMentry .f.me -background white
+pack .f.l .f.me
+
+#
+# Message strings corresponding to the values
+# returned by getPhoneNumber on failure
+#
+array set msgs {
+    EMPTY       "Field value missing"
+    INCOMPL     "Incomplete field value"
+}
+
+#
+# Button .get invoking the procedure getPhoneNumber
+#
+button .get -text "Get from mentry" -command {
+    if {[catch {
+        set num ""
+        set num [getPhoneNumber .f.me]
+    } result] != 0} {
+        bell
+        tk_messageBox -icon error -message $msgs($result) \
+                      -title $title -type ok
+    }
+}
+
+#
+# Label .num displaying the result of getPhoneNumber
+#
+label .num -textvariable num -background white
+
+. . .
+
+putPhoneNumber 1234567890 .f.me
+focus [.f.me entrypath 0]
+
+
+ +

A mentry Widget for Ethernet Addresses

+ +

Ethernet addresses are usuallly written in the form + "XX:XX:XX:XX:XX:XX", where each "X" is a + hexadecimal digit.  The file ethernetaddr.tcl in the + demos directory contains the steps needed to create and use a + multi-entry widget for displaying and editing Ethernet addresses.  It + implements the procedures ethernetAddrMentry, + putEthernetAddr, and getEthernetAddr; the last two + invoke the helper procedure checkIfEthernetAddrMentry, while the + first one is implemented as follows:

+ +
+
+#------------------------------------------------------------------------------
+# ethernetAddrMentry
+#   
+# Creates a new mentry widget win that allows to display and edit Ethernet
+# addresses.  Sets the type attribute of the widget to EthernetAddr and returns
+# the name of the newly created widget.
+#------------------------------------------------------------------------------
+proc ethernetAddrMentry {win args} {
+    #
+    # Create a mentry widget consisting of 6 entry children of
+    # width 2, separated by colons, and set its type to EthernetAddr
+    #
+    eval [list mentry::mentry $win] $args
+    $win configure -body {2 : 2 : 2 : 2 : 2 : 2}
+    $win attrib type EthernetAddr
+
+    #
+    # Install automatic uppercase conversion and allow only hexadecimal
+    # digits in all entry children; use wcb::cbappend (or wcb::cbprepend)
+    # instead of wcb::callback in order to keep the wcb::checkEntryLen
+    # callback, registered by mentry::mentry for all entry children
+    #
+    for {set n 0} {$n < 6} {incr n} {
+        wcb::cbappend [$win entrypath $n] before insert wcb::convStrToUpper \
+                      {wcb::checkStrForRegExp {^[0-9A-F]*$}}
+        $win adjustentry $n "0123456789ABCDEF"
+    }
+    
+    return $win
+}
+
+
+ +

Notice again the invocation of the adjustentry subcommand of the Tcl + command associated with the mentry widget, for each of its entry + children.  This is necessary, because in the case of a + proportionally-spaced font the characters A - F + need more room than the digits 0 - 9 (and it is not + even guaranteed that the latters have the same width).

+ +

The procedure putEthernetAddr expects as its first argument a + string of the form "XX:XX:XX:XX:XX:XX", where each + "XX" must be a hexadecimal string in the range 0 - + 255:

+ +
+
+#------------------------------------------------------------------------------
+# putEthernetAddr
+#
+# Outputs the Ethernet address addr to the mentry widget win of type
+# EthernetAddr.  The address must be a string of the form XX:XX:XX:XX:XX:XX,
+# where each XX must be a hexadecimal string in the range 0 - 255.  Leading
+# zeros are allowed (but not required), hence the components may have more (but
+# also less) than two characters; the procedure displays them with exactly two
+# digits.
+#------------------------------------------------------------------------------
+proc putEthernetAddr {addr win} {
+    set errorMsg "expected an Ethernet address but got \"$addr\""
+
+    #
+    # Check the syntax of addr
+    #
+    set lst [split $addr :]
+    if {[llength $lst] != 6} {
+        return -code error $errorMsg
+    }
+
+    #
+    # Try to convert the 6 components of addr to hexadecimal
+    # strings and check whether they are in the range 0 - 255
+    #
+    for {set n 0} {$n < 6} {incr n} {
+        set val 0x[lindex $lst $n]
+        if {[catch {format "%02X" $val} str$n] != 0 || $val < 0 || $val > 255} {
+            return -code error $errorMsg
+        }
+    }
+
+    #
+    # Check the widget and display the properly formatted Ethernet address
+    #
+    checkIfEthernetAddrMentry $win
+    $win put 0 $str0 $str1 $str2 $str3 $str4 $str5
+}
+
+
+ +

The procedure getEthernetAddr raises an error if any entry + child of the given mentry widget is empty.  It accepts also entry + strings of length one, but in the return value all components will have + exactly two digits:

+ +
+
+#------------------------------------------------------------------------------
+# getEthernetAddr
+#
+# Returns the Ethernet address contained in the mentry widget win of type
+# EthernetAddr.
+#------------------------------------------------------------------------------
+proc getEthernetAddr win {
+    #
+    # Check the widget
+    #
+    checkIfEthernetAddrMentry $win
+
+    #
+    # Generate an error if any entry child is empty
+    #
+    for {set n 0} {$n < 6} {incr n} {
+        if {[$win isempty $n]} {
+            focus [$win entrypath $n]
+            return -code error EMPTY
+        }
+    }
+
+    #
+    # Return the properly formatted Ethernet address built
+    # from the values contained in the entry children
+    #
+    $win getarray strs
+    return [format "%02X:%02X:%02X:%02X:%02X:%02X" \
+            0x$strs(0) 0x$strs(1) 0x$strs(2) 0x$strs(3) 0x$strs(4) 0x$strs(5)]
+}
+
+
+ +

We will not show the rest of the code here, because it is very similar to + the one presented in the preceding section.  The mentry widget for + Ethernet addresses looks like in the following figure:

+ +
+ Ethernet Address +
+ +

Using mentry Widgets for Date and Time

+ +

Multi-entry widgets can be used to display and edit date and time in a + great variety of formats.  The Mentry package contains ready-to-use + commands for this purpose:

+ +
    +
  • The procedure mentry::dateMentry creates a + new mentry widget for displaying and editing a date according to the format + passed to the command as a three-character string consisting of the field + descriptor characters "d", "m", and + "y" or "Y", known from the  clock + format  command.  Another argument expected by the + procedure is the string (usually a single character) to be displayed in the + labels separating the three components of the date.
  • + +
  • Similarly, the procedure mentry::timeMentry creates a + new mentry widget for displaying and editing a time according to the format + passed to the command as a two- or three-character string consisting of the + following field descriptor characters of the  clock + format  command: "H" or "I", followed + by "M", and optionally the letter "S".  An + "H" as first character specifies the time format + "%H:%M" or "%H:%M:%S" (i.e., with the hour + between 0 and 23), while the letter + "I" stands for  "%I:%M %p"  or  + "%I:%M:%S %p"  (i.e., with AM/PM indicator).  The + procedure expects the separator string (which is usually the + ":" character) as another command-line argument.
  • + +
  • Finally, the procedure mentry::dateTimeentry + creates a new mentry widget for displaying and editing a date & time + according to the format passed to the command as a 5- or 6-character + string, with the first three characters consisting of the letters + "d", "m", and "y" or + "Y", followed by two or three further field descriptor + characters of the  clock format  command, which must + be: "H" or "I", then "M", and + optionally the letter "S".  The procedure expects two + more arguments, specifying the separators to be used in the date and time + parts of the mentry widget, respectively.
  • +
+ +

Before describing the other date- and time-related commands provided by + the Mentry package, let's see how the first two of the above are invoked in + the file datetime1.tcl, located in the demos + directory:

+ +
+
+package require mentry
+
+set title "Date & Time"
+wm title . $title 
+
+#
+# Add some entries to the Tk option database
+#
+source [file join [file dirname [info script]] option.tcl]
+    
+#   
+# Date and time formats supported by this demo
+# script and the corresponding field separators
+#
+array set dateFmts {0 mdy  1 dmy  2 Ymd}
+array set dateSeps {0 /    1 .    2 -  }
+array set timeFmts {0 IMS  1 HMS}
+array set timeSeps {0 :    1 :  }
+
+#
+# Choose the date & time formats; don't use the %p field descriptor
+# for displaying the AM/PM indicator, because it doesn't work on
+# UNIX if Tcl/Tk 8.4 or higher is used in a non-default locale
+#
+wm withdraw .
+set clockVal [clock seconds]
+if {[clock format $clockVal -format "%H"] < 12} {
+    set meridian AM
+} else {
+    set meridian PM
+}
+set dateIdx [tk_dialog .choice $title "Please choose a date format" {} -1 \
+                       [clock format $clockVal -format "%m/%d/%y"] \ 
+                       [clock format $clockVal -format "%d.%m.%y"] \ 
+                       [clock format $clockVal -format "%Y-%m-%d"]]
+set timeIdx [tk_dialog .choice $title "Please choose a time format" {} -1 \
+                       [clock format $clockVal -format "%I:%M:%S $meridian"] \
+                       [clock format $clockVal -format "%H:%M:%S"]]
+wm deiconify .
+
+#   
+# Frame .f with mentries displaying the date & time
+#   
+frame .f
+label .f.lDate -text "Date: "
+mentry::dateMentry .f.date $dateFmts($dateIdx) $dateSeps($dateIdx) \ 
+                   -justify center -background white
+frame .f.gap -width 10
+label .f.lTime -text "Time: "
+mentry::timeMentry .f.time $timeFmts($timeIdx) $timeSeps($timeIdx) \
+                   -justify center -background white
+pack .f.lDate .f.date .f.gap .f.lTime .f.time -side left
+
+
+ +

Before displaying the main window, the script lets the user choose one out + of three date and one out of two time formats.  The corresponding + command-line arguments passed to mentry::dateMentry and + mentry::timeMentry are taken from the arrays + dateFmts, dateSeps, timeFmts, and + timeSeps.

+ +

The following figure corresponds to the choices  dateIdx = + 2  and  timeIdx = 1:

+ +
+ Date & Time +
+ +

The demo script datetime2.tcl displays both the date and time + in the same mentry widget, with the aid of the third command described + above:

+ +
+
+#
+# Frame .f with a mentry displaying the date & time
+#
+frame .f
+label .f.l -text "Date & time: "
+mentry::dateTimeMentry .f.me $dateFmts($dateIdx)$timeFmts($timeIdx) \
+                       $dateSeps($dateIdx) $timeSeps($timeIdx) \
+                       -justify center -background white
+pack .f.l .f.me
+
+
+ +
+ Date & Time +
+ +

The Mentry package exports two further commands for date, time, and date & + time mentries:

+ +
    +
  • The procedure mentry::putClockVal outputs + the date, time, or date & time corresponding to an integer clock value + specified as its first argument to a date, time, or date & time mentry + widget, passed to it as the second parameter.  Like the +  clock format  command, the procedure accepts the + optional argument pair  -gmt boolean.
  • + +
  • The procedure mentry::getClockVal returns + the clock value corresponding to the date, time, or date & time contained + in the date, time, or date & time mentry specified as its first + argument.  Like the  clock scan  command, the + procedure accepts the optional argument pairs  -base + clockValue  and  -gmt + boolean.  On failure, the procedure sets the focus to + the first erronous entry child, generates an error, and returns one of the + values contained in the following code fragment taken from the scripts + datetime1.tcl and datetime2.tcl: + +
    +
    +#
    +# Message strings corresponding to the values
    +# returned by mentry::getClockVal on failure
    +#
    +array set msgs {
    +    EMPTY       "Field value missing"
    +    BAD         "Invalid field value"
    +    BAD_DATE    "Invalid date"
    +    BAD_YEAR    "Unsupported year"
    +}
    +
    +
    + +

    The string "EMPTY" is returned if any entry child (except + the one containing the seconds) was found to be empty.  The value + "BAD" means a day, month, or hour value of 0 + (the hour must not be 0 if the AM/PM indicator is + present).  The string "BAD_DATE" is returned when the + <year, month, day> triple is invalid (note that the procedure is + aware of leap years).  Finally, even if this triple is valid, the + conversion (made with the aid of the  clock scan  + command) can fail because of an unsupported year value (e.g., between + 38 and 70); in this case the string + "BAD_YEAR" is returned.

    +
  • +
+ +

The demo script datetime1.tcl invokes the last two commands + as follows:

+ +
+
+#
+# Button .get invoking the procedure mentry::getClockVal
+#
+button .get -text "Get from mentries" -command {
+    if {[catch {
+        set dateTime ""
+        set base [mentry::getClockVal .f.date]
+        set clockVal [mentry::getClockVal .f.time -base $base]
+        set dateTime [clock format $clockVal -format "%c"]
+    } result] != 0} {
+        bell
+        tk_messageBox -icon error -message $msgs($result) \
+                      -title $title -type ok
+    }
+}
+
+#
+# Label .dateTime displaying the result of mentry::getClockVal
+#
+label .dateTime -textvariable dateTime -background white
+
+. . .
+
+set clockVal [clock seconds]
+mentry::putClockVal $clockVal .f.date
+mentry::putClockVal $clockVal .f.time
+focus [.f.date entrypath 0]
+
+
+ +

To obtain the clock value from the mentry widgets .f.date and + .f.time, we first pass the name of the date mentry to the + command mentry::getClockVal and then use the result as the value + of the -base option when passing the name of the time mentry to + the same procedure.

+ +

The demo script datetime2.tcl is simpler:

+ +
+
+#
+# Button .get invoking the procedure mentry::getClockVal
+#
+button .get -text "Get from mentry" -command {
+    if {[catch {
+        set dateTime ""
+        set clockVal [mentry::getClockVal .f.me]
+        set dateTime [clock format $clockVal -format "%c"]
+    } result] != 0} {
+        bell
+        tk_messageBox -icon error -message $msgs($result) \
+                      -title $title -type ok
+    }
+}
+
+#
+# Label .dateTime displaying the result of mentry::getClockVal
+#
+label .dateTime -textvariable dateTime -background white
+
+. . .
+
+set clockVal [clock seconds]
+mentry::putClockVal $clockVal .f.me
+focus [.f.me entrypath 0]
+
+
+ +

Tile-Based Demo Scripts

+ +

The Mentry distribution contains also tile-based counterparts of the demo + scripts discussed above.  As described in the More on + Mentry_tile section of this tutorial, it is quite easy to port an + application using the Mentry package to one based on Mentry_tile.  For + example, let's see how to transform the demo script + phonenumber.tcl into a tile-based one, called + phonenumber_tile.tcl.  The changes are shown below in + red color:

+ +
+
+package require mentry_tile
+
+set title "Phone Number"
+wm title . $title
+
+#
+# Add some entries to the Tk option database
+#
+source [file join [file dirname [info script]] option_tile.tcl]
+
+. . .
+
+#
+# Improve the window's appearance by using a tile
+# frame as a container for the other widgets
+#
+ttk::frame .base
+
+#
+# Frame .base.f with a mentry displaying a phone number
+#
+ttk::frame .base.f
+ttk::label .base.f.l -text "A mentry widget for phone numbers:"
+phoneNumberMentry .base.f.me
+pack .base.f.l .base.f.me
+
+#
+# Message strings corresponding to the values
+# returned by getPhoneNumber on failure
+#
+array set msgs {
+    EMPTY       "Field value missing"
+    INCOMPL     "Incomplete field value"
+}
+
+#
+# Button .base.get invoking the procedure getPhoneNumber
+#
+ttk::button .base.get -text "Get from mentry" -command {
+    if {[catch {
+        set num ""
+        set num [getPhoneNumber .base.f.me]
+    } result] != 0} {
+        bell
+        tk_messageBox -icon error -message $msgs($result) \
+                      -title $title -type ok
+    }
+}
+
+#
+# Label .base.num displaying the result of getPhoneNumber
+#
+ttk::label .base.num -textvariable num -background white
+
+. . .
+
+putPhoneNumber 1234567890 .base.f.me
+focus [.base.f.me entrypath 0]
+
+
+ +

That's all!  The resulting window has a nice theme-specific + appearance:

+ +
+ Phone Number +
+ +

The only Mentry-specific change in the code above consists of the use of + the _tile suffix in mentry_tile.

+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/mentryDateTime.html Index: embedded/www/tklib/files/modules/mentry/mentryDateTime.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentryDateTime.html @@ -0,0 +1,431 @@ + + + + Multi-Entry Widgets for Date and Time + + + + + + + + +
+

Multi-Entry Widgets for Date and Time

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The mentry::dateMentry Command

+ +
+
NAME
+ +
mentry::dateMentry – Create and manipulate mentry + widgets for date
+ +
SYNOPSIS
+ +
+
+mentry::dateMentry pathName format separator ?options?
+
+
+ +
DESCRIPTION
+ +
This command creates a new mentry widget pathName + for displaying and editing a date according to the + format argument, which must be a string of length 3, + consisting of the letters "d" for the day + (01 - 31), "m" for the month + (01 - 12), and "y" or + "Y" for the year without century (00 - + 99) or with century (e.g., 2008), in an arbitrary + order.  These field descriptor characters have the same meanings as in + the  clock format  command.  The + separator argument specifies the text to be displayed + in the labels separating the three entry children of the mentry widget (the + most common values are the "/", + "-", and "." characters).  The + supported options are the same as in the case of the + mentry::mentry + command.
+ +
The command sets the type attribute of + the widget to the value "Date", saves the value of + format in its format attribute, and + returns the name of the newly created widget.
+ +
DEFAULT BINDINGS
+ +
The mentry::dateMentry command defines four new + keyboard bindings for the entry children of the mentry widget it + creates:  The Up key increments the entry's value by 1 if + the latter is less than the allowed maximum for that child.  + Similarly, the Down key decrements the entry's value by 1 if + the latter is greater than the allowed minimum for that child.  The + Prior key increments the entry's value by at most 10 if the + latter is less than the allowed maximum for that child.  Similarly, + the Next key decrements the entry's value by at most 10 if the + latter is greater than the allowed minimum for that child.  If the + entry is empty then all of these keys insert the child-specific minimum + value into the entry.
+ +
The actions performed by the Up and + Down keys can also be triggered by rolling the mouse + wheel.  In addition, on Mac OS Classic and Mac OS X Aqua, the actions + performed by the Prior and Next keys can also be + triggered by rolling the mouse wheel while holding down the + Option key.
+ +
KEYWORDS
+ +
mentry, widget, date
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::timeMentry Command

+ +
+
NAME
+ +
mentry::timeMentry – Create and manipulate mentry + widgets for time
+ +
SYNOPSIS
+ +
+
+mentry::timeMentry pathName format separator ?options?
+
+
+ +
DESCRIPTION
+ +
This command creates a new mentry widget pathName + for displaying and editing a time according to the + format argument, which must be a string of length 2 or + 3, consisting of the following field descriptor characters of the  + clock format  command: "H" or + "I", followed by "M", and + optionally the letter "S".  An + "H" as first character specifies the time format + "%H:%M" or "%H:%M:%S" (i.e., with + the hour between 0 and 23), while the letter + "I" stands for  "%I:%M + %p"  or  "%I:%M:%S %p"  + (i.e., with AM/PM indicator).  The separator + argument specifies the text to be displayed in the labels separating the + entry children of the mentry widget (this is usually the + ":" character).  The options + are the same as in the case of the mentry::mentry command.
+ +
The command sets the type attribute of + the widget to the value "Time", saves the value of + format in its format attribute, and + returns the name of the newly created widget.
+ +
DEFAULT BINDINGS
+ +
The mentry::timeMentry command defines four new + keyboard bindings for the entry children of the mentry widget it + creates:  The Up key increments the entry's value by 1 if + the latter is less than the allowed maximum for that child.  + Similarly, the Down key decrements the entry's value by 1 if + the latter is greater than the allowed minimum for that child.  The + Prior key increments the entry's value by at most 10 if the + latter is less than the allowed maximum for that child.  Similarly, + the Next key decrements the entry's value by at most 10 if the + latter is greater than the allowed minimum for that child.  If the + entry is empty then all of these keys insert the child-specific minimum + value into the entry.
+ +
The actions performed by the Up and + Down keys can also be triggered by rolling the mouse + wheel.  In addition, on Mac OS Classic and Mac OS X Aqua, the actions + performed by the Prior and Next keys can also be + triggered by rolling the mouse wheel while holding down the + Option key.
+ +
KEYWORDS
+ +
mentry, widget, time
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::dateTimeMentry + Command

+ +
+
NAME
+ +
mentry::dateTimeMentry – Create and manipulate + mentry widgets for date & time
+ +
SYNOPSIS
+ +
+
+mentry::dateTimeMentry pathName format dateSeparator timeSeparator ?options?
+
+
+ +
DESCRIPTION
+ +
This command creates a new mentry widget pathName + for displaying and editing a date & time according to the + format argument, which must be a string of length 5 or + 6, with the first 3 characters consisting of the letters + "d" for the day (01 - 31), + "m" for the month (01 - 12), + and "y" or "Y" for the year without + century (00 - 99) or with century (e.g., + 2008), in an arbitrary order, followed by 2 or 3 further field + descriptor characters of the clock format  + command, which must be: "H" or "I", + then "M", and optionally the letter + "S".  An "H" specifies the + time format "%H:%M" or "%H:%M:%S" + (i.e., with the hour between 0 and 23), while the + letter "I" stands for  "%I:%M + %p"  or  "%I:%M:%S %p"  + (i.e., with AM/PM indicator).  The dateSeparator + argument specifies the text to be displayed in the labels separating the + entry children in the date part of the mentry widget (the most common + values are the "/", "-", and + "." characters).  Similarly, the + timeSeparator argument stands for the text to be + displayed in the labels separating the entry children in the time part of + mentry widget (this is usually the ":" + character).  The date and time parts in turn are separated from each + other by a space character.  The supported options + are the same as in the case of the mentry::mentry command.
+ +
The command sets the type attribute of + the widget to the value "DateTime", saves the value of + format in its format attribute, and + returns the name of the newly created widget.
+ +
DEFAULT BINDINGS
+ +
The mentry::dateTimeMentry command defines four new + keyboard bindings for the entry children of the mentry widget it + creates:  The Up key increments the entry's value by 1 if + the latter is less than the allowed maximum for that child.  + Similarly, the Down key decrements the entry's value by 1 if + the latter is greater than the allowed minimum for that child.  The + Prior key increments the entry's value by at most 10 if the + latter is less than the allowed maximum for that child.  Similarly, + the Next key decrements the entry's value by at most 10 if the + latter is greater than the allowed minimum for that child.  If the + entry is empty then all of these keys insert the child-specific minimum + value into the entry.
+ +
The actions performed by the Up and + Down keys can also be triggered by rolling the mouse + wheel.  In addition, on Mac OS Classic and Mac OS X Aqua, the actions + performed by the Prior and Next keys can also be + triggered by rolling the mouse wheel while holding down the + Option key.
+ +
KEYWORDS
+ +
mentry, widget, date, time
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::putClockVal Command

+ +
+
NAME
+ +
mentry::putClockVal – Output a clock value to a + date, time, or date & time mentry
+ +
SYNOPSIS
+ +
+
+mentry::putClockVal clockValue pathName ?-gmt boolean?
+
+
+ +
DESCRIPTION
+ +
This command outputs the date, time, or date & time corresponding to + the integer clockValue to the mentry widget + pathName, which must have been created with the + mentry::dateMentry, + mentry::timeMentry, or + mentry::dateTimeMentry + command (this is checked by examining the widget's type + attribute, which must have the value "Date", + "Time", or "DateTime").
+ +
Like in the case of the  clock + format  command, the optional argument pair  + -gmt boolean specifies whether the clock value + is to be formatted as Greenwich Mean Time or according to the local + timezone as defined by the operating environment.
+ +
KEYWORDS
+ +
mentry, widget, date, time, clock
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::getClockVal Command

+ +
+
NAME
+ +
mentry::getClockVal – Get the clock value from a + date, time, or date & time mentry
+ +
SYNOPSIS
+ +
+
+mentry::getClockVal pathName ?-base clockValue? ?-gmt boolean?
+
+
+ +
DESCRIPTION
+ +
This command returns the clock value corresponding to the date, time, + or date & time contained in the mentry widget pathName, + which must have been created with the mentry::dateMentry, mentry::timeMentry, or mentry::dateTimeMentry command (this is + checked by examining the widget's type attribute, which + must have the value "Date", "Time", or + "DateTime").
+ +
Like in the case of the  clock + scan  command, the optional argument pair  + -base clockValue specifies that the date + contained in clockValue is to be used when getting the + clock value from the given mentry widget, and the optional argument + pair  -gmt boolean specifies whether the + clock value is to be calculated relative to Greenwich Mean Time or + according to the local timezone as defined by the operating + environment.
+ +
If an error occurs during the conversion, the command sets + the focus to the first erronous entry child, generates an error, and + returns one of the values contained in the following table:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Return ValueMeaning
"EMPTY"Any entry child (except the one containing the seconds) is + empty.
"BAD"The value of the day, month, or hour (the latter only if the + AM/PM indicator is present) is 0.
"BAD_DATE"The <year, month, day> triple is invalid (note that the + command is aware of leap years).
"BAD_YEAR"The above triple is valid, but the conversion (made with the aid + of the  clock scan  command) failed + because of an unsupported year value (e.g., between 38 + and 70).
+
+ +
KEYWORDS
+ +
mentry, widget, date, time, clock
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/mentryFixedPoint.html Index: embedded/www/tklib/files/modules/mentry/mentryFixedPoint.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentryFixedPoint.html @@ -0,0 +1,176 @@ + + + + Multi-Entry Widgets for Real Numbers in Fixed-Point Format + + + + + + + + +
+

Multi-Entry Widgets for Real Numbers
+ in Fixed-Point Format

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The mentry::fixedPointMentry + Command

+ +
+
NAME
+ +
mentry::fixedPointMentry – Create and manipulate + mentry widgets for real numbers in fixed-point format
+ +
SYNOPSIS
+ +
+
+mentry::fixedPointMentry pathName count1 count2 ?-comma? ?options?
+
+
+ +
DESCRIPTION
+ +
This command creates a new mentry widget pathName + for displaying and editing real numbers in fixed-point format, with + count1 characters before and count2 + digits after the decimal point.  Both count1 and + count2 must be positive integers.  The mentry will + have two entry children, separated by a label displaying a + "." character by default; the optional + -comma switch changes the label text to + ",".  The supported options + are the same as in the case of the mentry::mentry command.
+ +
The command sets the type attribute of + the widget to the value "FixedPoint" and returns the name of + the newly created widget.
+ +
KEYWORDS
+ +
mentry, widget, real number
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::putReal Command

+ +
+
NAME
+ +
mentry::putReal – Output a real number to a mentry + of type "FixedPoint"
+ +
SYNOPSIS
+ +
+
+mentry::putReal number pathName
+
+
+ +
DESCRIPTION
+ +
This command outputs the real number number to the + mentry widget pathName, which must have been created + with the mentry::fixedPointMentry command (this + is checked by examining the widget's type attribute, + which must have the value "FixedPoint").
+ +
The command generates an error if the number does not fit + into the widget because it has too many characters before the decimal + point.
+ +
KEYWORDS
+ +
mentry, widget, real number
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::getReal Command

+ +
+
NAME
+ +
mentry::getReal – Get a real number from a mentry of + type "FixedPoint"
+ +
SYNOPSIS
+ +
+
+mentry::getReal pathName
+
+
+ +
DESCRIPTION
+ +
This command returns the number contained in the mentry widget + pathName, which must have been created with the + mentry::fixedPointMentry command (this + is checked by examining the widget's type attribute, + which must have the value "FixedPoint").
+ +
If both entry children of the widget are empty, the command + sets the focus to the first entry child, generates an error, and returns + the string "EMPTY".
+ +
KEYWORDS
+ +
mentry, widget, real number
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/mentryIPAddr.html Index: embedded/www/tklib/files/modules/mentry/mentryIPAddr.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentryIPAddr.html @@ -0,0 +1,187 @@ + + + + Multi-Entry Widgets for IP Addresses + + + + + + + + +
+

Multi-Entry Widgets for IP Addresses

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The mentry::ipAddrMentry + Command

+ +
+
NAME
+ +
mentry::ipAddrMentry – Create and manipulate mentry + widgets for IP addresses
+ +
SYNOPSIS
+ +
+
+mentry::ipAddrMentry pathName ?options?
+
+
+ +
DESCRIPTION
+ +
This command creates a new mentry widget pathName + for displaying and editing IP addresses in the standard dotted-decimal + notation.  The supported options are the same as + in the case of the mentry::mentry command.
+ +
The command sets the type attribute of + the widget to the value "IPAddr" and returns the name of the + newly created widget.
+ +
DEFAULT BINDINGS
+ +
The mentry::ipAddrMentry command defines four new + keyboard bindings for the entry children of the mentry widget it + creates:  The Up key increments the entry's value by 1 if + the latter is less than 255.  Similarly, the Down key + decrements the entry's value by 1 if the latter is greater than 0.  + The Prior key increments the entry's value by at most 10 if + the latter is less than 255.  Similarly, the Next key + decrements the entry's value by at most 10 if the latter is greater than + 0.  If the entry is empty then all of these keys insert the value + 0 into the entry.
+ +
The actions performed by the Up and + Down keys can also be triggered by rolling the mouse + wheel.  In addition, on Mac OS Classic and Mac OS X Aqua, the actions + performed by the Prior and Next keys can also be + triggered by rolling the mouse wheel while holding down the + Option key.
+ +
KEYWORDS
+ +
mentry, widget, IP address
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::putIPAddr Command

+ +
+
NAME
+ +
mentry::putIPAddr – Output an IP address to a mentry + of type "IPAddr"
+ +
SYNOPSIS
+ +
+
+mentry::putIPAddr address pathName
+
+
+ +
DESCRIPTION
+ +
This command outputs the IP address address to the + mentry widget pathName, which must have been created + with the mentry::ipAddrMentry command (this is + checked by examining the widget's type attribute, which + must have the value "IPAddr").
+ +
The command generates an error if the address is + invalid.
+ +
KEYWORDS
+ +
mentry, widget, IP address
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::getIPAddr Command

+ +
+
NAME
+ +
mentry::getIPAddr – Get an IP address from a mentry + of type "IPAddr"
+ +
SYNOPSIS
+ +
+
+mentry::getIPAddr pathName
+
+
+ +
DESCRIPTION
+ +
This command returns the IP address contained in the mentry widget + pathName, which must have been created with the + mentry::ipAddrMentry + command (this is checked by examining the widget's type + attribute, which must have the value "IPAddr").
+ +
If any entry child of the widget is empty, the command sets + the focus to the first such entry, generates an error, and returns the + string "EMPTY".
+ +
KEYWORDS
+ +
mentry, widget, IP address
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/mentryIPv6Addr.html Index: embedded/www/tklib/files/modules/mentry/mentryIPv6Addr.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentryIPv6Addr.html @@ -0,0 +1,193 @@ + + + + Multi-Entry Widgets for IPv6 Addresses + + + + + + + + +
+

Multi-Entry Widgets for IPv6 Addresses

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The mentry::ipv6AddrMentry + Command

+ +
+
NAME
+ +
mentry::ipv6AddrMentry – Create and manipulate + mentry widgets for IPv6 addresses
+ +
SYNOPSIS
+ +
+
+mentry::ipv6AddrMentry pathName ?options?
+
+
+ +
DESCRIPTION
+ +
This command creates a new mentry widget pathName + for displaying and editing IPv6 addresses in the standard hexadecimal + notation (where the eight groups of one to four hexadecimal digits are + separated from each other by o colon).  The supported + options are the same as in the case of the + mentry::mentry + command.
+ +
The command sets the type attribute of + the widget to the value "IPv6Addr" and returns the name of the + newly created widget.
+ +
DEFAULT BINDINGS
+ +
The mentry::ipv6AddrMentry command defines four new + keyboard bindings for the entry children of the mentry widget it + creates:  The Up key increments the entry's value by 1 if + the latter is less than 65535.  Similarly, the Down key + decrements the entry's value by 1 if the latter is greater than 0.  + The Prior key increments the entry's value by at most 10 if + the latter is less than 65535.  Similarly, the Next key + decrements the entry's value by at most 10 if the latter is greater than + 0.  If the entry is empty then all of these keys insert the value + 0 into the entry.
+ +
The actions performed by the Up and + Down keys can also be triggered by rolling the mouse + wheel.  In addition, on Mac OS Classic and Mac OS X Aqua, the actions + performed by the Prior and Next keys can also be + triggered by rolling the mouse wheel while holding down the + Option key.
+ +
KEYWORDS
+ +
mentry, widget, IPv6 address
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::putIPv6Addr Command

+ +
+
NAME
+ +
mentry::putIPv6Addr – Output an IPv6 address to a + mentry of type "IPv6Addr"
+ +
SYNOPSIS
+ +
+
+mentry::putIPv6Addr address pathName
+
+
+ +
DESCRIPTION
+ +
This command outputs the IPv6 address address to + the mentry widget pathName, which must have been + created with the mentry::ipv6AddrMentry command (this is + checked by examining the widget's type attribute, which + must have the value "IPv6Addr").
+ +
The address is expected to consist of up to eight + colon-separated groups of one to four hexadecimal digits each.  in + case of less than eight groups, the address must include exactly one + double-colon (::) (representing consecutive groups of + zeros).  The command generates an error if the address is + invalid.
+ +
KEYWORDS
+ +
mentry, widget, IPv6 address
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::getIPv6Addr Command

+ +
+
NAME
+ +
mentry::getIPv6Addr – Get an IPv6 address from a + mentry of type "IPv6Addr"
+ +
SYNOPSIS
+ +
+
+mentry::getIPv6Addr pathName
+
+
+ +
DESCRIPTION
+ +
This command returns the IPv6 address contained in the mentry widget + pathName, which must have been created with the + mentry::ipv6AddrMentry + command (this is checked by examining the widget's type + attribute, which must have the value "IPv6Addr").
+ +
If any entry child of the widget is empty, the command sets + the focus to the first such entry, generates an error, and returns the + string "EMPTY".
+ +
KEYWORDS
+ +
mentry, widget, IPv6 address
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/mentryThemes.html Index: embedded/www/tklib/files/modules/mentry/mentryThemes.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentryThemes.html @@ -0,0 +1,266 @@ + + + + Commands Related to Tile Themes + + + + + + + + +
+

Commands Related to Tile Themes

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The commands described in this reference page should only be invoked when + using the package Mentry_tile.  They enable you to set and query the + current theme, to retrieve a list of the available themes, and to make sure + that your widgets will have a theme-specific appearance.

+ +
+

Contents     Start page

+
+ +
+ +

The mentry::setTheme Command

+ +
+
NAME
+ +
mentry::setTheme – Set the current theme
+ +
SYNOPSIS
+ +
+
+mentry::setTheme theme
+
+
+ +
DESCRIPTION
+ +
This command sets the current theme to theme, + loading it if necessary.  It is simply an alias for + ttk::setTheme or tile::setTheme, + depending on the tile version loaded into the interpreter.  (The + tile::setTheme command was renamed to + ttk::setTheme in tile version 0.8.)
+ +
Being just an alias for a tile library procedure, the + mentry::setTheme command does exactly the same as the + original one: It loads the package implementing the given theme if needed, + sets the theme to the specified one, and saves the latter in the variable + ttk::currentTheme or + tile::currentTheme, depending on the current tile + version.
+ +
KEYWORDS
+ +
mentry, theme, tile
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::getCurrentTheme + Command

+ +
+
NAME
+ +
mentry::getCurrentTheme – Get the current theme
+ +
SYNOPSIS
+ +
+
+mentry::getCurrentTheme
+
+
+ +
DESCRIPTION
+ +
This command returns the value of the variable + ttk::currentTheme or + tile::currentTheme, depending on the tile version + loaded into the interpreter.  (The namespace containing the variable + currentTheme was changed in tile version 0.8 from + tile to ttk.)
+ +
KEYWORDS
+ +
mentry, theme, tile
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::getThemes Command

+ +
+
NAME
+ +
mentry::getThemes – Get the themes registered in the + package database
+ +
SYNOPSIS
+ +
+
+mentry::getThemes
+
+
+ +
DESCRIPTION
+ +
This command returns a list of the themes registered in the package + database.  It is simply an alias for ttk::themes + or tile::availableThemes, depending on the tile version + loaded into the interpreter.  (The + tile::availableThemes command was renamed to + ttk::themes in tile version 0.8.)
+ +
KEYWORDS
+ +
mentry, theme, tile
+
+ +
+

Contents     Start page

+
+ +
+ +

The mentry::setThemeDefaults + Command

+ +
+
NAME
+ +
mentry::setThemeDefaults – Set theme-specific + default values of some mentry configuration options
+ +
SYNOPSIS
+ +
+
+mentry::setThemeDefaults
+
+
+ +
DESCRIPTION
+ +
This command populates the array + mentry::themeDefaults with theme-specific default + values of a series of Mentry configuration options.  The array names + are the command-line names of the options, and the corresponding array + values are the default values of these configuration options for the + currently set tile theme.
+ +
The options whose names and values are written into the + array mentry::themeDefaults are: + -background, -foreground, and + -font.  In addition, the command sets some other + array elements to theme-specific default values, needed for internal + purposes, like updating the background and foreground colors of the label + components of a mentry widget in disabled or + readonly state; the corresponding array names are: + -disabledbackground, + -disabledforeground, and + -readonlybackground.  Finally, the array values + associated with the names -selectbackground, + -selectforeground, and + -selectborderwidth are not used by Mentry_tile, but + might prove useful for other purposes, as described below.
+ +
The mentry::setThemeDefaults command is + invoked by Mentry_tile automatically whenever a mentry widget is createad + or the <<ThemeChanged>> virtual event is + received by a mentry widget.  In the latter case, the widget is + reconfigured, using the new default values of those options that were not + set explicitly to values different from the corresponding defaults.
+ +
Besides being used by the Mentry_tile code, this command can + also be invoked in Tcl scripts, still before creating any tile-based mentry + widget.  By calling it explicitly and using the values written by it + into the array mentry::themeDefaults, you can make sure + that classical Tk widgets, e.g., text, will have a theme-specific + appearance, just like the tile widgets.  For example, you can add some + common configuration options to the option database as follows:
+ +
+
+
+mentry::setThemeDefaults
+option add *Text.background   $mentry::themeDefaults(-background)
+option add *Text.foreground   $mentry::themeDefaults(-foreground)
+option add *Font              $mentry::themeDefaults(-font)
+option add *selectBackground  $mentry::themeDefaults(-selectbackground)
+option add *selectForeground  $mentry::themeDefaults(-selectforeground)
+option add *selectBorderWidth $mentry::themeDefaults(-selectborderwidth)
+
+
+
+ +
KEYWORDS
+ +
mentry, theme, tile
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/mentryWidget.html Index: embedded/www/tklib/files/modules/mentry/mentryWidget.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/mentryWidget.html @@ -0,0 +1,939 @@ + + + + The mentry::mentry Command + + + + + + + + +
+

The mentry::mentry Command

+ +

For Mentry Version 3.10

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Quick Reference

+ +
+
NAME
+ +
mentry::mentry – Create and manipulate multi-entry + widgets
+ +
SYNOPSIS
+ +
+
+mentry::mentry pathName ?options?
+
+
+ +
DESCRIPTION
+ +
STANDARD OPTIONS
+ +
+
+-borderwidth          -highlightcolor      -relief
+-highlightbackground  -highlightthickness
+
+
+ +
OPTIONS FOR ALL ENTRY AND LABEL + CHILDREN
+ +
+
+-background  -cursor  -font  -foreground
+
+
+ +
OPTIONS FOR ALL ENTRY CHILDREN
+ +
+
+-exportselection    -insertwidth        -selectforeground
+-insertbackground   -invalidcommand     -show
+-insertborderwidth  -justify            -state
+-insertofftime      -selectbackground   -validate
+-insertontime       -selectborderwidth  -validatecommand
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
-body {width ?text + width text ...?}
+ +
-disabledbackground + color
+ +
-disabledforeground + color
+ +
-readonlybackground + color
+ +
-takefocus + 0|1|""|command
+ +
-textvariable + array
+ +
INDICES
+ +
+
+number  end
+
+
+ +
WIDGET COMMAND
+ +
pathName adjustentry + index string
+ +
pathName attrib ?name? + ?value name value ...?
+ +
pathName cget + option
+ +
pathName clear first + ?last?
+ +
pathName configure + ?option? ?value option value ...?
+ +
pathName entries
+ +
pathName entrycount
+ +
pathName entrylimit + index
+ +
pathName entrypath + index
+ +
pathName getarray + array
+ +
pathName getlist
+ +
pathName getstring
+ +
pathName hasattrib + name
+ +
pathName isempty + ?index?
+ +
pathName isfull + ?index?
+ +
pathName labelcount
+ +
pathName labelpath + index
+ +
pathName labels
+ +
pathName put startIndex + ?string string ...?
+ +
pathName setentryextrawidth index + amount
+ +
pathName setentryfont + index font
+ +
pathName setentrywidth + index width
+ +
pathName unsetattrib + name
+ +
DEFAULT BINDINGS
+ +
KEYWORDS
+ +
mentry, widget, entry, label
+
+ +
+

Contents     Start page

+
+ +
+ +

Detailed Reference

+ +
+
NAME
+ +
mentry::mentry – Create and manipulate multi-entry + widgets
+ +
SYNOPSIS
+ +
+
+mentry::mentry pathName ?options?
+
+
+ +
DESCRIPTION
+ +
The mentry::mentry command creates a new window + named pathName and of the class + Mentry, and makes it into a mentry widget.  + Additional options, described below, may be specified on the command line + or in the option database to configure aspects of the mentry such as its + colors, font, and children.  The mentry::mentry + command returns its pathName argument.  At the + time this command is invoked, there must not exist a window named + pathName, but pathName's parent + must exist.
+ +
The word mentry is an abbreviation of + multi-entry.  A mentry is a mega-widget consisting of any + number of entries separated by labels, all embedded in a frame.  Due + to appropriately chosen configuration options for the entries and labels, a + mentry widget looks like one single entry containing preinserted text + pieces that cannot be moved, changed, or deleted by the user.
+ +
The initial width of each entry child (specified by the + -body configuration option) also + determines the maximal number of characters that can be inserted into + it.  This is achieved with the aid of the wcb::callback command, by registering + the wcb::checkEntryLen + before-insert callback with the entry child.  In + order to keep this callback, additional before-insert + callbacks (if needed) should only be registered with the wcb::cbappend and wcb::cbprepend commands.  When + reaching this limit in an entry having the input focus, the latter is set + automatically to the next enabled entry child, the contents of that widget + is selected, and the insertion cursor is set to its end.  This is made + sure by defining an appropriate after-insert callback, + which must be kept to be the last such callback for the entry.  For + this reason, additional after-insert callbacks (if + needed) should only be registered with the + wcb::cbprepend command.  The same command should + be used exclusively to define after-motion callbacks + (if needed), because mentry::mentry registers one that + must be the last after-motion callback for each entry + child.
+ +
Each mentry widget may have any number of attributes, + which can be used in commands that create or manipulate mentry widgets for + particular purposes.  For example, each date mentry created by the + mentry::dateMentry command + has a type attribute having the value + "Date" and a format attribute specifying + the meanings of its components.  The values of these attributes are + queried and used in the bodies of the procedures mentry::putClockVal and + mentry::getClockVal.
+ +
STANDARD OPTIONS
+ +
+
+-borderwidth          -highlightcolor      -relief
+-highlightbackground  -highlightthickness
+
+
+ +
See the options manual entry for details on the standard Tk + widget options.  These options are only supported by the Mentry + package, but not by Mentry_tile.
+ +
OPTIONS FOR ALL ENTRY AND LABEL + CHILDREN
+ +
+
+-background  -cursor  -font  -foreground
+
+
+ +
These options (described in the options manual entry) specify + the values of the options of the same names for all entry and label + children of the given multi-entry widget.  These values may be changed + for an individual child by using the configure + subcommand of the Tcl command corresponding to that child.  However, + applying this method to change the font of an entry child of a tile-based + mentry widget might break the latter's appearance (this has tile-related + technical reasons).  To avoid this problem, it is recommended to use + the setentryfont subcommand + of the Tcl command associated with the mentry widget for changing the value + of the -font option of one of its entry children.
+ +
When using the package Mentry_tile, these options have + theme-specific default values.  The common abbreviations + -bg (for -background) and + -fg (for -foreground) are supported + for both classical and tile-based mentry widgets.
+ +
REMARK:  Please take into account that for some + themes (like Arc, plastik, + tileqt, vista, and + xpnative), the -background option + will be ignored for the entry children of a tile-based mentry widget.
+ +
OPTIONS FOR ALL ENTRY + CHILDREN
+ +
+
+-exportselection    -insertwidth        -selectforeground
+-insertbackground   -invalidcommand     -show
+-insertborderwidth  -justify            -state
+-insertofftime      -selectbackground   -validate
+-insertontime       -selectborderwidth  -validatecommand
+
+
+ +
These options specify the values of the options of the same names for + all entry children of the given multi-entry widget.  These values may + be changed for an individual entry child by using the + configure subcommand of the Tcl command corresponding + to that entry.  The -invalidcommand, + -validate, and -validatecommand + options are only supported if Tk version 8.3 or higher is used, because the + options of the same names for entry widgets were introduced in Tk + 8.3.  The options -insertbackground, + -insertborderwidth, -insertofftime, + -insertontime, -insertwidth, + -selectbackground, + -selectborderwidth, and + -selectforeground are only supported by the Mentry + package, but not by Mentry_tile.  The common abbreviations + -invcmd (for -invalidcommand) and + -vcmd (for -validatecommand) are + supported for both classical and tile-based mentry widgets.
+ +
WIDGET-SPECIFIC OPTIONS
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -body
Database Name: body
Database Class: Body
+ +
+

Specifies the initial widths of the entry children of the given + multi-entry widget, as well as the texts to be displayed in the labels + separating the entries.  The value of this option is viewed as a + list.  Each odd-numbered element is interpreted as the value of + the -width configuration option of an entry child, + while each even-numbered element represents the value of the + -text configuration option of a label child.  + That is, each entry width must be followed by a label text, except for + the last one, for which a corresponding label text is optional.  + The order of the list elements determines the creation order of the + child widgets; these will be packed in a row, without any horizontal + padding.  The initial width of each entry child also determines + the number of characters that can be inserted into it; this maximal + length remains unchanged even if the entry's width is set to a new + value later on.

+ +

The width of an entry child and the text displayed in a label may be + changed by using the configure subcommand of the + Tcl command corresponding to that child.  However, applying this + method to change the width of of an entry child of a tile-based mentry + widget might break the latter's appearance (this has tile-related + technical reasons).  To avoid this problem, it is recommended to + use the setentrywidth + subcommand of the Tcl command associated with the mentry widget for + changing the value of the -width option of one of + its entry children.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -disabledbackground
Database Name: disabledBackground
Database Class: DisabledBackground
+ +
+

This option, which is only supported for Tk versions 8.4 or higher, + specifies the background color to use for all entry and label children + of the given multi-entry widget when it is disabled.  If the value + of this option is the empty string then the normal background color is + used.  This option is only supported by the Mentry package, but + not by Mentry_tile.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -disabledforeground
Database Name: disabledForeground
Database Class: DisabledForeground
+ +
+

This option, which is only supported for Tk versions 8.4 or higher, + specifies the foreground color to use for all entry and label children + of the given multi-entry widget when it is disabled.  If the value + of this option is the empty string then the normal foreground color is + used.  This option is only supported by the Mentry package, but + not by Mentry_tile.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -readonlybackground
Database Name: readonlyBackground
Database Class: ReadonlyBackground
+ +
+

This option, which is only supported for Tk versions 8.4 or higher, + specifies the background color to use for all entry and label children + of the given multi-entry widget when it is readonly.  If the value + of this option is the empty string then the normal background color is + used.  This option is only supported by the Mentry package, but + not by Mentry_tile.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -takefocus
Database Name: takeFocus
Database Class: TakeFocus
+ +
+

This option determines whether the widget accepts the focus during + keyboard traversal.  It is almost identical to the standard option + of the same name (see the options manual entry for + details).  The only difference is that not the widget itself but + its first enabled entry child will receive the focus during keyboard + traversal with the standard keys (Tab and + Shift-Tab).  See the DEFAULT + BINDINGS section below for information on how to move the focus + from one entry child to another using the keyboard.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -textvariable
Database Name: textvariable
Database Class: Variable
+ +
+

If the value of this option is not an empty string then it must be + an array.  In this case, for each entry child of the given + multi-entry widget the value of the array element with the index of the + entry as element name specifies the value of the + -textvariable option for that entry.  The + entry indices start with 0.  For example, + specifying  -textvariable arr  for a multi-entry + widget having two entry children is equivalent to specifying  + -textvariable arr(0)  for the first and  + -textvariable arr(1)  for the second entry child of + that widget.

+
+
+ +
INDICES
+ +
Some of the widget commands for mentries take an index as + argument.  An index specifies a particular entry or label child of the + mentry, in any of the following ways:
+ +
+ + + + + + + + + + +
number  Specifies the child as a numerical index, where 0 + corresponds to the first entry or label child.
endIndicates the last entry or label child of the mentry.
+
+ +
The word end can be abbreviated as + en or e.  Out-of-range indices + are automatically rounded to the nearest legal value.
+ +
WIDGET COMMAND
+ +
+ The mentry::mentry command creates a new Tcl command + whose name is pathName.  This command may be + used to invoke various operations on the widget.  It has the + following general form: + +
+
+pathName option ?arg arg ...?
+
+
+
+ +
option and the args determine + the exact behavior of the command.  The following commands are + possible for mentry widgets:
+ +
+
+
pathName + adjustentry index string
+ +
Increases the width in pixels of the entry child identified by + index if needed, to make it just large enough for + texts of the child-specific maximal length, consisting of characters + contained in the string argument.  Returns an + empty string.
+ +
For example, when constructing a mentry widget whose + components will accept up to two uppercase hexadecimal digits only, by + passing the string "0123456789ABCDEF" to this subcommand + you can make sure that the entry children will have optimal widths, + just large enough to display not only the decimal digits, but also up + to two letters in the range A - F (which need + more room than the decimal digits when using a proportionally-spaced + font).  It is recommended to invoke this subcommand even if the + allowed characters are restricted to the digits 0 - + 9 only, because in some fonts not all decimal digits have + the same width.
+ +
pathName attrib + ?name? ?value name value ...?
+ +
Queries or modifies the attributes of the widget.  If no + name is specified, the command returns a list of + pairs, each of which contains the name and the value of an attribute + for pathName.  If name is + specified with no value, then the command returns + the value of the one named attribute, or an empty string if no + corresponding value exists (you can use the hasattrib subcommand to distinguish this + case from the one that the value of an existing attribute is an + empty string).  If one or more + name-value pairs are specified, + then the command sets the given widget attribute(s) to the given + value(s); in this case the return value is an empty string.  + name may be an arbitrary string.
+ +
pathName cget + option
+ +
Returns the current value of the configuration option given by + option, which may have any of the values accepted + by the mentry::mentry command.
+ +
pathName clear + first ?last?
+ +
Erases the contents of one or more entry children of the + widget.  first and last + are indices specifying the first and last entries in the range to + clear.  If last is not specified then it + defaults to first, i.e., a single entry child is + cleared.  The return value is an empty string.
+ +
pathName configure + ?option? ?value option value + ...?
+ +
Queries or modifies the configuration options of the widget.  + If no option is specified, the command returns a + list describing all of the available options for + pathName (see Tk_ConfigureInfo + for information on the format of this list).  If + option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given widget option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + accepted by the mentry::mentry command.
+ +
pathName + entries
+ +
Returns a list containing the path names of all entry children of + the widget.
+ +
pathName + entrycount
+ +
Returns the number of all entry children of the widget.
+ +
pathName entrylimit + index
+ +
Returns the number of characters that can be inserted into the + entry child identfied by index.
+ +
pathName entrypath + index
+ +
Returns the path name of the entry child identfied by + index.
+ +
pathName getarray + array
+ +
For each entry child of the widget, the command assigns the string + contained in the entry to the element of array + having the index of the entry as element name.  The entry indices + start with 0.  The return value is an empty + string.
+ +
pathName + getlist
+ +
Returns a list containing the strings of all entry children of the + widget.
+ +
pathName + getstring
+ +
Returns a string built by concatenating the strings contained in + the entry children of the widget with the texts displayed in the labels + separating the entries, in the creation order of the children, as given + by the -body configuration + option.  That is, the string of the first entry child is followed + by the text of the first label, which in turn is followed by the string + of the second entry, and so on.
+ +
pathName hasattrib + name
+ +
Returns 1 if the attribute name + exists and 0 otherwise.
+ +
pathName isempty + ?index?
+ +
If index is specified then the command returns + the value 1 if the string contained in the entry child + identfied by index is empty and 0 + otherwise.  If this optional argument is not present then the + command returns the value 1 if the strings contained in + the entry children of the widget are all empty and 0 + otherwise.
+ +
pathName isfull + ?index?
+ +
If index is specified then the command returns + the value 1 if the length of the string contained in the + entry child identfied by index equals the number of + characters that can be inserted into the entry and 0 + otherwise.  If this optional argument is not present then the + command returns the value 1 if the lengths of the strings + contained in the entry children of the widget all equal the numbers of + characters that can be inserted into the respective entries (i.e., if + all entry children are full) and 0 otherwise.
+ +
pathName + labelcount
+ +
Returns the number of all label children of the widget.
+ +
pathName labelpath + index
+ +
Returns the path name of the label child identfied by + index.
+ +
pathName + labels
+ +
Returns a list containing the path names of all label children of + the widget.
+ +
pathName put + startIndex ?string string ...?
+ +
Replaces the texts of the entry children whose indices are greater + than or equal to startIndex with the corresponding + string arguments by using the + delete and insert operations, + until either the entries or the strings are + consumed.  If one of these subcommands gets canceled by some + before-callback in any entry child then the command restores the + original contents of all affected entries and returns the value + 0, otherwise it returns 1.  In both + cases, the command keeps the position of the insertion cursor in all + entry children.
+ +
pathName + setentryextrawidth index amount
+ +
Specifies additonal width to provide for the entry child identified + by indexamount may have + any of the standard forms for screen distances (e.g., a number of + pixels).  The return value is an empty string.
+ +
Notice that changing the width of an entry child has no + impact on the number of characters that can be inserted into it, which + remains set to the corresponding component of the value of the mentry's + -body option.
+ +
pathName + setentryfont index font
+ +
Sets the font of the entry child identified by + index to the value given by + font.  This is done by invoking the + configure subcommand of the Tcl command + corresponding to the entry.  When using the package Mentry_tile, + this command also performs some additional steps necessary for updating + the appearance of the tile-based mentry widget.  The return value + is an empty string.
+ +
pathName + setentrywidth index width
+ +
Sets the width of the entry child identified by + index to the number of characters given by + width.  This is done by invoking the + configure subcommand of the Tcl command + corresponding to the entry.  When using the package Mentry_tile, + this command also performs some additional steps necessary for updating + the appearance of the tile-based mentry widget.  The return value + is an empty string.
+ +
Notice that changing the width of an entry child has no + impact on the number of characters that can be inserted into it, which + remains set to the corresponding component of the value of the mentry's + -body option.
+ +
pathName + unsetattrib name
+ +
Unsets the attribute name.  Returns an + empty string.
+
+
+ +
DEFAULT BINDINGS
+ +
The mentry::mentry command partially redefines the + bindings of the children of the mentry widget it creates:
+ +
+
    +
  1. Clicking mouse button 1 in a label child positions the + insertion cursor to the end of the last enabled entry preceding the + label, sets the input focus to that entry, and clears any selection in + it.
  2. + +
  3. If in a non-empty entry child a character is typed that + is contained in the label following that entry (if any), then the focus + is moved to the next enabled entry child, the contents of that entry + are selected, and the insertion cursor is set to its end.
  4. + +
  5. At the beginning of an entry child that is not the first + enabled entry within the widget, the Left key clears the + selection in that entry, moves the focus to the previous enabled entry + child, and sets the insertion cursor to the end of that widget.  + Similarly, at the end of an entry child that is not the last enabled + entry within the widget, the Right key clears the + selection in that entry, moves the focus to the next enabled entry + child, and sets the insertion cursor to the beginning of that + widget.  If tk_strictMotif is false then + Control-b and Control-f behave the same as + Left and Right, respectively.
  6. + +
  7. In an entry child that is not the first enabled entry + within the widget, Control-Left moves the focus to the + previous enabled entry child, selects the contents of that widget, and + sets the insertion cursor to its end; if there is no enabled entry + child to the left of the current one then Control-Left + moves the insertion cursor to the beginning of the current entry and + clears the selection in that widget.  Similarly, in an entry child + that is not the last enabled entry within the widget, + Control-Right moves the focus to the next enabled entry + child, selects the contents of that widget, and sets the insertion + cursor to its end; if there is no enabled entry child to the right of + the current one then Control-Right moves the insertion + cursor to the end of the current entry and clears the selection in that + widget.  If tk_strictMotif is false then + Meta-b and Meta-f behave the same as + Control-Left and Control-Right, + respectively.
  8. + +
  9. The Home key clears the selection in the + current entry widget, moves the focus to the first enabled entry child, + and sets the insertion cursor to the beginning of that widget.  + Similarly, the End key clears the selection in the current + entry widget, moves the focus to the last enabled entry child, and sets + the insertion cursor to the end of that widget.  If + tk_strictMotif is false then Control-a + and Control-e behave the same as Home and + End, respectively.
  10. + +
  11. Shift-Home moves the focus to the first + enabled entry child, sets the insertion cursor to the beginning of that + widget, and either extends the selection to that position, or clears + the selection in the current entry and selects the contents of the new + widget, depending upon whether the current entry is the first enabled + entry child or not.  Similarly, Shift-End moves the + focus to the last enabled entry child, sets the insertion cursor to the + end of that widget, and either extends the selection to that position, + or clears the selection in the current entry and selects the contents + of the new widget, depending upon whether the current entry is the last + enabled entry child or not.
  12. + +
  13. The BackSpace key deletes the selection if + there is one in the current entry.  Otherwise, it deletes either + the character to the left of the insertion cursor in the current entry, + or the last character of the previous enabled entry child.  The + latter takes place at the beginning of an entry child that is not the + first enabled entry within the widget; in this case, the + BackSpace key also moves the focus to the previous enabled + entry child and sets the insertion cursor to its end.  If + tk_strictMotif is false then Control-h + behaves the same as BackSpace.
  14. + +
  15. If tk_strictMotif is false then + Meta-d deletes all characters to the right of the + insertion cursor within the current entry, while + Meta-BackSpace and Meta-Delete delete either + all characters to the left of the insertion cursor in the current + entry, or the contents of the previous enabled entry child.  The + latter takes place at the beginning of an entry child that is not the + first enabled entry within the widget; in this case, + Meta-BackSpace and Meta-Delete also clear the + selection in the current entry widget and move the focus to the + previous enabled entry child.
  16. +
+
+ +
KEYWORDS
+ +
mentry, widget, entry, label
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/mentry/phonenumber.png Index: embedded/www/tklib/files/modules/mentry/phonenumber.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/phonenumber.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/mentry/phonenumber_tile.png Index: embedded/www/tklib/files/modules/mentry/phonenumber_tile.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/phonenumber_tile.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/mentry/stylesheet.css Index: embedded/www/tklib/files/modules/mentry/stylesheet.css ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/mentry/stylesheet.css @@ -0,0 +1,12 @@ +/* generic class defining a top margin whose height equals the font size */ +.tm {margin-top: 1em} + +/* background, border, and padding for the
 tag */
+pre {background: #F7F7F7; border: silver solid 1px; padding: 1px}
+
+/* background for the  tag */
+body {background: #FFFFFF}
+
+/* color for the  tag */
+span.red {color: #E00000}
+span.cmt {color: #36648b}

ADDED   embedded/www/tklib/files/modules/mentry/wcbRef.html
Index: embedded/www/tklib/files/modules/mentry/wcbRef.html
==================================================================
--- /dev/null
+++ embedded/www/tklib/files/modules/mentry/wcbRef.html
@@ -0,0 +1,1103 @@
+
+
+
+  Wcb Command Reference
+
+  
+  
+
+  
+
+
+
+  
+

Wcb Command Reference

+ +

For Wcb Version 3.6

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The wcb::callback Command

+ +
+
NAME
+ +
wcb::callback – Retrieve, set, and remove widget + callbacks
+ +
SYNOPSIS
+ +
+
+wcb::callback widgetName before|after option ?callback callback ...?
+
+
+ +
DESCRIPTION
+ +
Retrieves, sets, or removes the callbacks for the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, tile combobox, listbox, tablelist, tile + treeview, text, or ctext widget widgetName, the + argument before or after, and the + command corresponding to option.  The values of + the option argument can be:
+ +
+
    +
  • insert, delete, or + motion, for a Tk or tile entry, BWidget Entry, Tk + or tile spinbox, tile combobox, text, or ctext widget;
  • + +
  • replace, for a text or ctext widget;
  • + +
  • activate, for a listbox, tablelist, or tile + treeview widget;
  • + +
  • selset or selclear, for a + listbox, tablelist, tile treeview, text, or ctext widget;
  • + +
  • seladd or seltoggle, for a + tile treeview widget;
  • + +
  • activatecell, cellselset, + or cellselclear, for a tablelist widget.
  • +
+
+ +
If no arguments after the option + parameter are specified, then the procedure just returns the current + before- or after-callback list, respectively, for the given widget + operation.
+ +
Otherwise:
+ +
+
    +
  • +

    If at least one of the arguments following the + option parameter is a nonempty string, then:

    + +
      +
    • if called for the first time for this widget with at least one + nonempty argument following the option + parameter, then the procedure renames the Tcl command + widgetName to _widgetName + and builds a new procedure widgetName, in which + the execution of the widget operations associated with the above + values of option is preceded by invocations of + the corresponding before-callbacks and followed by calls to the + corresponding after-callbacks, in the global scope;
    • + +
    • it sets the callback list to the one built from + these arguments and returns the new list.
    • +
    +
  • + +
  • If all arguments following the + option parameter are empty, then the procedure + unregisters all the corresponding before- or after-callbacks for the + given widget and returns an empty string.
  • +
+
+ +
When a callback is invoked, the name of the original Tcl + command for the widget widgetName as well as the + command arguments are automatically appended to it as parameters.
+ +
The following table shows the widget subcommands + corresponding to the above values of option, together + with the arguments of these subcommands:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WidgetoptionSubcommandArguments
Tk entry, ttk::entry,
+ BWidget Entry,
+ Tk spinbox, ttk::spinbox,
+ or ttk::combobox
insertinsertindex string
deletedeletefrom ?to?
motionicursorindex
listboxactivateactivateindex
selsetselection setfirst ?last?
selclearselection clearfirst ?last?
tablelist::tablelistactivateactivateindex
selsetselection setfirst ?last?
selclearselection clearfirst ?last?
activatecellactivatecellcellIndex
cellselsetcellselection setfirst ?last?
cellselclearcellselection clearfirst ?last?
ttk::treeviewactivatefocusitem
selsetselection setitemList
seladdselection additemList
selclearselection removeitemList
seltoggleselection toggleitemList
text or ctextinsertinsertindex string ?tagList string + tagList ...?
deletedeletefrom ?to?
replacereplacefrom to string ?tagList + string tagList ...?
motionmark set insertindex
selsettag add selfrom ?to from to + ...?
selcleartag remove selfrom ?to from to + ...?
+
+ +
REMARKS:
+ +
+
    +
  1. You may abbreviate the words before, + after, insert, + delete, replace, + motion, and activate (the + latter not for tablelist widgets) to a minimum of one character.  + Similarly, the first four characters of the words + selset, selclear, + seladd, and seltoggle, the + first eight characters of cellselset and + cellselclear, and the first nine characters of + activatecell are sufficient for Wcb to recognize + these options.
  2. + +
  3. After a successful invocation of this command with at + least one nonempty callback following the option + argument, you can use either the new procedure + widgetName or the original Tcl command + _widgetName to perform any valid operation on the + widget widgetName.  Use the old Tcl command + _widgetName if you want to prevent the callbacks + from being invoked when executing the respective widget + subcommand.
  4. + +
  5. When destroying a widget widgetName + for which wcb::callback has replaced the + corresponding Tcl command with a new procedure, the original command + _widgetName is deleted automatically by the Tcl + interpreter (this is not true in the case of a BWidget Entry, + tablelist, or ctext widget).  The new widget procedure + widgetName would persist, but Wcb arranges for it + to be deleted from within a cleanup script bound to the + <Destroy> event.  This cleanup script is + associated with a binding tag called WcbCleanup, + which is appended to the list of binding tags of the widget the first + time when registering some callbacks for it.  (In the case of a + BWidget Entry, tablelist, or ctext widget, this script also deletes the + original Tcl command _widgetName.)
  6. + +
  7. The cleanup script mentioned above also unregisters all + callbacks defined for widgetName, thus ensuring + that a widget with the same path created later will not inherit them + from the widget just deleted (this can be important in some + applications).  For this reason, you should be careful not to + remove WcbCleanup from the list of binding tags of + the given widget!
  8. +
+
+ +
KEYWORDS
+ +
callback, widget, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile + spinbox, tile combobox, listbox, tablelist, tile treeview, text, ctext
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::cbappend Command

+ +
+
NAME
+ +
wcb::cbappend – Append to a callback list
+ +
SYNOPSIS
+ +
+
+wcb::cbappend widgetName before|after option ?callback callback ...?
+
+
+ +
DESCRIPTION
+ +
This command is almost identical to wcb::callback.  The only difference is that + wcb::cbappend appends the arguments specified + after the option parameter to the current callback list + (if present), while wcb::callback replaces the + old callbacks with these arguments.
+ +
KEYWORDS
+ +
callback, append, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::cbprepend Command

+ +
+
NAME
+ +
wcb::cbprepend – Prepend to a callback list
+ +
SYNOPSIS
+ +
+
+wcb::cbprepend widgetName before|after option ?callback callback ...?
+
+
+ +
DESCRIPTION
+ +
This command is almost identical to wcb::callback.  The only difference is that + wcb::cbprepend prepends the arguments specified + after the option parameter to the current callback list + (if present), while wcb::callback replaces the + old callbacks with these arguments.
+ +
KEYWORDS
+ +
callback, prepend, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::cancel Command

+ +
+
NAME
+ +
wcb::cancel – Cancel a widget command
+ +
SYNOPSIS
+ +
+
+wcb::cancel ?script?
+
+
+ +
DESCRIPTION
+ +
This procedure is designed to be invoked from a before-callback for a + widget command.  It cancels the execution of that command and of the + remaining callbacks, and evaluates the script argument + in the global scope.  If this argument is not specified, it defaults + to the bell command.
+ +
The return value is the one obtained from + script if this argument is specified and + nonempty.  Otherwise, the command returns an empty string.
+ +
KEYWORDS
+ +
cancel, command, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::canceled Command

+ +
+
NAME
+ +
wcb::canceled – Query the canceled status of a + widget command
+ +
SYNOPSIS
+ +
+
+wcb::canceled widgetName option
+
+
+ +
DESCRIPTION
+ +
Returns the value 1 if the most recent invocation of the + widget operation corresponding to widgetName and + option has been aborted by some before-callback by + invoking wcb::cancel; otherwise, + the return value is 0.  The arguments must fulfil the + same restrictions as in the case of the wcb::callback command.
+ +
KEYWORDS
+ +
cancel, command, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::extend Command

+ +
+
NAME
+ +
wcb::extend – Extend the argument list of a widget + command
+ +
SYNOPSIS
+ +
+
+wcb::extend ?arg arg ...?
+
+
+ +
DESCRIPTION
+ +
This procedure is designed to be invoked from a before-callback for a + widget command.  It appends the values given in the optional + arg parameters to the argument list of that + command.  The new argument list will be passed to the remaining + callbacks for that command, too.
+ +
This procedure simply passes its parameters to the + lappend command, called for the argument list of the + respective widget operation.
+ +
KEYWORDS
+ +
extend, argument, command, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::replace Command

+ +
+
NAME
+ +
wcb::replace – Replace arguments of a widget command + with new ones
+ +
SYNOPSIS
+ +
+
+wcb::replace first last ?arg arg ...?
+
+
+ +
DESCRIPTION
+ +
This procedure is designed to be invoked from a before-callback for a + widget command.  It replaces the arguments having the indices + first through last of that command + with the optional arg parameters.  The new + argument list will be passed to the remaining callbacks for that command, + too.  The arguments are numbered from 0 (see the table in the description of the wcb::callback command).
+ +
This procedure simply passes its parameters to the + lreplace command, called for the argument list of the + respective widget operation.
+ +
KEYWORDS
+ +
replace, argument, command, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::pathname Command

+ +
+
NAME
+ +
wcb::pathname – Query the path name of the widget + corresponding to a Tcl command name
+ +
SYNOPSIS
+ +
+
+wcb::pathname origCmd
+
+
+ +
DESCRIPTION
+ +
This procedure returns the path name of the widget corresponding to the + Tcl command name origCmd passed to a callback.
+ +
When a before- or after-callback for a widget is invoked, + the name of the original Tcl command associated with that widget is + automatically appended to it as parameter.  This procedure can be used + within a callback to derive the path name of the widget from the command + name passed to the callback as argument.  It simply returns the string + range obtained from origCmd by removing the + "::_" prefix.
+ +
KEYWORDS
+ +
path name, command, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::changeEntryText + Command

+ +
+
NAME
+ +
wcb::changeEntryText – Change the text of a Tk or + tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget
+ +
SYNOPSIS
+ +
+
+wcb::changeEntryText widgetName string
+
+
+ +
DESCRIPTION
+ +
Replaces the text of the Tk or tile entry, BWidget Entry, Tk or tile + spinbox, or tile combobox widget widgetName with + string, by using the delete and + insert operations.  If the first subcommand is + canceled by some before-delete callback then the + procedure returns without inserting the new text; if the second operation + is canceled by some before-insert callback then the + command restores the original contents of the widget.
+ +
The procedure keeps the position of the insertion + cursor.  The return value is 1 on success and + 0 on failure, i.e., if one of the attempted operations was + canceled by some before-callback.
+ +
KEYWORDS
+ +
Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, tile + combobox, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::postInsertEntryLen + Command

+ +
+
NAME
+ +
wcb::postInsertEntryLen – Query the would-be length + of the text in a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or + tile combobox widget after text insertion
+ +
SYNOPSIS
+ +
+
+wcb::postInsertEntryLen widgetName string
+
+
+ +
DESCRIPTION
+ +
Returns the length of the text that would be contained in the Tk or + tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget + widgetName after inserting + string.
+ +
KEYWORDS
+ +
insert, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, + tile combobox, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::postInsertEntryText + Command

+ +
+
NAME
+ +
wcb::postInsertEntryText – Query the would-be text + of a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox + widget after text insertion
+ +
SYNOPSIS
+ +
+
+wcb::postInsertEntryText widgetName index string
+
+
+ +
DESCRIPTION
+ +
Returns the text that would be contained in the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, or tile combobox widget + widgetName after inserting string + before the character indicated by index.
+ +
KEYWORDS
+ +
insert, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, + tile combobox, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The wcb::postDeleteEntryText + Command

+ +
+
NAME
+ +
wcb::postDeleteEntryText – Query the would-be text + of a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox + widget after text deletion
+ +
SYNOPSIS
+ +
+
+wcb::postDeleteEntryText widgetName from ?to?
+
+
+ +
DESCRIPTION
+ +
Returns the text that would be contained in the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, or tile combobox widget + widgetName after deleting the characters starting with + the one indicated by the index from and stopping just + before to.  If to is not + specified then the return value is the text that would be contained in the + widget after deleting the single character given by + from.
+ +
REMARK:  This command has a variable number (2 + or 3) of arguments, because the delete subcommand of + the Tcl command associated with widgetName expects + either one or two indices as arguments.  For this reason, the correct + way to invoke this command from within a before-delete + callback is as shown in the following example:
+ +
+
+
+proc myBeforeDeleteCallback {w args} {
+    #
+    # Get the text that would be contained in the widget after
+    # deleting the characters specified by $args, which stands
+    # for the one or two arguments passed to delete; pass these
+    # arguments to wcb::postDeleteEntryText by expanding $args
+    #
+    set newText [eval [list wcb::postDeleteEntryText $w] $args]
+    if {!some_condition_on_$newText} {
+        wcb::cancel
+    }
+}
+
+
+
+ +
The following alternative, more elegant solution requires Tcl/Tk 8.5 or + later:
+ +
+
+
+proc myBeforeDeleteCallback {w args} {
+    # . . .
+    set newText [wcb::postDeleteEntryText $w {*}$args]
+    . . .
+}
+
+
+
+ +
KEYWORDS
+ +
delete, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, + tile combobox, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

Before-insert Callbacks for entry, + spinbox, and combobox Widgets

+ +
+
NAME
+ +
wcb::checkStrFor*, wcb::convStrTo*, + wcb::checkEntryFor*, wcb::checkEntryLen – + Before-insert callbacks for Tk entry, tile entry, + BWidget Entry, Tk spinbox, tile spinbox, and tile combobox widgets
+ +
SYNOPSIS
+ +
+
+wcb::checkStrForRegExp  exp w idx str
+
+wcb::checkStrForAlpha       w idx str
+wcb::checkStrForNum         w idx str
+wcb::checkStrForAlnum       w idx str
+
+wcb::convStrToUpper         w idx str
+wcb::convStrToLower         w idx str
+
+wcb::checkEntryForInt       w idx str
+wcb::checkEntryForUInt  max w idx str
+wcb::checkEntryForReal      w idx str
+wcb::checkEntryForFixed cnt w idx str
+
+wcb::checkEntryLen      len w idx str
+
+
+ +
DESCRIPTION
+ +
The wcb::checkStrForRegExp callback checks whether + the string str to be inserted into the Tk or tile + entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget + w is matched by the regular expression + exp; if not, it cancels the insert + operation.
+ +
The three other wcb::checkStrFor* + callbacks check whether the string str to be inserted + into the Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile + combobox widget w is alphabetic, numeric, or + alphanumeric, respectively; if not, they cancel the + insert operation.  These procedures just invoke + the callback wcb::checkStrForRegExp, passing to it the + Unicode-based patterns {^[[:alpha:]]*$}, + {^[[:digit:]]*$}, and {^[[:alnum:]]*$} for Tk + versions 8.1 or higher, and the ASCII patterns {^[A-Za-z]*$}, + {^[0-9]*$}, and {^[A-Za-z0-9]*$} if Tk version + 8.0 is being used.
+ +
The wcb::convStrTo* callbacks replace + the string str to be inserted into the Tk or tile + entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget + w with its uppercase or lowercase equivalent, + respectively.
+ +
The wcb::checkEntryFor* callbacks check + whether the text contained in the Tk or tile entry, BWidget Entry, Tk or + tile spinbox, or tile combobox widget w after inserting + the string str before the character indicated by the + index idx would represent (the starting part of) an + integer number, unsigned integer no greater than max, + real number, or real number in fixed-point format with at most + cnt digits after the decimal point, respectively; if + not, they cancel the insert operation.  + max and cnt should be nonnegative + numbers or *max = + *  means: no upper bound for the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, or tile combobox value, while  + cnt = *  stands for an unlimited number of + digits after the decimal point.
+ +
The wcb::checkEntryLen callback checks + whether the length of the text contained in the Tk or tile entry, BWidget + Entry, Tk or tile spinbox, or tile combobox widget w + after inserting the string str would be greater than + len; if yes, it cancels the insert + operation.
+ +
These callback procedures are implemented in the file + wcbEntry.tcl, contained in the + scripts directory.  They return an empty + string.
+ +
KEYWORDS
+ +
callback, insert, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile + spinbox, tile combobox, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

Before-insert Callbacks for text and + ctext Widgets

+ +
+
NAME
+ +
wcb::checkStrsFor*, wcb::convStrsTo* – + Before-insert callbacks for text and ctext widgets
+ +
SYNOPSIS
+ +
+
+wcb::checkStrsForRegExp exp w idx args
+
+wcb::checkStrsForAlpha      w idx args
+wcb::checkStrsForNum        w idx args
+wcb::checkStrsForAlnum      w idx args
+
+wcb::convStrsToUpper        w idx args
+wcb::convStrsToLower        w idx args
+
+
+ +
DESCRIPTION
+ +
The wcb::checkStrsForRegExp callback checks whether + the strings to be inserted into the text or ctext widget + w, contained in the list args of + the form  string ?tagList string + tagList ...?,  are matched by the regular expression + exp; if not, it cancels the insert + operation.
+ +
The three other wcb::checkStrsFor* + callbacks check whether the strings to be inserted into the text or ctext + widget w, contained in the list + args of the form  string + ?tagList string tagList ...?,  are + alphabetic, numeric, or alphanumeric, respectively; if not, they cancel the + insert operation.  These procedures just invoke + the callback wcb::checkStrsForRegExp, passing to it the + Unicode-based patterns {^[[:alpha:]\n]*$}, + {^[[:digit:]\n]*$}, and {^[[:alnum:]\n]*$} for Tk + versions 8.1 or higher, and the ASCII patterns + "^\[A-Za-z\n]*$", "^\[0-9\n]*$", and + "^\[A-Za-z0-9\n]*$" if Tk version 8.0 is being used (in this + case, the presence of the "\n" makes the regular expressions a + bit ugly).
+ +
The wcb::convStrsTo* callbacks replace + the strings to be inserted into the text or ctext widget + w, contained in the list args of + the form  string ?tagList string + tagList ...?,  with their uppercase or lowercase + equivalents, respectively.
+ +
These callback procedures are implemented in the file + wcbText.tcl, contained in the + scripts directory.  They return an empty + string.
+ +
KEYWORDS
+ +
callback, insert, text, ctext, widget
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/scrollutil/ScrollableFrmDemo1.png Index: embedded/www/tklib/files/modules/scrollutil/ScrollableFrmDemo1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/ScrollableFrmDemo1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/ScrollableFrmDemo2.png Index: embedded/www/tklib/files/modules/scrollutil/ScrollableFrmDemo2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/ScrollableFrmDemo2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/ScrolledTablelist.png Index: embedded/www/tklib/files/modules/scrollutil/ScrolledTablelist.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/ScrolledTablelist.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/ScrolledText.png Index: embedded/www/tklib/files/modules/scrollutil/ScrolledText.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/ScrolledText.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/SyncListboxes.png Index: embedded/www/tklib/files/modules/scrollutil/SyncListboxes.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/SyncListboxes.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/SyncTablelists.png Index: embedded/www/tklib/files/modules/scrollutil/SyncTablelists.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/SyncTablelists.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/TablelistConfig.png Index: embedded/www/tklib/files/modules/scrollutil/TablelistConfig.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/TablelistConfig.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/scrollutil/index.html Index: embedded/www/tklib/files/modules/scrollutil/index.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/index.html @@ -0,0 +1,44 @@ + + + + The Scrolling Utilities Package Scrollutil 1.5 + + + + + + + + +
+

The Scrolling Utilities Package Scrollutil 1.5

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Scrollutil Programmer's Guide

+ +

The scrollutil::scrollarea and + scrollutil::getscrollarea Commands

+ +

The scrollutil::scrollsync and + scrollutil::getscrollsync Commands

+ +

The + scrollutil::scrollableframe Command

+ +

Commands Related to Mouse Wheel Event + Handling

+ + ADDED embedded/www/tklib/files/modules/scrollutil/scrollableframe.html Index: embedded/www/tklib/files/modules/scrollutil/scrollableframe.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/scrollableframe.html @@ -0,0 +1,1040 @@ + + + + The scrollutil::scrollableframe Command + + + + + + + + +
+

The scrollutil::scrollableframe Command

+ +

For Scrollutil Version 1.5

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Quick Reference

+ +
+
NAME
+ +
scrollutil::scrollableframe – Create and manipulate + scrollableframe widgets
+ +
SYNOPSIS
+ +
+
+scrollutil::scrollableframe pathName ?options?
+
+
+ +
DESCRIPTION
+ +
STANDARD OPTIONS
+ +
+
+-background   -highlightbackground  -relief
+-borderwidth  -highlightcolor       -xscrollcommand
+-cursor       -highlightthickness   -yscrollcommand
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
-contentheight + screenDistance
+ +
-contentwidth + screenDistance
+ +
-fitcontentheight + boolean
+ +
-fitcontentwidth + boolean
+ +
-height screenDistance
+ +
-takefocus + 0|1|""|command
+ +
-width + screenDistance
+ +
-xscrollincrement + screenDistance
+ +
-yscrollincrement + screenDistance
+ +
WIDGET COMMAND
+ +
pathName cget + option
+ +
pathName configure + ?option? ?value option value ...?
+ +
pathName contentframe
+ +
+ pathName scan option + args + +
+
pathName scan mark x y
+ +
pathName scan dragto x y + ?gain?
+
+
+ +
pathName see widget + ?nw|ne|sw|se?
+ +
+ pathName xview + ?args? + +
+
pathName xview
+ +
pathName xview moveto + fraction
+ +
pathName xview scroll number + units|pages
+
+
+ +
+ pathName yview + ?args? + +
+
pathName yview
+ +
pathName yview moveto + fraction
+ +
pathName yview scroll number + units|pages
+
+
+ +
BINDINGS
+ +
KEYWORDS
+ +
scrollableframe, widget, frame, scrollable
+
+ +
+

Contents     Start page

+
+ +
+ +

Detailed Reference

+ +
+
NAME
+ +
scrollutil::scrollableframe – Create and manipulate + scrollableframe widgets
+ +
SYNOPSIS
+ +
+
+scrollutil::scrollableframe pathName ?options?
+
+
+ +
DESCRIPTION
+ +
The scrollutil::scrollableframe command creates a + new window named pathName and of the class + Scrollableframe, and makes it into a + scrollableframe widget.  Additional options, described below, + may be specified on the command line or in the option database to configure + aspects of the scrollableframe widget such as its width, height, and + scrolling increments.  The + scrollutil::scrollableframe command returns its + pathName argument.  At the time this command is + invoked, there must not exist a window named pathName, + but pathName's parent must exist.
+ +
A scrollableframe is a mega-widget containing a content + frame, whose dimensions may be larger than those of the widget + itself.  Arbitrary regions of this frame can be brought into view by + scrolling, being that the scrollableframe widget supports the + -xscrollcommand and -yscrollcommand + configuration options and the associated Tcl command has the + xview and yview subcommands.  The content frame may + contain any number of arbitrary widgets.  In other words, the + scrollutil::scrollableframe command implements a + scrollable widget container.
+ +
In the Scrollutil package both the scrollableframe widget + and its content frame are implemented as Tk core frames, while in + Scrollutil_tile they are ttk::frame widgets.  The content frame can be + accessed by means of the contentframe subcommand.  Individual + widgets contained in it can be made visible in the scrollableframe window + with the aid of the see + subcommand.  In addition to scrolling, scrollableframe widgets also + support scanning, with the aid of appropriate mouse event bindings that + invoke the scan subcommand.
+ +
+ A scrollableframe widget is typically created within a scrollarea, like in the following example: + +
+
+set sa [scrollutil::scrollarea ...]
+set sf [scrollutil::scrollableframe $sa.sf ...]
+$sa setwidget $sf
+
+set cf [$sf contentframe]
+<populate the content frame>
+
+update idletasks
+$sf configure -width [winfo reqwidth $cf] -height ... -yscrollincrement ...
+
+pack $sa -expand yes -fill both
+
+
+
+ +
STANDARD OPTIONS
+ +
+
+-background   -highlightbackground  -relief
+-borderwidth  -highlightcolor       -xscrollcommand
+-cursor       -highlightthickness   -yscrollcommand
+
+
+ +
See the options manual entry for details on the standard Tk + widget options.  The -background, + -highlightbackground, + -highlightcolor, and + -highlightthickness options are only supported by the + Scrollutil package, but not by Scrollutil_tile.  They have the same + default values as the options of the same names for Tk frame widgets.  + The default values of the remaining standard options are:
+ +
+
+-borderwidth 0 -cursor "" -relief flat -xscrollcommand "" -yscrollcommand ""
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -contentheight
Database Name: contentHeight
Database Class: ContentHeight
+ +
+

Specifies the desired height for the content frame in any of the + forms acceptable to Tk_GetPixels.  If the + option's value is less than or equal to zero then the content frame's + height is made just large enough to hold all its children.  This + option is only relevant if the value of the -fitcontentheight option is false; + otherwise the content frame will have the same height as the + scrollableframe window, regardless of the value of the + -contentheight option.  The default is + 0, which is suitable for the vast majority of + applications.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -contentwidth
Database Name: contentWidth
Database Class: ContentWidth
+ +
+

Specifies the desired width for the content frame in any of the + forms acceptable to Tk_GetPixels.  If the + option's value is less than or equal to zero then the content frame's + width is made just large enough to hold all its children.  This + option is only relevant if the value of the -fitcontentwidth option is false; + otherwise the content frame will have the same width as the + scrollableframe window, regardless of the value of the + -contentwidth option.  The default is + 0, which is suitable for the vast majority of + applications.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -fitcontentheight
Database Name: fitContentHeight
Database Class: FitContentHeight
+ +
+

Specifies a boolean value indicating whether or not the content + frame should have the same height as the scrollableframe window.  + If true then the content frame's height will be kept in sync with that + of the widget and the value of the -contentheight option will be + ignored.  The default is 0.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -fitcontentwidth
Database Name: fitContentWidth
Database Class: FitContentWidth
+ +
+

Specifies a boolean value indicating whether or not the content + frame should have the same width as the scrollableframe window.  + If true then the content frame's width will be kept in sync with that + of the widget and the value of the -contentwidth option will be + ignored.  The default is 0.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -height
Database Name: height
Database Class: Height
+ +
+

Specifies the desired height for the scrollableframe widget in any + of the forms acceptable to Tk_GetPixels.  + Note that this sets the inner height, excluding the border and + highlight rectangle (if any) drawn around the outside of the + widget.  The default is 100, which should be + overridden with a suitable application-specific value.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -takefocus
Database Name: takeFocus
Database Class: TakeFocus
+ +
+

This option determines whether the scrollableframe widget accepts + the focus during keyboard traversal.  It is almost identical to + the standard option of the same name (see the options manual + entry for details).  The only difference is that not the + scrollableframe widget itself but its content frame will receive the + focus during keyboard traversal with the standard keys + (Tab and Shift-Tab).  The default is + 0, being that a scrollableframe widget is esentially a + frame used as a view for its content frame component.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -width
Database Name: width
Database Class: Width
+ +
+

Specifies the desired width for the scrollableframe widget in any + of the forms acceptable to Tk_GetPixels.  + Note that this sets the inner width, excluding the border and + highlight rectangle (if any) drawn around the outside of the + widget.  The default is 100, which should be + overridden with a suitable application-specific value.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -xscrollincrement
Database Name: xScrollIncrement
Database Class: ScrollIncrement
+ +
+

Specifies an increment for horizontal scrolling, in any of the forms + acceptable to Tk_GetPixels.  If the value of + this option is greater than zero then the horizontal view in the window + will be constrained so that the x coordinate within the content frame + at the left edge of the window is always an even multiple of + xScrollIncrement; furthermore, the units for + horizontal scrolling (see the xview subcommad) will also be + xScrollIncrement.  If the value is less than + or equal to zero then the horizontal scrolling is unconstrained.  + The default is 0.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -yscrollincrement
Database Name: yScrollIncrement
Database Class: ScrollIncrement
+ +
+

Specifies an increment for vertical scrolling, in any of the forms + acceptable to Tk_GetPixels.  If the value of + this option is greater than zero then the vertical view in the window + will be constrained so that the y coordinate within the content frame + at the top edge of the window is always an even multiple of + yScrollIncrement; furthermore, the units for + vertical scrolling (see the yview subcommad) will also be + yScrollIncrement.  If the value is less than + or equal to zero then the vertical scrolling is unconstrained.  + The default is 0.

+
+
+ +
WIDGET COMMAND
+ +
+ The scrollutil::scrollableframe command creates a new + Tcl command whose name is pathName.  This + command may be used to invoke various operations on the widget.  It + has the following general form: + +
+
+pathName option ?arg arg ...?
+
+
+
+ +
option and the args determine + the exact behavior of the command.  The following commands are + possible for scrollableframe widgets:
+ +
+
+
pathName cget + option
+ +
Returns the current value of the configuration option given by + option, which may have any of the values accepted + by the scrollutil::scrollableframe command.
+ +
pathName configure + ?option? ?value option value + ...?
+ +
Queries or modifies the configuration options of the widget.  + If no option is specified, the command returns a + list describing all of the available options for + pathName (see Tk_ConfigureInfo + for information on the format of this list).  If + option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given widget option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + accepted by the scrollutil::scrollableframe + command.
+ +
pathName + contentframe
+ +
Returns the path name of the widget's content frame.
+ +
pathName scan option + args
+ +
This command is used to implement scanning on scrollableframe + widgets.  It has two forms, depending on + option:
+ +
+
+
pathName scan mark x + y
+ +
Records x and y and the + current view in the scrollableframe window; used in conjunction + with later  scan dragto  + commands.  Typically this command is associated with a mouse + button press in the widget and x and + y are the coordinates of the mouse.  It + returns an empty string.
+ +
pathName scan dragto x y + ?gain?
+ +
This command computes the difference between its + x and y arguments (which + are typically mouse coordinates) and the x and + y arguments to the last  scan + mark  command for the widget.  It then + adjusts the view by gain times the difference + in coordinates, where gain defaults to + 10.  This command is typically associated with + mouse motion events in the widget, to produce the effect of + dragging the content frame at high speed through the window.  + The return value is an empty string.
+
+
+ +
pathName see widget + ?corner?
+ +
This command adjusts the view in the scrollableframe's window so + that widget becomes visible in it.  The + specified widget must be a descendant of the content frame and must + have the same toplevel.  In addition, it must be managed by some + geometry manager (such as grid, + pack, place, + text, or canvas).  The + optional corner argument specifies which corner of + widget should become visible if it is too large to + fit into the window.  The possible values are + nw (north-west), ne + (north-east), sw (south-west), and + se (south-east).  The default corner is + nw.
+ +
REMARK:  By using this subcommand you can + make the keyboard navigation in the content frame more user-friendly, + like in the following example, in which $w is a descendant + of the content frame of the scrollableframe widget + $sf (it is assumed that $sf doesn't contain + % characters):
+ +
+
+
+bind $w <<TraverseIn>> [list $sf see %W]
+
+
+
+ +
If the widget $w was embedded into a scrollarea via the latter's setwidget subcommand, and + the scrollarea in turn is a descendant of the content frame, then it is + more user-friendly to bring the scrollarea into view rather than just + the widget:
+ +
+
+
+bind $w <<TraverseIn>> [list seeScrollarea $sf %W]
+
+proc seeScrollarea {sf w} { $sf see [scrollutil::getscrollarea $w] }
+
+
+
+ +
pathName xview + ?args?
+ +
This command is used to query and change the horizontal position of + the information displayed in the widget's window.  It can take any + of the following forms:
+ +
+
+
pathName xview
+ +
Returns a list containing two elements.  Each element is a + real fraction between 0 and 1; together + they describe the horizontal span that is visible in the + window.  For example, if the first element is 0.2 + and the second element is 0.6 then 20% of the content + frame is off-screen to the left, the middle 40% is visible in the + window, and 40% of the content frame is off-screen to the + right.  These are the same values passed to scrollbars via the + -xscrollcommand option.
+ +
pathName xview moveto + fraction
+ +
Adjusts the view in the window so that + fraction of the total width of the content + frame is off-screen to the left.  fraction + must be a fraction between 0 and 1.
+ +
pathName xview scroll number + what
+ +
This command shifts the view in the window left or right + according to number and + whatnumber must be + an integer.  what must be either + units or pages or an + abbreviation of one of these.  If what is + units, the view adjusts left or right in units + of the xScrollIncrement option if it is + greater than zero, or in units of one-tenth the window's width + otherwise.  If what is + pages then the view adjusts in units of + nine-tenths the window's width.  If number + is negative then information farther to the left becomes visible; + if it is positive then information farther to the right becomes + visible.
+
+
+ +
pathName yview + ?args?
+ +
This command is used to query and change the vertical position of + the information displayed in the widget's window.  It can take any + of the following forms:
+ +
+
+
pathName yview
+ +
Returns a list containing two elements.  Each element is a + real fraction between 0 and 1; together + they describe the vertical span that is visible in the + window.  For example, if the first element is 0.2 + and the second element is 0.6 then 20% of the content + frame is off-screen to the top, the middle 40% is visible in the + window, and 40% of the content frame is off-screen to the + bottom.  These are the same values passed to scrollbars via + the -yscrollcommand option.
+ +
pathName yview moveto + fraction
+ +
Adjusts the view in the window so that + fraction of the total height of the content + frame is off-screen to the top.  fraction + must be a fraction between 0 and 1.
+ +
pathName yview scroll number + what
+ +
This command shifts the view in the window up or down according + to number and what.  + number must be an integer.  + what must be either units + or pages or an abbreviation of one of + these.  If what is + units, the view adjusts up or down in units of + the yScrollIncrement option if it is + greater than zero, or in units of one-tenth the window's height + otherwise.  If what is + pages then the view adjusts in units of + nine-tenths the window's height.  If + number is negative then higher information + becomes visible; if it is positive then lower information becomes + visible.
+
+
+
+
+ +
BINDINGS
+ +
Mouse button 1 may be used for scanning.  If it is pressed and + dragged over the scrollableframe window, the content frame drags at high + speed in the direction the mouse moves.  For the duration of the scan + the cursor is set to one having the shape of a pointing hand.
+ +
KEYWORDS
+ +
scrollableframe, widget, frame, scrollable
+
+ +
+

Contents     Start page

+
+ +
+ +

Comparison with BWidget ScrollableFrame and + iwidgets::scrolledframe

+ +

The scrollutil::scrollableframe widget was designed as a lightweight, + theme-able, and full-featured replacement for BWidget ScrollableFrame and + iwidgets::scrolledframe.  The following table contains a comparison of + the options and commands provided by the three widgets:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
scrollutil::scrollableframeBWidget ScrollableFrameiwidgets::scrolledframe
-background-background-background
-borderwidth-borderwidth
-cursor-cursor
-contentheight-areaheight[pathName component canvas] \
+ itemconfigure frameTag -height ...
-contentwidth-areawidth[pathName component canvas] \
+ itemconfigure frameTag -width ...
-fitcontentheight-constrainedheightbind [pathName component canvas] + <Configure> \
+ { %W itemconfigure frameTag -height %h }
-fitcontentwidth-constrainedwidthbind [pathName component canvas] + <Configure> \
+ { %W itemconfigure frameTag -width %w }
-height  (sets the inner height, + excluding
+ the border and highlight rectangle, if any)
-height  (inner height = total height)-height  (sets the total height, + including
+ the border and horizontal scrollbar, if any)
-highlightbackground
-highlightcolor
-highlightthickness
-relief-relief
-takefocus
-width  (sets the inner width, + excluding
+ the border and highlight rectangle, if any)
-width  (inner width = total width)-width  (sets the total width, + including
+ the border and vertical scrollbar, if any)
-xscrollcommand-xscrollcommand
-xscrollincrement-xscrollincrement-xscrollincrement for [pathName + component canvas]
-yscrollcommand-yscrollcommand
-yscrollincrement-yscrollincrement-yscrollincrement for [pathName + component canvas]
cgetcgetcget
configureconfigureconfigure
contentframegetframechildsite
scan  (with mouse event bindings)
see widget + ?nw|ne|sw|se?see widget + ?top|bottom ?left|right??
xviewxviewxview
yviewyviewyview
xview|yview moveto 0|1xview|yview moveto 0|1justify + left|right|top|bottom
+ (shortcut for  xview|yview + moveto 0|1)
+ +

REMARK 1:  For the see command provided by + the BWidget ScrollableFrame widget one cannot specify the horizontal side + without the vertical one.  More annoying is, however, that in the + presence of a positive -xscrollincrement or + -yscrollincrement value, widgets that are small enough to + fit into the window are quite often just partially brought into view.  + In addition, the command works only for direct children of the + ScrollableFrame widget's content frame.

+ +

REMARK 2:  The iwidgets::scrolledframe widget has no + equivalents of the scrollutil::scrollableframe options + -contentheight, -contentwidth, + -fitcontentheight, and + -fitcontentwidth, but these can be emulated (using + undocumented internal information!) as shown above.  It provides a + justify command, which is, however, just a shortcut + for  xview|yview moveto 0|1.  + What this widget is really missing, is a see command for + making individual widgets visible in the window (which is important for + user-friendly keyboard navigation).

+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/scrollutil/scrollarea.html Index: embedded/www/tklib/files/modules/scrollutil/scrollarea.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/scrollarea.html @@ -0,0 +1,608 @@ + + + + The scrollutil::scrollarea and scrollutil::getscrollarea + Commands + + + + + + + + +
+

The scrollutil::scrollarea and
+ scrollutil::getscrollarea Commands

+ +

For Scrollutil Version 1.5

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The scrollutil::scrollarea Command + – Quick Reference

+ +
+
NAME
+ +
scrollutil::scrollarea – Create and manipulate + scrollarea widgets
+ +
SYNOPSIS
+ +
+
+scrollutil::scrollarea pathName ?options?
+
+
+ +
DESCRIPTION
+ +
STANDARD OPTIONS
+ +
+
+-background   -highlightbackground  -relief
+-borderwidth  -highlightcolor
+-cursor       -highlightthickness
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
-lockinterval + milliseconds
+ +
-respectheader + boolean
+ +
-respecttitlecolumns + boolean
+ +
-takefocus + 0|1|""|command
+ +
-xscrollbarmode + static|dynamic|none
+ +
-yscrollbarmode + static|dynamic|none
+ +
WIDGET COMMAND
+ +
pathName cget + option
+ +
pathName configure + ?option? ?value option value ...?
+ +
pathName setwidget + widget
+ +
pathName widget
+ +
BINDINGS
+ +
KEYWORDS
+ +
scrollarea, widget, scrollbar
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::scrollarea + Command – Detailed Reference

+ +
+
NAME
+ +
scrollutil::scrollarea – Create and manipulate + scrollarea widgets
+ +
SYNOPSIS
+ +
+
+scrollutil::scrollarea pathName ?options?
+
+
+ +
DESCRIPTION
+ +
The scrollutil::scrollarea command creates a new + window named pathName and of the class + Scrollarea, and makes it into a scrollarea + widget.  Additional options, described below, may be specified on the + command line or in the option database to configure aspects of the + scrollarea such as its borderwidth, relief, and display mode to be used for + the scrollbars.  The scrollutil::scrollarea + command returns its pathName argument.  At the + time this command is invoked, there must not exist a window named + pathName, but pathName's parent + must exist.
+ +
A scrollarea is a mega-widget consisting of a scrollable + widget specified with the aid of the setwidget subcommand of the associated Tcl + command as well as two scrollbars connected with that widget.  These + components are managed within the scrollarea using + grid.  The scrollbars, named + hsb (with  -orient + horizontal)  and vsb (with  + -orient vertical)  are direct children of the + scrollarea.  The display mode of each scrollbar can be + static, dynamic, or + none (see the -xscrollbarmode and -yscrollbarmode configuration + options).  The -takefocus option of both + scrollbars is set to 0.  In the Scrollutil_tile package + the scrollbars are created as ttk::scrollbar widgets, except on Mac OS X + when using a Tk release earlier than 8.6.10, where the native + ttk::scrollbar widget of the aqua theme didn't yet look + as expected.
+ +
If the widget embedded into the scrollarea via + setwidget is a tablelist and Tablelist version 6.5 + or later is being used then the scrollarea can also contain siblings of the + tablelist widget above the vertical scrollbar and/or to the left of the + horizontal one, causing the vertical scrollbar to be displayed below the + tablelist's header and/or the horizontal scrollbar to appear to the right + of the tablelist's title column area, depending on the values of the + -respectheader and -respecttitlecolumns configuration + options.
+ +
+ The following example shows the typical steps involved in creating a + widget within a scrollarea: + +
+
+set sa [scrollutil::scrollarea ...]
+set lb [listbox $sa.lb ...]
+$sa setwidget $lb
+
+pack $sa -expand yes -fill both
+
+
+
+ +
STANDARD OPTIONS
+ +
+
+-background   -highlightbackground  -relief
+-borderwidth  -highlightcolor
+-cursor       -highlightthickness
+
+
+ +
See the options manual entry for details on the standard Tk + widget options.  The -background, + -highlightbackground, + -highlightcolor, and + -highlightthickness options are only supported by the + Scrollutil package, but not by Scrollutil_tile.  They have the same + default values as the options of the same names for Tk frame widgets.  + The default values of the remaining standard options are:
+ +
+
+-borderwidth 1 -cursor "" -relief sunken
+
+
+ +
REMARK:  When configuring the + -borderwidth or -relief option, if + as a result of this action the scrollarea has a positive + -borderwidth value (e.g., the default 1) + and a -relief value other than flat + (e.g., the default sunken), then the + -borderwidth option of the widget embedded into the + scrollarea via the setwidget + subcommand of the associated Tcl command will automatically be set to + 0, provided that the embedded widget supports this + option.
+ +
WIDGET-SPECIFIC OPTIONS
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -lockinterval
Database Name: lockInterval
Database Class: LockInterval
+ +
+

Specifies the time interval in milliseconds for which the scrollbars + having the display mode dynamic (see the + -xscrollbarmode and + -yscrollbarmode + options) will be protected from being unmapped after being mapped, in + order to avoid any shimmering effects.  Without this locking + mechanism, under some rare circumstances a dynamic scrollbar could get + mapped and unmapped in an endless loop, thus giving rise to an annoying + and often dangerous flickering effect.  The same problem can arise + due to a too small -lockinterval value.  The + default is 1, which works as expected in the vast majority + of cases.  Should you experience any shimmering in one of your + scrollarea widgets, just set this option for that scrollarea to a + sufficiently large value (e.g., 100).

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -respectheader
Database Name: respectHeader
Database Class: RespectHeader
+ +
+

This option is only relevant if the widget embedded into the + scrollarea with the aid of the setwidget subcommand of the associated Tcl + command is a tablelist + and the Tablelist version being used is 6.5 or later.  Its value + must be a boolean specifying whether the vertical scrollbar should + appear below the tablelist widget's header, thus respecting the native + look & feel on Mac OS X Aqua and on many modern Linux systems.  + The default is 1 on the windowing systems + aqua and x11, and + 0 on win32.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -respecttitlecolumns
Database Name: respectTitleColumns
Database Class: RespectTitleColumns
+ +
+

This option is only relevant if the widget embedded into the + scrollarea with the aid of the setwidget subcommand of the associated Tcl + command is a tablelist + and the Tablelist version being used is 6.5 or later.  Its value + must be a boolean specifying whether the horizontal scrollbar should + start to the right of the tablelist widget's non-scrollable title + column area if the value of the -titlecolumns + tablelist option is positive.  The default is 1.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -takefocus
Database Name: takeFocus
Database Class: TakeFocus
+ +
+

This option determines whether the scrollarea accepts the focus + during keyboard traversal.  It is almost identical to the standard + option of the same name (see the options manual entry for + details).  The only difference is that not the scrollarea itself + but the widget embedded into it via the setwidget subcommand of the associated Tcl + command will receive the focus during keyboard traversal with the + standard keys (Tab and Shift-Tab).  The + default is 0, being that a scrollarea is esentially a + frame containing the above-mentioned widget and two scrollbars.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -xscrollbarmode
Database Name: xScrollbarMode
Database Class: ScrollbarMode
+ +
+

Specifies the display mode to be used for the horizontal + scrollbar.  The allowed values are static, + dynamic, and none.  In + static mode the scrollbar is displayed at all + times.  In dynamic mode (which is the default) + the scrollbar is mapped and unmapped as needed.  The display mode + none disables the scrollbar display.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -yscrollbarmode
Database Name: yScrollbarMode
Database Class: ScrollbarMode
+ +
+

Specifies the display mode to be used for the vertical + scrollbar.  The allowed values are static, + dynamic, and none.  In + static mode the scrollbar is displayed at all + times.  In dynamic mode (which is the default) + the scrollbar is mapped and unmapped as needed.  The display mode + none disables the scrollbar display.

+
+
+ +
WIDGET COMMAND
+ +
+ The scrollutil::scrollarea command creates a new Tcl + command whose name is pathName.  This command + may be used to invoke various operations on the widget.  It has the + following general form: + +
+
+pathName option ?arg arg ...?
+
+
+
+ +
option and the args determine + the exact behavior of the command.  The following commands are + possible for scrollarea widgets:
+ +
+
+
pathName cget + option
+ +
Returns the current value of the configuration option given by + option, which may have any of the values accepted + by the scrollutil::scrollarea command.
+ +
pathName configure + ?option? ?value option value + ...?
+ +
Queries or modifies the configuration options of the widget.  + If no option is specified, the command returns a + list describing all of the available options for + pathName (see Tk_ConfigureInfo + for information on the format of this list).  If + option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given widget option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + accepted by the scrollutil::scrollarea + command.
+ +
pathName setwidget + widget
+ +
The widget argument must be the path name of an + existing widget or an empty string.  In the first case, the + command manages the widget to fill the top-left part of the scrollarea + and connects it with the scrollbars by setting its + -xscrollcommand and + -yscrollcommand options to appropriate wrappers for + the set command of the two scrollbars and setting + the -command option of the scrollbars to  + [list widget xview]  and  + [list widget yview],  + respectively.  If widget is an empty string + then the widget passed to the most recent setwidget + invocation (if any) is unmanaged and unconnected from the + scrollbars.  The return value is the argument passed to the + previous successful invocation of this subcommand, or an empty string + if there was no successful setwidget invocation + before.
+ +
REMARK 1:  If widget is + nonempty and the value of the -xscrollbarmode option is different + from none then widget must be a + horizontally scrollable widget, meaning that it must support the + -xscrollcommand configuration option and the + associated Tcl command must have the xview + subcommand.  Similarly, if widget is nonempty + and the value of the -yscrollbarmode option is different + from none then widget must be a + vertically scrollable widget, meaning that it must support the + -yscrollcommand configuration option and the + associated Tcl command must have the yview + subcommand.  Consequently, if widget is an + entry or ttk::entry then this subcommand will only be successful if the + -yscrollbarmode option was previously set to + none.
+ +
REMARK 2:  The widget identified by the + widget argument must be a child of the scrollarea + or of one of the latter's ascendants.  This minor restriction is + imposed by the grid geometry manager.
+ +
REMARK 3:  When the widget whose path name + was passed to setwidget gets destroyed, this + subcommand is automatically invoked with an empty string as + argument.
+ +
REMARK 4:  This subcommand sets the + -highlightthickness option of + widget to 0 if + widget supports this configuration option.  In + addition, if the scrollarea has a positive + -borderwidth value (e.g., the default + 1) and a -relief value other than + flat (e.g., the default sunken) + then this subcommand sets the -borderwidth option + of widget to 0, provided that + widget supports this option.
+ +
pathName + widget
+ +
Returns the argument passed to the most recent successful + invocation of the setwidget subcommand, or an empty string if + there was no successful invocation of that subcommand yet.
+
+
+ +
BINDINGS
+ +
When a new scrollarea is created, it has no default event bindings: + scrollareas are not intended to be interactive.
+ +
KEYWORDS
+ +
scrollarea, widget, scrollbar
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::getscrollarea + Command

+ +
+
NAME
+ +
scrollutil::getscrollarea – Query the scrollarea + containing a given widget
+ +
SYNOPSIS
+ +
+
+scrollutil::gescrollarea widget
+
+
+ +
DESCRIPTION
+ +
Returns the path name of the scrollarea into which the widget given by + the widget argument is embedded via the scrollarea's + setwidget subcommand, or an + empty string if there is no such scrollarea widget.
+ +
KEYWORDS
+ +
scrollarea, widget
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/scrollutil/scrollsync.html Index: embedded/www/tklib/files/modules/scrollutil/scrollsync.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/scrollsync.html @@ -0,0 +1,445 @@ + + + + The scrollutil::scrollsync and scrollutil::getscrollsync + Commands + + + + + + + + +
+

The scrollutil::scrollsync and
+ scrollutil::getscrollsync Commands

+ +

For Scrollutil Version 1.5

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The scrollutil::scrollsync Command + – Quick Reference

+ +
+
NAME
+ +
scrollutil::scrollsync – Create and manipulate + scrollsync widgets
+ +
SYNOPSIS
+ +
+
+scrollutil::scrollsync pathName ?options?
+
+
+ +
DESCRIPTION
+ +
STANDARD OPTIONS
+ +
+
+-background   -highlightbackground  -relief
+-borderwidth  -highlightcolor       -xscrollcommand
+-cursor       -highlightthickness   -yscrollcommand
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
-takefocus + 0|1|""|command
+ +
WIDGET COMMAND
+ +
pathName cget + option
+ +
pathName configure + ?option? ?value option value ...?
+ +
pathName setwidgets + widgetList
+ +
pathName widgets
+ +
+ pathName xview + ?args? + +
+
pathName xview
+ +
pathName xview moveto + fraction
+ +
pathName xview scroll number + units|pages
+
+
+ +
+ pathName yview + ?args? + +
+
pathName yview
+ +
pathName yview moveto + fraction
+ +
pathName yview scroll number + units|pages
+
+
+ +
BINDINGS
+ +
KEYWORDS
+ +
scrollsync, widget, scrolling
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::scrollsync + Command – Detailed Reference

+ +
+
NAME
+ +
scrollutil::scrollsync – Create and manipulate + scrollsync widgets
+ +
SYNOPSIS
+ +
+
+scrollutil::scrollsync pathName ?options?
+
+
+ +
DESCRIPTION
+ +
The scrollutil::scrollsync command creates a new + window named pathName and of the class + Scrollsync, and makes it into a scrollsync + widget.  Additional options, described below, may be specified on the + command line or in the option database to configure aspects of the + scrollsync widget such as its borderwidth and relief.  The + scrollutil::scrollsync command returns its + pathName argument.  At the time this command is + invoked, there must not exist a window named pathName, + but pathName's parent must exist.
+ +
A scrollsync is a mega-widget, designed for scrolling + several widgets simultaneously.  It is both horizontally and + vertically scrollable, meaning that it supports the + -xscrollcommand and -yscrollcommand + configuration options and the associated Tcl command has the + xview and yview subcommands.  Whenever the + horizontal/vertical position of the view in the window of one of the + horizontally/vertically scrollable widgets contained in the list passed to + the setwidgets subcommand of + the associated Tcl command changes, the view in the windows of all the + other horizontally/vertically scrollable elements of that list is + automatically adjusted accordingly, thus making sure that the view's + position in these windows is kept in sync.
+ +
+ A scrollsync widget is typically created within a scrollarea, like in the following example: + +
+
+set sa [scrollutil::scrollarea ...]
+set ss [scrollutil::scrollsync $sa.ss ...]
+$sa setwidget $ss
+
+set lb1 [listbox $ss.lb1 ...]
+set lb2 [listbox $ss.lb2 ...]
+$ss setwidgets [list $lb1 $lb2]
+
+grid $lb1 $lb2 -sticky news -padx {0 2}
+grid rowconfigure    $ss 0   -weight 1
+grid columnconfigure $ss all -weight 1
+
+pack $sa -expand yes -fill both
+
+
+
+ +
STANDARD OPTIONS
+ +
+
+-background   -highlightbackground  -relief
+-borderwidth  -highlightcolor       -xscrollcommand
+-cursor       -highlightthickness   -yscrollcommand
+
+
+ +
See the options manual entry for details on the standard Tk + widget options.  The -background, + -highlightbackground, + -highlightcolor, and + -highlightthickness options are only supported by the + Scrollutil package, but not by Scrollutil_tile.  They have the same + default values as the options of the same names for Tk frame widgets.  + The default values of the remaining standard options are:
+ +
+
+-borderwidth 0 -cursor "" -relief flat -xscrollcommand "" -yscrollcommand ""
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -takefocus
Database Name: takeFocus
Database Class: TakeFocus
+ +
+

This option determines whether the scrollsync widget accepts the + focus during keyboard traversal.  It is almost identical to the + standard option of the same name (see the options manual entry + for details).  The only difference is that not the scrollsync + widget itself but the first element of the widget list passed to the + setwidgets subcommand of + the associated Tcl command will receive the focus during keyboard + traversal with the standard keys (Tab and + Shift-Tab).  The default is 0, being + that a scrollsync widget is esentially a frame containing the + above-mentioned widgets.

+
+
+ +
WIDGET COMMAND
+ +
+ The scrollutil::scrollsync command creates a new Tcl + command whose name is pathName.  This command + may be used to invoke various operations on the widget.  It has the + following general form: + +
+
+pathName option ?arg arg ...?
+
+
+
+ +
option and the args determine + the exact behavior of the command.  The following commands are + possible for scrollsync widgets:
+ +
+
+
pathName cget + option
+ +
Returns the current value of the configuration option given by + option, which may have any of the values accepted + by the scrollutil::scrollsync command.
+ +
pathName configure + ?option? ?value option value + ...?
+ +
Queries or modifies the configuration options of the widget.  + If no option is specified, the command returns a + list describing all of the available options for + pathName (see Tk_ConfigureInfo + for information on the format of this list).  If + option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given widget option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + accepted by the scrollutil::scrollsync + command.
+ +
pathName setwidgets + widgetList
+ +
Sets the widgets in whose windows the view's position is to be kept + in sync.  The widgetList argument must be a + valid list consisting of path names of existing widgets.  Whenever + the horizontal/vertical position of the view in the window of one of + the horizontally/vertically scrollable widgets contained in this list + changes, the view in the windows of all the other + horizontally/vertically scrollable elements of the list will be + automatically adjusted accordingly, thus making sure that the view's + position in these windows is kept in sync.  The return value is + the argument passed to the previous successful invocation of this + subcommand, or an empty list if there was no successful + setwidgets invocation before.
+ +
REMARK:  When one of the widgets whose path + name is contained in widgetList gets destroyed, + that widget is automatically removed from the internal list of widgets + in whose windows the view's position is kept in sync.
+ +
pathName + widgets
+ +
Returns the argument passed to the most recent successful + invocation of the setwidgets subcommand, or an empty list if + there was no successful invocation of that subcommand yet.
+ +
pathName xview + ?args?
+ +
pathName xview
+ +
pathName xview moveto + fraction
+ +
pathName xview scroll number + units|pages
+ +
This command passes its arguments to the + xview command of the current master widget for + the x axis and returns the result of that command invocation.  + The master widget for the x axis is the element of the widget list + passed to the setwidgets + subcommand having the smallest relative view width among the + horizontally scrollable widgets in that list, i.e., the least + difference between the last and first elements of the two-element list + returned by its xview command.  This master + widget can vary during program execution (in case of text widgets it + can even change depending on the current vertical view position).
+ +
pathName yview + ?args?
+ +
pathName yview
+ +
pathName yview moveto + fraction
+ +
pathName yview scroll number + units|pages
+ +
This command passes its arguments to the + yview command of the current master widget for + the y axis and returns the result of that command invocation.  + The master widget for the y axis is the element of the widget list + passed to the setwidgets + subcommand having the smallest relative view height among the + vertically scrollable widgets in that list, i.e., the least difference + between the last and first elements of the two-element list returned by + its yview command.  This master widget can + vary during program execution.
+
+
+ +
BINDINGS
+ +
When a new scrollsync widget is created, it has no default event + bindings: scrollsync widgets are not intended to be interactive.
+ +
KEYWORDS
+ +
scrollsync, widget, scrolling
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::getscrollsync + Command

+ +
+
NAME
+ +
scrollutil::getscrollsync – Query the scrollsync + containing a given widget
+ +
SYNOPSIS
+ +
+
+scrollutil::gescrollsync widget
+
+
+ +
DESCRIPTION
+ +
Returns the path name of the scrollsync into which the widget given by + the widget argument is embedded via the scrollsync's + setwidgets subcommand, or an + empty string if there is no such scrollsync widget.
+ +
KEYWORDS
+ +
scrollsync, widget
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/scrollutil/scrollutil.html Index: embedded/www/tklib/files/modules/scrollutil/scrollutil.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/scrollutil.html @@ -0,0 +1,1449 @@ + + + + Scrollutil Programmer's Guide + + + + + + + + +
+

Scrollutil Programmer's Guide

+ +

For Scrollutil Version 1.5

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Overview

+ + + +

Examples

+ + + + + +
+ +

Overview

+ +

What Is Scrollutil?

+ +

Scrollutil is a library package for Tcl/Tk versions 8.0 or higher, written + in pure Tcl/Tk code.  It contains:

+ +
    +
  • the implementation of the scrollarea, scrollsync, and scrollableframe mega-widgets, including a + general utility module for mega-widgets;
  • + +
  • the command scrollutil::addMouseWheelSupport, + which creates mouse wheel event bindings for a given binding tag.  + This command requires Tcl/Tk 8.4 or later;
  • + +
  • commands for user-friendly mouse wheel event handling in + scrollable widget containers like scrollutil::scrollableframe, + BWidget ScrollableFrame, and iwidgets::scrolledframe.  These commands + require Tcl/Tk versions 8.4 or higher on X11 and Mac OS X and Tk 8.6b2 or + later on Windows;
  • + +
  • demo scripts illustrating the use of the Scrollutil package in + connection with various scrollable widgets and the above-mentioned + scrollable widget containers;
  • + +
  • this tutorial;
  • + +
  • reference pages in HTML format.
  • +
+ +

The scrollutil::scrollarea mega-widget greatly simplifies the + creation of arbitrary scrolled widgets.  It consists of a scrollable + widget and two scrollbars connected with that widget.  The display mode + of each scrollbar can be static, dynamic, or + none.  This scrolled window implementation also supports + the widgets that are scrollable in one direction only (e.g., entry and + ttk::entry) and respects the header component and title columns of tablelist widgets (this is freely + configurable).

+ +

The scrollutil::scrollarea widget is similar to BWidget ScrolledWindow and + its snit-based equivalent widget::scrolledwindow, contributed by Jeffrey + Hobbs and contained in tklib.  The snit-based scrodget package by + Aldo Buratti and its TclOO-based equivalent scrolledwidget + contributed by Johann Oberdorfer are further scrolled window implementations. + However, full tablelist support is only provided by the scrollarea + widget, which is free from external dependencies like BWidget, snit, or (for + Tcl 8.5) TclOO.  It is also free from the shimmering + problem in connection with text widgets, which the above-mentioned + scrolled window implementations either share with the autoscroll package + (contained in tklib) or circumvent in a suboptimal way.

+ +

The scrollutil::scrollsync mega-widget is designed for scrolling + several widgets simultaneously.  Whenever the horizontal/vertical + position of the view in the window of one of its widgets changes, the view in + the windows of all the other widgets is automatically adjusted accordingly, + thus making sure that the view's position in these windows is kept in + sync.  This mega-widget is horizontally and vertically scrollable, hence + it can be embedded into a scrollutil::scrollarea widget via the latter's + setwidget subcommand.

+ +

The scrollutil::scrollableframe mega-widget is a scrollable widget + container.  It contains a content frame, whose dimensions are typically + larger than those of the widget itself.  Arbitrary regions of this frame + can be brought into view by scrolling, and the widget also provides a command + for making individual widgets contained in the content frame visible in the + scrollableframe window.

+ +

The scrollutil::scrollableframe widget is similar to BWidget + ScrollableFrame and iwidgets::scrolledframe.  However, unlike these + widgets, which use a canvas for scrolling the content frame, it adjusts the + view with the aid of the place geometry manager, just + like the scrolledframe::scrolledframe command of the + Scrolledframe package by Maurice Bredelet (ulis) and its optimized and + enhanced version contributed by Keith Nash.  For details on these + commands see the wiki page

+ +
+
+ https://wiki.tcl-lang.org/page/A+scrolled+frame +
+
+ +

Scrollutil's canvas-free approach is more lightweight and integrates + better in applications that use tile widgets.

+ +

From the point of view of the commands related to mouse wheel event + handling provided by the Scrollutil package, the scrollability of a + widget or widget container window means that the associated Tcl command + supports the  xview scroll number units  + and  yview scroll number units  + subcommands.  The reason for requiring at least Tk version 8.6b2 on + Windows for the commands related to scrollable widget containers is that in + earlier Tk versions on this platform the mouse wheel events were sent to the + widget having the focus rather than to the one under the pointer.

+ +

To make use of the user-friendly mouse wheel event handling via the + Scrollutil package, follow the steps below:

+ +
    +
  • Create mouse wheel event bindings for the binding tag + "all" or for the toplevel widgets (including ".") + having scrollable widget containers, by invoking the scrollutil::createWheelEventBindings + command.  In addition, register your scrollable widget containers for + scrolling via these bindings with the aid of the scrollutil::enableScrollingByWheel + command.  The above-mentioned bindings handle the mouse wheel events + by scrolling the (innermost) registered scrollable widget container that is + an ascendant of the widget under the pointer and is contained in the + latter's toplevel.
  • + +
  • Invoke the scrollutil::adaptWheelEventHandling + command for those widgets contained in registered scrollable widget + containers that have mouse wheel event (class) bindings.  This step + eliminates the annoying and often dangerous double-handling effect, by + modifying the mouse wheel event handling as follows:  If the focus is + on the widget under the pointer then the mouse wheel events will be handled + by the (class bindings of the) widget only, otherwise by the bindings + created with the scrollutil::createWheelEventBindings + command.  Without this step the mouse wheel events would scroll both + the listbox, text, ttk::treeview, or tablelist widget under the pointer + and the widget container to whose descendants the latter belongs, or + they would select the next/previous value in the ttk::combobox or + ttk::spinbox under the pointer in addition to scrolling the widget + container.
  • + +
  • For some widgets it can be desirable to make the focus check + within this modified event handling less restrictive.  For example, if + the widget under the pointer is an entry component of a mentry of type "Date", + "Time", "DateTime", "IPAddr", or + "IPv6Addr" and the focus is on any of its siblings, then the + mouse wheel events sent to this entry should be handled by the entry widget + itself rather than scrolling the widget container that is an ascendant of + the mentry.  The scrollutil::setFocusCheckWindow + command covers exactly cases like this.
  • +
+ +

The mouse wheel event handling with the aid of the Scrollutil package was + also tested to work with the scrolledframe::scrolledframe + command of the Scrolledframe package by Maurice Bredelet (ulis) and its + optimized and enhanced version contributed by Keith Nash, as well as with the + sframe command implemented by Paul Walton.  For details on + these commands (which provide further implementations of scrollable widget + containers) see the above-mentioned wiki page.

+ +

How to Get It?

+ +

Scrollutil is available for free download from the Web page

+ +
+
+ https://www.nemethi.de +
+
+ +

The distribution file is scrollutil1.5.tar.gz for UNIX and + scrollutil1_5.zip for Windows.  These files contain the + same information, except for the additional carriage return character + preceding the linefeed at the end of each line in the text files for + Windows.

+ +

Scrollutil is also included in tklib, which has the address

+ +
+
+ https://core.tcl.tk/tklib +
+
+ +

How to Install It?

+ +

Install the package as a subdirectory of one of the directories given by + the auto_path variable.  For example, you can install it as + a directory at the same level as the Tcl and Tk script libraries.  The + locations of these library directories are given by the + tcl_library and tk_library variables, + respectively.

+ +

To install Scrollutil on UNIX, cd to the desired + directory and unpack the distribution file + scrollutil1.5.tar.gz:

+ +
+
+gunzip -c scrollutil1.5.tar.gz | tar -xf -
+
+
+ +

On most UNIX systems this can be replaced with

+ +
+
+tar -zxf scrollutil1.5.tar.gz
+
+
+ +

Both commands will create a directory named scrollutil1.5, + with the subdirectories demos, doc, and + scripts.

+ +

On Windows, use WinZip or some other program capable of unpacking + the distribution file scrollutil1_5.zip into the directory + scrollutil1.5, with the subdirectories demos, + doc, and scripts.

+ +

Notice that in tklib the Scrollutil demos directory is + replaced with the subdirectory scrollutil of the + examples directory.  Please take this into account when + reading the examples below.

+ +

How to Use It?

+ +

The Scrollutil distribution provides two packages, called + Scrollutil and Scrollutil_tile.  The main difference + between the two is that Scrollutil_tile enables the tile-based, + theme-specific appearance of scrollarea, scrollsync, and scrollableframe + widgets; this package requires Tcl/Tk 8.4 or higher and tile 0.6 or + higher.  It is not possible to use both packages in one and the same + application, because both are implemented in the same scrollutil + namespace and provide identical commands.

+ +

To be able to access the commands and variables defined in the package + Scrollutil, your scripts must contain one of the lines

+ +
+
+package require scrollutil ?version?
+package require Scrollutil ?version?
+
+
+ +

You can use either one of the two statements above because the file + scrollutil.tcl contains both lines

+ +
+
+package provide scrollutil ...
+package provide Scrollutil ...
+
+
+ +

Likewise, to be able to access the commands and variables defined in the + package Scrollutil_tile, your scripts must contain one of the lines

+ +
+
+package require scrollutil_tile ?version?
+package require Scrollutil_tile ?version?
+
+
+ +

Again, you can use either one of the two statements above because the file + scrollutil_tile.tcl contains both lines

+ +
+
+package provide scrollutil_tile ...
+package provide Scrollutil_tile ...
+
+
+ +

You are free to remove one of these two lines from + scrollutil.tcl and scrollutil_tile.tcl, + respectively, if you want to prevent the corresponding packages from making + themselves known under two different names each.  Of course, by doing so + you restrict the argument of  package require  to a + single name.

+ +

Since the packages Scrollutil and Scrollutil_tile are implemented in the + scrollutil namespace, you must either invoke the

+ +
+
+namespace import scrollutil::pattern ?scrollutil::pattern ...?
+
+
+ +

command to import the procedures you need, or use qualified names + like scrollutil::scrollarea.  In the examples below we have chosen the latter approach.

+ +

To access Scrollutil variables, you must use qualified + names.  There are only three Scrollutil variables that are designed to + be accessed outside the namespace scrollutil:

+ +
    +
  • The variable scrollutil::version holds the current version + number of the Scrollutil package.
  • + +
  • The variable scrollutil::library holds the location of the + Scrollutil installation directory.
  • + +
  • The read-only variable scrollutil::usingTile has the value + 0 in the package Scrollutil and the value 1 in + Scrollutil_tile.
  • +
+ +

The Scrollutil_tile package checks whether the required Tk and tile + versions are present, by executing the commands

+ +
+
+package require Tk 8.4
+if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
+    package require tile 0.6
+}
+
+
+ +

The second command above reflects the fact that, beginning with Tk 8.5a6, + tile is integrated into the Tk core and therefore it should only be loaded + explicitly when using an earlier Tk version.

+ +
+

Contents     Start page

+
+ +
+ +

Examples

+ +

The Helper Script styleUtil.tcl

+ +

All the examples in the demos directory use tile (ttk) + widgets and contain the line

+ +
+
+source styleUtil.tcl
+
+
+ +

The script styleUtil.tcl patches a few ttk widget styles and + defines the style Small.Toolbutton.  In addition, on X11 it + sets the theme to a slightly patched variant of the clam + theme (having smaller ttk::button widgets as well as ttk::treeview and + tablelist headers).

+ +

The patch for the style TCombobox makes sure that the + (readonly) ttk::combobox widgets of the themes alt, + clam, and default will show whether they have the + focus.  This basic requirement, which makes the keyboard navigation more + user-friendly, is already fulfilled by the themes vista, + xpnative, and aqua.

+ +

The ttk::button widgets of the style Small.Toolbutton created + by the procedure createToolbutton, implemented in this helper + script, will appear raised when they have the focus.  Again, this makes + the keyboard navigation more user-friendly.

+ +

A Scrolled tablelist Widget

+ +

This example shows how you can greatly simplify the creation of a scrolled + tablelist by using a scrollarea widget.

+ +

The file ScrolledTablelist1.tcl in the demos + directory creates a horizontally and vertically scrolled tablelist widget + having two header rows and one title column, and manages the two scrollbars + in such a way that the vertical scrollbar appears below the tablelist's + header and the horizontal one starts to the right of the widget's title + column area:

+ +
+ ScrolledTablelist +
+ +

The script achieves these requirements using traditional scrollbar + management, which is shown below in red color:

+ +
+
+package require Tk 8.5
+package require tablelist_tile 6.3
+source styleUtil.tcl
+
+wm title . "Scrolled Tablelist"
+
+#
+# Create the tablelist and the scrollbars as children
+# of a frame having -borderwidth 1 and -relief sunken
+#
+set f   [ttk::frame .f]
+set frm [ttk::frame $f.frm -borderwidth 1 -relief sunken]
+set tbl $frm.tbl
+set vsb $frm.vsb
+set hsb $frm.hsb
+tablelist::tablelist $tbl ... -borderwidth 0 \
+    -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
+. . .
+ttk::scrollbar $vsb -orient vertical   -command [list $tbl yview]
+ttk::scrollbar $hsb -orient horizontal -command [list $tbl xview]
+
+. . .
+
+#
+# Manage the widgets within the frame
+#
+grid $tbl -row 0 -rowspan 2 -column 0 -columnspan 2 -sticky news
+if {[tk windowingsystem] eq "win32"} {
+    grid $vsb -row 0 -rowspan 2 -column 2 -sticky ns
+} else {
+    grid [$tbl cornerpath] -row 0 -column 2 -sticky ew
+    grid $vsb              -row 1 -column 2 -sticky ns
+}
+grid [$tbl cornerpath -sw] -row 2 -column 0 -sticky ns
+grid $hsb                  -row 2 -column 1 -sticky ew
+grid rowconfigure    $frm 1 -weight 1
+grid columnconfigure $frm 1 -weight 1
+
+#
+# Manage the frame
+#
+pack $frm -expand yes -fill both -padx 10 -pady 10
+pack $f   -expand yes -fill both
+
+
+ +

The file ScrolledTablelist2.tcl in the demos + directory replaces the rather technical code above with just a few lines + (shown below in red color), by embedding the + tablelist into a scrollarea widget.  It requires Tablelist version 6.5, + which is needed so the -respectheader and -respecttitlecolumns + scrollarea options can work as expected (for earlier Tablelist versions these + options are silently ignored).  As a further benefit, the scrollbars + created with this method will have the default display mode + dynamic.

+ +
+
+package require Tk 8.5
+package require tablelist_tile 6.5
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "Scrolled Tablelist"
+
+#
+# Create the tablelist within a scrollarea
+#
+set f  [ttk::frame .f]
+set sa [scrollutil::scrollarea $f.sa]
+set tbl $sa.tbl
+tablelist::tablelist $tbl ...
+. . .
+$sa setwidget $tbl
+
+. . .
+
+#
+# Manage the scrollarea
+#
+pack $sa -expand yes -fill both -padx 10 -pady 10
+pack $f  -expand yes -fill both
+
+
+ +

A Scrolled text Widget

+ +

The file ScrolledText.tcl in the demos directory + shows how the scrollarea widget circumvents the + potential shimmering effect in connection with text widgets.

+ +
+ ScrolledText +
+ +

Here is the relevant code, in which the lines related to the scrollarea + widget are shown in red color:

+ +
+
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "Scrolled Text"
+
+#
+# Create a text widget within a scrollarea
+#
+set f  [ttk::frame .f]
+set sa [scrollutil::scrollarea $f.sa -lockinterval 10]
+set txt [text $sa.txt -font TkFixedFont -width 49 -height 12 \
+         -spacing1 2 -spacing3 2 -wrap none]
+$sa setwidget $txt
+
+#
+# Populate the text widget and set the background color of line #25 to red
+#
+for {set i 1} {$i <= 30} {incr i} {
+    set j [expr {2*$i}]
+    $txt insert end [string repeat x $j]\n
+}
+$txt delete 30.end
+$txt tag configure bgRed -background red
+$txt tag add bgRed 25.0 25.end
+
+. . .
+
+#
+# Manage the scrollarea
+#
+pack $sa -expand yes -fill both -padx 10 -pady 10
+pack $f  -expand yes -fill both
+
+#
+# Adjust the vertical view in the text window
+# so that line #25 becomes the bottom line
+#
+tkwait visibility $txt
+after 100 [list $txt yview 14.0]
+
+
+ +

The script creates a text widget $txt embedded into a + scrollarea, populates it with 30 lines, and adjusts the vertical view in the + text window so that line #25 becomes the bottom line.  This line has 50 + characters, hence it doesn't fit completely into the window, whose width is + 49 characters.  Consequently, the command  $txt + xview  will return the list  {0.0 0.98},  + hence the scrollarea's horizontal scrollbar will be mapped and will obscure + most part of the bottom line.  Since this line has red + background, it is easy to see how much of it sticks out above the upper edge + of the scrollbar.

+ +

Let's analyze what happens if the text widget's height is decreased by + dragging the main window's upper or lower edge, just until the red pixels get + obscured by the horizontal scrollbar.  After performing this action, + line #25 is completely out of view and the new bottom line is line #24, which + has 48 characters, hence the command  $txt xview  will + return  {0.0 1.0}.  Normally, this would cause the + horizontal scrollbar to be unmapped.  However, that would make line #25 + to the bottom line, thus causing the horizontal scrollbar to be mapped + again.  This time the scrollbar would completely obscure this line, + which would result in line #24 to become the bottom line, which would cause + the scrollbar to be unmapped again, and so on.  In other words, the + horizontal scrollbar would get mapped and unmapped in an endless loop, giving + rise to an annoying flickering effect.  The built-in locking mechanism + of the scrollarea widget guards against such potential endless loops.  + To make sure that the locking will work as expected, we have set the + -lockinterval + scrollarea option to 10 (recall that the default value is + 1).

+ +

Synchronizing Two listbox Widgets

+ +

The file SyncListboxes.tcl in the demos + directory creates two listboxes within a scrollsync widget, which in turn is embedded into a + scrollarea.

+ +
+ SyncListboxes +
+ +

Here is the relevant code, in which the lines related to the scrollarea + and scrollsync widgets are shown in red color:

+ +
+
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "European Countries"
+
+. . .
+
+set f  [ttk::frame .f]
+
+. . .
+
+#
+# Create a scrollsync widget within a scrollarea
+#
+set sa [scrollutil::scrollarea $f.sa]
+set ss [scrollutil::scrollsync $sa.ss]
+$sa setwidget $ss
+
+#
+# Populate the scrollsync widget with two listboxes
+#
+
+. . .
+
+set lb1 [listbox $ss.lb1 -activestyle none -highlightthickness 0 -width 16]
+set lb2 [listbox $ss.lb2 -activestyle none -highlightthickness 0 -width 16]
+$ss setwidgets [list $lb1 $lb2]
+
+. . .
+
+grid $lb1 $lb2 -sticky news -padx {0 2}
+grid rowconfigure    $ss 0 -weight 1
+grid columnconfigure $ss 0 -weight 1
+grid columnconfigure $ss 1 -weight 1
+
+. . .
+
+pack $sa -side top -expand yes -fill both -padx 10 -pady {2 10}
+pack $f  -expand yes -fill both
+
+. . .
+
+
+ +

Synchronizing Three tablelist Widgets

+ +

The file SyncTablelists.tcl in the demos + directory creates three tablelists within a scrollsync widget, which in turn is embedded into a + scrollarea.

+ +
+ SyncTablelists +
+ +

The relevant code is similar to the one shown in the previous example:

+ +
+
+package require tablelist_tile
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "Synchronized Tablelists"
+
+. . .
+
+set f  [ttk::frame .f]
+
+. . .
+
+#
+# Create a scrollsync widget within a scrollarea
+#
+set sa [scrollutil::scrollarea $f.sa]
+set ss [scrollutil::scrollsync $sa.ss]
+$sa setwidget $ss
+
+#
+# Populate the scrollsync widget with three tablelists
+#
+
+option add *Tablelist.stripeBackground  #f0f0f0
+
+for {set n 1; set colWidth 40} {$n <= 3} {incr n; incr colWidth 20} {
+    set tbl [tablelist::tablelist $ss.tbl$n \
+             -columns [list 0 "Column 0" left  $colWidth "Column 1" left]]
+    set tbl$n $tbl
+
+    for {set i 0} {$i < 40} {incr i} {
+        $tbl insert end [list "cell $i,0" "cell $i,1"]
+    }
+}
+$ss setwidgets [list $tbl1 $tbl2 $tbl3]
+
+grid $tbl1 $tbl2 $tbl3 -sticky news -padx {0 2}
+grid rowconfigure    $ss 0 -weight 1
+grid columnconfigure $ss 0 -weight 1
+grid columnconfigure $ss 1 -weight 1
+grid columnconfigure $ss 2 -weight 1
+
+. . .
+
+pack $sa -side top -expand yes -fill both -padx 10 -pady {2 10}
+pack $f  -expand yes -fill both
+
+. . .
+
+
+ +

Notice that column #1 of the three tablelist widgets is 40, 60, and 80 + characters wide, respectively.  For this reason, when scrolling + horizontally to the right, the left table's view will reach its horizontal + end position first, then that of the midde table, and as last one the view of + the right table.

+ +

A Script Using a + scrollutil::scrollableframe Widget

+ +

The file SuScrollableFrmDemo1.tcl in the demos + directory creates a scrollutil::scrollableframe widget embedded into a + scrollarea, creates mouse wheel event bindings + for the binding tag "all" with the aid of the scrollutil::createWheelEventBindings + command, and invokes the scrollutil::enableScrollingByWheel + command for this scrollableframe, thus registering the latter for scrolling + by these bindings.  After that it populates the content frame of the + scrollableframe with ttk::label widgets displaying the names of the European + countries, ttk::combobox widgets for selecting the corresponding capital + cities, and ttk::button widgets of the style Small.Toolbutton + (created by using the procedure createToolbutton, implemented in + the file styleUtil.tcl) for the less + patient users, displaying the text "Resolve".

+ +
+ ScrollableFrmDemo1 +
+ +

Here is the relevant code:

+ +
+
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "European Capitals Quiz"
+
+#
+# Create a scrollableframe within a scrollarea
+#
+set f  [ttk::frame .f]
+set sa [scrollutil::scrollarea $f.sa]
+set sf [scrollutil::scrollableframe $sa.sf]
+$sa setwidget $sf
+
+#
+# Create mouse wheel event bindings for the binding tag "all" and
+# register the scrollableframe for scrolling by these bindings
+#
+scrollutil::createWheelEventBindings all
+scrollutil::enableScrollingByWheel $sf
+
+#
+# Get the content frame and populate it
+#
+
+set cf [$sf contentframe]
+
+set countryList {
+    Albania Andorra Austria Belarus Belgium "Bosnia and Herzegovina" Bulgaria
+    . . .
+}
+set capitalList {
+    Tirana "Andorra la Vella" Vienna Minsk Brussels Sarajevo Sofia
+    . . .
+}
+
+. . .
+
+set capitalList [lsort $capitalList]
+
+. . .
+
+set row 0
+foreach country $countryList {
+    . . .
+
+    set w [ttk::combobox $cf.cb$row -state readonly -width 14 \
+           -values $capitalList]
+    . . .
+
+    #
+    # Make the keyboard navigation more user-friendly
+    #
+    bind $w <<TraverseIn>> [list $sf see %W]
+
+    #
+    # Adapt the handling of the mouse wheel events for the ttk::combobox widget
+    #
+    scrollutil::adaptWheelEventHandling $w
+
+    . . .
+
+    incr row
+}
+
+. . .
+
+
+ +

We make the keyboard navigation more user-friendly with the aid of the + see subcommand of the + scrollableframe widget when handling the + <<TraverseIn>> virtual event for the ttk::combobox + and (not shown above) ttk::button widgets.  In addition, we invoke the + scrollutil::adaptWheelEventHandling + command for every ttk::combobox widget, which is needed for a user-friendly + event handling, being that this widget has built-in bindings for the mouse + wheel events.  Due to this command, the mouse wheel events over one of + the ttk::combobox widgets will only select the next/previous capital city if + the widget has the focus, otherwise they will scroll the scrollableframe.

+ +

With this script you can also test the scanning in the + scrollableframe:  If you press mouse button 1 over a free space of the + scrollableframe window then the cursor will take on the shape of a pointing + hand, and by draggging the mouse, the content frame will drag at high speed + through the window, in the direction the mouse moves.

+ +

A Script Using a BWidget ScrollableFrame + Widget

+ +

The file BwScrollableFrmDemo1.tcl in the demos + directory creates a BWidget ScrollableFrame embedded into a scrollarea widget, creates mouse wheel event bindings + for the binding tag "all" with the aid of the scrollutil::createWheelEventBindings + command, and invokes the scrollutil::enableScrollingByWheel + command for this ScrollableFrame, thus registering the latter for scrolling + by these bindings.  After that it populates the content frame of the + ScrollableFrame with the same widgets as + SuScrollableFrmDemo1.tcl in the previous example.

+ +

Here is the relevant code:

+ +
+
+package require BWidget
+Widget::theme yes
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "European Capitals Quiz"
+
+#
+# Create a ScrollableFrame within a scrollarea
+#
+set f  [ttk::frame .f]
+set sa [scrollutil::scrollarea $f.sa]
+set sf [ScrollableFrame $sa.sf]
+$sa setwidget $sf
+
+. . .
+
+#
+# Create mouse wheel event bindings for the binding tag "all" and
+# register the ScrollableFrame for scrolling by these bindings
+#
+scrollutil::createWheelEventBindings all
+scrollutil::enableScrollingByWheel $sf
+
+#
+# Get the content frame and populate it
+#
+
+set cf [$sf getframe]
+
+set countryList {
+    Albania Andorra Austria Belarus Belgium "Bosnia and Herzegovina" Bulgaria
+    . . .
+}
+set capitalList {
+    Tirana "Andorra la Vella" Vienna Minsk Brussels Sarajevo Sofia
+    . . .
+}
+
+. . .
+
+set capitalList [lsort $capitalList]
+
+. . .
+
+set row 0
+foreach country $countryList {
+    . . .
+
+    set w [ttk::combobox $cf.cb$row -state readonly -width 14 \
+           -values $capitalList]
+    . . .
+
+    #
+    # Make the keyboard navigation more user-friendly
+    #
+    bind $w <<TraverseIn>> [list $sf see %W]
+
+    #
+    # Adapt the handling of the mouse wheel events for the ttk::combobox widget
+    #
+    scrollutil::adaptWheelEventHandling $w
+
+    . . .
+
+    incr row
+}
+
+. . .
+
+
+ +

A Script Using an iwidgets::scrolledframe + Widget

+ +

The file ScrolledFrmDemo1.tcl in the demos + directory creates an iwidgets::scrolledframe widget, creates mouse wheel + event bindings for the binding tag "all" with the aid of the + scrollutil::createWheelEventBindings + command, and invokes the scrollutil::enableScrollingByWheel + command for this scrolledframe, thus registering the latter for scrolling by + these bindings.  After that it populates the content frame of the + scrolledframe with the same widgets as SuScrollableFrmDemo1.tcl + and BwScrollableFrmDemo1.tcl in the two previous examples.

+ +

Here is the relevant code:

+ +
+
+if {[catch {package require iwidgets} result1] != 0 &&
+    [catch {package require Iwidgets} result2] != 0} {
+    error "$result1; $result2"
+}
+source scrolledwidgetPatch.itk                  ;# adds ttk::scrollbar widgets
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "European Capitals Quiz"
+
+. . .
+
+#
+# Create a scrolledframe
+#
+set f  [ttk::frame .f]
+set sf [iwidgets::scrolledframe $f.sf -borderwidth 1 -relief sunken \
+        -scrollmargin 0]
+. . .
+
+#
+# Create mouse wheel event bindings for the binding tag "all"
+# and register the scrolledframe for scrolling by these bindings
+#
+scrollutil::createWheelEventBindings all
+scrollutil::enableScrollingByWheel $sf
+
+#
+# Get the content frame and populate it
+#
+
+set cf [$sf childsite]
+. . .
+
+<exactly as in the two previous examples, except the stuff related to keyboard navigation>
+
+. . .
+
+
+ +

The code related to keyboard navigation is not present in this example, + because the iwidgets::scrolledframe widget doesn't provide a see + subcommand.

+ +

A Script Using Two + scrollutil::scrollableframe Widgets

+ +

The script SuScrollableFrmDemo2.tcl in the demos + directory creates a scrollutil::scrollableframe widget embedded into a + scrollarea and then sources the + script SuScrollableFrmContent.tcl, which populates the content + frame of the scrollableframe with the following widgets:

+ +
    +
  • a series of ttk::label widgets;
  • + +
  • a scrolled text widget $txt within a scrollarea;
  • + +
  • a scrolled listbox widget $lb within a scrollarea;
  • + +
  • a ttk::combobox widget $cb;
  • + +
  • a ttk::spinbox widget $sb;
  • + +
  • a ttk::entry widget $e;
  • + +
  • a ttk::separator widget;
  • + +
  • a mentry widget $me of type "Date";
  • + +
  • a scrolled tablelist widget $tbl within a scrollarea;
  • + +
  • a scrolled ttk::treeview widget $tv within a + scrollarea.
  • +
+ +

With the exception of ttk::label, ttk::entry, and ttk::separator, all + these widgets have bult-in mouse wheel event bindings.

+ +
+ ScrollableFrmDemo2 +
+ +

Here is the relevant code:

+ +
+
+package require Tk 8.5.9                        ;# for ttk::spinbox
+package require mentry_tile 3.2                 ;# for mouse wheel support
+package require tablelist_tile 6.5              ;# for -(x|y)mousewheelwindow
+                                                ;# and scrollutil::scrollarea
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "Scrollutil Demo"
+
+#
+# Create a scrollableframe within a scrollarea
+#
+set tf [ttk::frame .tf]
+set sa [scrollutil::scrollarea $tf.sa]
+set sf [scrollutil::scrollableframe $sa.sf]
+$sa setwidget $sf
+
+#
+# Get the content frame and populate it
+#
+set cf [$sf contentframe]
+source SuScrollableFrmContent.tcl
+
+#
+# Make the keyboard navigation more user-friendly
+#
+foreach w [list $cb $sb $e $me] {
+    bind $w <<TraverseIn>> [list $sf see %W]
+}
+foreach w [list $txt $lb $tbl $tv] {
+    bind $w <<TraverseIn>> [list seeScrollarea $sf %W]
+}
+proc seeScrollarea {sf w} { $sf see [scrollutil::getscrollarea $w] }
+
+
+ +

Whenever the <<TraverseIn>> virtual event is sent + to one of the four widgets created within scrollareas, we query the path name + of the corresponding scrollarea via scrollutil::getscrollarea and + bring that scrollarea (including the scrollbars and the border) into view + rather than just the widget in question.  While in this script we + could have used  [winfo parent]  instead, the command + scrollutil::getscrollarea is the recommended one, being that it + works also for widgets that are no children of the corresponding + scrollareas.

+ +

Here is the additional stuff related to the mouse wheel events, using the + Scrollutil commands described in the What Is + Scrollutil? section:

+ +
+
+#
+# Create mouse wheel event bindings for the binding tag "all" and
+# register the scrollableframe for scrolling by these bindings
+#
+scrollutil::createWheelEventBindings all
+scrollutil::enableScrollingByWheel $sf
+
+#
+# Adapt the handling of the mouse wheel events for the text, listbox,
+# ttk::combobox, ttk::spinbox, tablelist, and ttk::treeview widgets, as
+# well as for the entry components of the mentry widget of type "Date"
+#
+set entryList [$me entries]
+scrollutil::adaptWheelEventHandling $txt $lb $cb $sb $tbl $tv {*}$entryList
+
+#
+# For the entry components of the mentry widget
+# set the "focus check window" to the mentry
+#
+scrollutil::setFocusCheckWindow {*}$entryList $me
+
+
+ +

Notice that we have passed, among others, the tablelist widget to the + scrollutil::adaptWheelEventHandling + command.  This will only work for Tablelist versions 6.4 and later, + because the command handles tablelist widgets by setting their + -xmousewheelwindow and -ymousewheelwindow options + to the path name of the containing toplevel window, and these options were + introduced in Tablelist version 6.4.  (For earlier Tablelist versions + the command silently ignores any tablelist widget passed to it as + argument.)

+ +

As already mentioned, in the file SuScrollableFrmContent.tcl + the scrolled text, listbox, tablelist, and ttk::treeview widgets are created + within scrollarea widgets:

+ +
+
+set _sa [scrollutil::scrollarea ...]
+set txt [text $_sa.txt -font TkFixedFont -width 73]
+scrollutil::addMouseWheelSupport $txt
+$_sa setwidget $txt
+grid $_sa ...
+
+. . .
+
+set _sa [scrollutil::scrollarea ...]
+set lb [listbox $_sa.lb -width 0]
+$_sa setwidget $lb
+grid $_sa ...
+
+. . .
+
+set _sa [scrollutil::scrollarea ...]
+set tbl [tablelist::tablelist $_sa.tbl ...]
+. . .
+$_sa setwidget $tbl
+grid $_sa ...
+
+. . .
+
+set _sa [scrollutil::scrollarea ... -borderwidth 0]
+set tv [ttk::treeview $_sa.tv ...]
+. . .
+$_sa setwidget $tv
+grid $_sa ...
+
+
+ +

In the case of the text, listbox, and tablelist widgets we use scrollarea + widgets with their default  -borderwidth 1 -relief + sunken  settings, which will cause the setwidget subcommand of the associated + Tcl commands to set the -borderwidth option of the text, + listbox, and tablelist widgets to 0.  On the other hand, + for the ttk::treeview we use a scrollarea widget with  + -borderwidth 0,  because the ttk::treeview has a border of + width 1 and doesn't support the -borderwidth + configuration option.

+ +

For our text widget we prefer a mouse wheel event handling that scrolls + the widget by lines rather than pixels, as done by the Text + class bindings in Tk 8.5 and later; we achieve this by passing the path name + $txt to the scrollutil::addMouseWeelSupport command.

+ +

The file SuScrollableFrmContent.tcl contains also the + implementation of the procedure configTablelist, associated with + the "Configure Tablelist Widget" button as the value of its + -command option.  This procedure opens a toplevel window + that contains a scrollutil::scrollableframe widget created + with the  -fitcontentwidth yes  + setting within a scrollarea and invokes the + scrollutil::enableScrollingByWheel + command for this scrollableframe, thus registering the latter for scrolling + by the already created mouse wheel event bindings for the binding tag + "all".  After that it populates the content frame of the + scrollableframe with ttk::label, ttk::combobox, ttk::spinbox, ttk::entry, and + ttk::checkbutton widgets used to display and edit the configuration options + of the tablelist widget.  The procedure handles the + <<TraverseIn>> virtual event sent to one of these + widgets with the aid of the scrollableframe's see subcommand.  Whenever a + ttk::combobox or ttk::spinbox is created, the scrollutil::adaptWheelEventHandling + command is invoked for it, being that these widgets have built-in bindings + for the mouse wheel events.

+ +

The widgets populating the content frame are managed using + grid.  In case of the ttk::entry widgets we invoke + grid with  -sticky we.  Due to this and + the  -fitcontentwidth yes  scrollableframe setting, + the ttk::entry widgets will stretch or shrink whenever the width of the + scrollableframe changes as a result of resizing the toplevel window.

+ +
+ TablelistConfig +
+ +

A Script Using Two BWidget ScrollableFrame + Widgets

+ +

The script BwScrollableFrmDemo2.tcl in the demos + directory creates a BWidget ScrollableFrame embedded into a scrollarea widget and then sources the + script BwScrollableFrmContent.tcl, which populates the content + frame of the ScrollableFrame with the same widgets as + SuScrollableFrmContent.tcl in the previous example.

+ +

Here is the relevant code:

+ +
+
+package require Tk 8.5.9                        ;# for ttk::spinbox
+package require BWidget
+Widget::theme yes
+package require mentry_tile 3.2                 ;# for mouse wheel support
+package require tablelist_tile 6.5              ;# for -(x|y)mousewheelwindow
+                                                ;# and scrollutil::scrollarea
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "Scrollutil Demo"
+
+#
+# Create a ScrollableFrame within a scrollarea
+#
+set tf [ttk::frame .tf]
+set sa [scrollutil::scrollarea $tf.sa]
+set sf [ScrollableFrame $sa.sf]
+$sa setwidget $sf
+
+. . .
+
+#
+# Get the content frame and populate it
+#
+set cf [$sf getframe]
+source BwScrollableFrmContent.tcl
+
+#
+# Make the keyboard navigation more user-friendly
+#
+foreach w [list $cb $sb $e $me] {
+    bind $w <<TraverseIn>> [list $sf see %W]
+}
+foreach w [list $txt $lb $tbl $tv] {
+    bind $w <<TraverseIn>> [list seeScrollarea $sf %W]
+}
+proc seeScrollarea {sf w} { $sf see [scrollutil::getscrollarea $w] }
+
+
+ +

The additional stuff related to the mouse wheel events contains exactly + the same Scrollutil command invocations as the one in the previous + example.

+ +

The file BwScrollableFrmContent.tcl contains also the + implementation of the procedure configTablelist, associated with + the "Configure Tablelist Widget" button as the value of its + -command option.  This procedure opens a toplevel window + that contains a BWidget ScrollableFrame created with the  + -constrainedwidth yes  setting within a scrollarea widget and invokes the scrollutil::enableScrollingByWheel + command for this ScrollableFrame, thus registering the latter for scrolling + by the already created mouse wheel event bindings for the binding tag + "all".  After that it populates the content frame of the + ScrollableFrame with ttk::label, ttk::combobox, ttk::spinbox, ttk::entry, and + ttk::checkbutton widgets used to display and edit the configuration options + of the tablelist widget.  The procedure handles the + <<TraverseIn>> virtual event sent to one of these + widgets with the aid of the ScrollableFrame's see + subcommand.  Whenever a ttk::combobox or ttk::spinbox is created, the + scrollutil::adaptWheelEventHandling + command is invoked for it, being that these widgets have built-in bindings + for the mouse wheel events.

+ +

Again, all this is nearly identical to what we did in the previous + example.

+ +

A Script Using Two iwidgets::scrolledframe + Widgets

+ +

The script ScrolledFrmDemo2.tcl in the demos + directory creates an iwidgets::scrolledframe widget and then + sources the file ScrolledFrmContent.tcl, which + populates the content frame of the scrolledframe with the same widgets as + SuScrollableFrmContent.tcl and + BwScrollableFrmContent.tcl in the two previous examples.

+ +

Here is the relevant code:

+ +
+
+package require Tk 8.5.9                        ;# for ttk::spinbox
+if {[catch {package require iwidgets} result1] != 0 &&
+    [catch {package require Iwidgets} result2] != 0} {
+    error "$result1; $result2"
+}
+source scrolledwidgetPatch.itk                  ;# adds ttk::scrollbar widgets
+package require mentry_tile 3.2                 ;# for mouse wheel support
+package require tablelist_tile 6.5              ;# for -(x|y)mousewheelwindow
+                                                ;# and scrollutil::scrollarea
+package require scrollutil_tile
+source styleUtil.tcl
+
+wm title . "Scrollutil Demo"
+
+. . .
+
+#
+# Create a scrolledframe
+#
+set tf [ttk::frame .tf]
+set sf [iwidgets::scrolledframe $tf.sf -borderwidth 1 -relief sunken \
+        -scrollmargin 0]
+. . .
+
+#
+# Get the content frame and populate it
+#
+set cf [$sf childsite]
+. . .
+source ScrolledFrmContent.tcl
+
+
+ +

The additional stuff related to the mouse wheel events contains exactly + the same Scrollutil command invocations as the one in the two previous + examples.

+ +

The file ScrolledFrmContent.tcl contains also the + implementation of the procedure configTablelist, associated with + the "Configure Tablelist Widget" button as the value of its + -command option.  This procedure opens a toplevel window + that contains an iwidgets::scrolledframe widget with a manually implemented + equivalent of the  -fitcontentwidth yes  + scrollutil::scrollableframe and  + -constrainedwidth yes  BWidget ScrollableFrame settings and + invokes the scrollutil::enableScrollingByWheel + command for this scrolledframe, thus registering the latter for scrolling by + the already created mouse wheel event bindings for the binding tag + "all".  After that it populates the content frame of the + scrolledframe with ttk::label, ttk::combobox, ttk::spinbox, ttk::entry, and + ttk::checkbutton widgets used to display and edit the configuration options + of the tablelist widget.  Whenever a ttk::combobox or ttk::spinbox is + created, the scrollutil::adaptWheelEventHandling + command is invoked for it, being that these widgets have built-in bindings + for the mouse wheel events.

+ +

Again, all this is nearly identical to what we did in the two previous + examples.

+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/scrollutil/stylesheet.css Index: embedded/www/tklib/files/modules/scrollutil/stylesheet.css ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/scrollutil/stylesheet.css @@ -0,0 +1,12 @@ +/* generic class defining a top margin whose height equals the font size */ +.tm {margin-top: 1em} + +/* background, border, and padding for the
 tag */
+pre {background: #F7F7F7; border: silver solid 1px; padding: 1px}
+
+/* background for the  tag */
+body {background: #FFFFFF}
+
+/* color for the  tag */
+span.red {color: #E00000}
+span.cmt {color: #36648b}

ADDED   embedded/www/tklib/files/modules/scrollutil/wheelEvent.html
Index: embedded/www/tklib/files/modules/scrollutil/wheelEvent.html
==================================================================
--- /dev/null
+++ embedded/www/tklib/files/modules/scrollutil/wheelEvent.html
@@ -0,0 +1,595 @@
+
+
+
+  Commands Related to Mouse Wheel Event Handling
+
+  
+  
+
+  
+
+
+
+  
+

Commands Related to Mouse Wheel Event Handling

+ +

For Scrollutil Version 1.5

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

The scrollutil::addMouseWheelSupport + Command

+ +
+
NAME
+ +
scrollutil::addMouseWheelSupport – Add mouse wheel + support
+ +
SYNOPSIS
+ +
+
+scrollutil::addMouseWheelSupport tag ?axes?
+
+
+ +
REQUIRED TK VERSION
+ +
8.4 or higher. + +
DESCRIPTION
+ +
Adds mouse wheel support to the widgets having the specified binding + tag by creating bindings for the mouse wheel events along the axes given by + the optional axes argument, which must be + xy (the default, meaning both the x and y axis), + x (meaning the x axis only), or y (meaning the y + axis only).  The binding scripts created by this command will scroll + the window given by the %W event field with the aid of + the  xview scroll number units  + and  yview scroll number units  + subcommands of the associated Tcl command.
+ +
REMARK 1:  If tag is the + path name of a window then the binding scripts created by this command are + terminated by an invocation of the break command, in + order to prevent the processing of the mouse wheel events by further + binding scripts.  For example, if tag is the path + name of a text widget then the terminating break + command makes sure that the mouse wheel events will not additionally + be processed by the class bindings (associated with the binding tag + Text), which in Tk 8.5 and later trigger a scrolling by + pixels, unlike the bindings created by this command, which scroll + the widget by units (i.e., lines and characters).
+ +
REMARK 2:  The canvas widget has no built-in + bindings, but you can use this command to add mouse wheel support to the + widget class Canvas or individual canvas widgets.
+ +
REMARK 3:  The mouse wheel events along the + vertical axis are <MouseWheel> on Windows, + <MouseWheel> and + <Option-MouseWheel> on Mac OS X, and + <MouseWheel>, + <Button-4> and + <Button-5> on X11 (where + <MouseWheel> is not triggered by the X server, + but can be produced using  event generate).  + The mouse wheel events along the horizontal axis are + <Shift-MouseWheel> on Windows, + <Shift-MouseWheel> and + <Shift-Option-MouseWheel> on Mac OS X, and + <Shift-MouseWheel>, + <Shift-Button-4> and + <Shift-Button-5> on X11 (where + <Shift-MouseWheel> is not triggered by the X + server, but can be produced using  event + generate).  On X11, when using Tk 8.7a3 or later, there are + two more mouse wheel events along the horizontal axis: + <Button-6> and + <Button-7>, which are handled just like + <Shift-Button-4> and + <Shift-Button-5>, respectively.  These + events are commonly triggered by left/right tilting the scroll wheel of a + mouse having one or two additional (thumb) buttons.  (In Tk versions + 8.6.x, with x >= 10, left/right tilting the scroll wheel of such a mouse + gives rise to <Shift-MouseWheel> events on + Windows and Mac OS X Aqua, and to + <Shift-Button-4> and + <Shift-Button-5> events on X11.)
+ +
KEYWORDS
+ +
mouse wheel event, binding, scrolling
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::createWheelEventBindings + Command

+ +
+
NAME
+ +
scrollutil::createWheelEventBindings – Create mouse + wheel event bindings
+ +
SYNOPSIS
+ +
+
+scrollutil::createWheelEventBindings ?tag tag ...?
+
+
+ +
REQUIRED TK VERSION
+ +
8.4 or higher on X11 and Mac OS X; 8.6b2 or later on Windows. + +
DESCRIPTION
+ +
Creates mouse wheel event bindings for the specified binding tags such + that if the widget under the pointer is (a descendant of) one of the + scrollable widget containers having the same toplevel as the widget and + registered via scrollutil::enableScrollingByWheel then these + events will trigger a scrolling of that widget container.  In case of + several nested registered scrollable widget containers fulfilling these + conditions the innermost one will be scrolled.  Each + tag argument must be all or the + path name of an existing toplevel widget (including + .).
+ +
REMARK:  The reason for restricting the + tag arguments to all and path names + of existing toplevel widgets rather than supporting also tags like + "Scrollableframe" (for scrollutil::scrollableframe), + "BwScrollableFrame" (for BWidget ScrollableFrame) or + "Scrolledframe" (for iwidgets::scrolledframe) is that the + mouse wheel events should trigger a scrolling of the widget container under + the pointer not only if the widget under the pointer is the widget + container itself but also if it is a descendant of the latter (recall that + for each window, the path name of its nearest toplevel ancestor and the tag + all are contained in the window's default list of + binding tags).
+ +
KEYWORDS
+ +
mouse wheel event, binding, scrolling, scrollable widget container
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::enableScrollingByWheel + Command

+ +
+
NAME
+ +
scrollutil::enableScrollingByWheel – Register + scrollable widget containers for scrolling by the mouse wheel
+ +
SYNOPSIS
+ +
+
+scrollutil::enableScrollingByWheel ?scrollableWidgetContainer scrollableWidgetContainer ...?
+
+
+ +
REQUIRED TK VERSION
+ +
8.4 or higher on X11 and Mac OS X; 8.6b2 or later on Windows. + +
DESCRIPTION
+ +
Adds the specified scrollable widget containers to the internal list of + widget containers that are registered for scrolling by the mouse wheel + event bindings created by the scrollutil::createWheelEventBindings command.
+ +
REMARK:  When a scrollable widget container + whose path name was passed to this command gets destroyed, it is + automatically removed from the above-mentioned internal list of registered + widget containers.
+ +
KEYWORDS
+ +
mouse wheel event, binding, scrolling, scrollable widget container
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::adaptWheelEventHandling + Command

+ +
+
NAME
+ +
scrollutil::adaptWheelEventHandling – Adapt mouse + wheel event handling
+ +
SYNOPSIS
+ +
+
+scrollutil::adaptWheelEventHandling ?widget widget ...?
+
+
+ +
REQUIRED TK VERSION
+ +
8.4 or higher on X11 and Mac OS X; 8.6b2 or later on Windows. + +
DESCRIPTION
+ +
For each widget argument, the command performs the + following actions:
+ +
+
    +
  • + If widget is the path name of a tablelist widget then it sets + the latter's -xmousewheelwindow and + -ymousewheelwindow options to the path name of + the containing toplevel window, provided that the Tablelist version + is 6.4 or later (for earlier Tablelist versions the command silently + ignores any tablelist widget passed to it as argument).  As a + result, a mouse wheel event over the tablelist's body or edit window + (more precisely, a mouse wheel event sent to any component of the + tablelist having the binding tag TablelistBody or + TablelistEdit) will be handled as follows: + +
      +
    • If the focus is inside the tablelist widget then the event will + scroll the tablelist or its edit window and no further processing + of the event will take place.
    • + +
    • If the focus is outside the tablelist widget then no + scrolling of the tablelist's body or edit window will happen.  + Instead, the event will be redirected to the containing toplevel + window via  event generate.  This in + turn will trigger a scrolling of the (innermost) widget container + that is an ancestor of widget and has the same + toplevel (if there is such a scrollable widget container), provided + that the path name of the containing toplevel widget or the binding + tag all was passed to the scrollutil::createWheelEventBindings + command and this widget container was registered for scrolling via + scrollutil::enableScrollingByWheel.
    • +
    +
  • + +
  • + Otherwise it locates the (first) binding tag that has mouse wheel + event bindings and is different from both the path name of the + containing toplevel window and all.  If the + search for this tag was successful then the command modifies the + widget's list of binding tags by prepending the tag + WheeleventRedir and appending the tag + WheeleventBreak to this binding tag.  As a + result, a mouse wheel event sent to this widget will be handled as + follows: + +
      +
    • If the focus is on or inside the window  + [focusCheckWindow + widget]  then the event will be handled by the + binding script associated with this tag and no further processing + of the event will take place.
    • + +
    • If the focus is outside the window  + [focusCheckWindow widget]  then the + event will be redirected to the containing toplevel window + via  event generate  rather than + being handled by the binding script associated with the + above-mentioned tag.  This in turn will trigger a scrolling of + the (innermost) widget container that is an ancestor of + widget and has the same toplevel (if there is + such a scrollable widget container), provided that the path name of + the containing toplevel widget or the binding tag + all was passed to the scrollutil::createWheelEventBindings + command and this widget container was registered for scrolling via + scrollutil::enableScrollingByWheel.
    • +
    +
  • +
+
+ +
REMARK 1:  This command is designed to be + invoked for widgets that have mouse wheel event bindings and are + descendants of a scrollable widget container (although it does no harm if + it is called for other widgets, too).  The Tk and tile widgets having + class bindings for mouse wheel events are: listbox, text, Tk core + scrollbar, ttk::scrollbar, ttk::combobox, ttk::spinbox, and + ttk::treeview.  Examples of widgets with binding tags other than their + class names that have mouse wheel event bindings are tablelist widgets as + well as the entry components of mentry widgets of type + "Date", "Time", "DateTime", + "IPAddr", and "IPv6Addr" (for Mentry versions 3.2 + and above).
+ +
REMARK 2:  The mouse wheel event class bindings + for the Tk core scrollbar on Windows and X11 were added in Tk 8.6.  + Prior to this Tk version there were such bindings only for the windowing + systems classic and aqua on the + Macintosh.  Scrollutil eliminates this discrepancy by automatically + creating the Scrollbar class bindings for mouse wheel + events on Windows and X11.  Note also that the ttk::scrollbar widget + has no built-in class bindings for mouse wheel events, but + Scrollutil automatically creates the missing bindings by copying the mouse + wheel event bindings of the widget class Scrollbar to + the binding tag TScrollbar.
+ +
REMARK 3:  As mentioned above, Tk core scrollbar + and ttk::scrollbar widgets have class bindings for mouse wheel events, + hence this command should be invoked for them in case they are descendants + of a scrollable widget container.  Since this task can become tedious, + Scrollutil makes sure that if you pass a widget to this command and that + widget is embedded into a scrollarea via the + latter's setwidget subcommand, then this + command will automatically be invoked for the scrollbars of that + scrollarea, too.
+ +
REMARK 4:  When handling a mouse wheel event + sent to a Tk core or tile scrollbar whose path name was passed to this + command, if the focus is on or inside the associated widget then the event + will be processed by the scrollbar rather than being redirected to the + containing toplevel, just as if the focus were on the scrollbar + itself.
+ +
REMARK 5:  Invoking this command for widgets + that have mouse wheel event bindings and are descendants of a scrollable + widget container is essential for a user-friendly mouse wheel event + handling in scrollable widget containers.  Without this step the mouse + wheel events would scroll both the listbox, text, ttk::treeview, or + tablelist widget under the pointer and the widget container to whose + descendants the latter belongs, or they would select the next/previous + value in the ttk::combobox or ttk::spinbox under the pointer in addition + to scrolling the widget container.  After invoking this command, + e.g, for a listbox within a scrollable widget container, the mouse wheel + events over that widget will only scroll the listbox if it has the + focus.  Likewise, after invoking this command for a ttk::combobox or + ttk::spinbox within a scrollable widget container, the mouse wheel events + over that widget will only select its next/previous value if it has the + focus.  In both examples, if the focus is outside the widget in + question then the mouse wheel events will scroll the widget container + instead.
+ +
KEYWORDS
+ +
mouse wheel event, binding, event handling, scrolling, scrollable + widget container, focus
+
+ +
+

Contents     Start page

+
+ +
+ +

The + scrollutil::setFocusCheckWindow Command

+ +
+
NAME
+ +
scrollutil::setFocusCheckWindow – Set the "focus + check window"
+ +
SYNOPSIS
+ +
+
+scrollutil::setFocusCheckWindow widget ?widget ...? otherWidget
+
+
+ +
REQUIRED TK VERSION
+ +
8.4 or higher on X11 and Mac OS X; 8.6b2 or later on Windows. + +
DESCRIPTION
+ +
For each widget argument, the command sets the + associated "focus check window" to otherWidget.  + This is the window to be used in the binding scripts for the tag + WheeleventRedir instead of the + widget when checking whether the focus is on/inside or outside that + window.  For each widget argument, + otherWidget must be an ancestor of or identical to + widget.
+ +
REMARK 1:  When a widget whose path name was + passed to this command as one of its widget arguments + gets destroyed, the association between the widget and its "focus check + window" is automatically removed.
+ +
REMARK 2:  This command comes in handy if for + some widgets you want to make the focus check within the binding scripts + for the tag WheeleventRedir less restrictive.  For + example, if the widget under the pointer is an entry component of a + mentry me + of type "Date", "Time", "DateTime", + "IPAddr", or "IPv6Addr" and the focus is on any + of its siblings, then the mouse wheel events sent to this entry should be + handled by the entry widget itself rather than scrolling the widget + container that is an ascendant of the mentry.  You can achieve this by + invoking
+ +
+
+
+set entryList [$me entries]
+eval scrollutil::adaptWheelEventHandling $entryList
+eval scrollutil::setFocusCheckWindow     $entryList [list $me]
+
+
+
+ +
With Tcl/Tk 8.5 or above, you can use the more compact form
+ +
+
+
+set entryList [$me entries]
+scrollutil::adaptWheelEventHandling {*}$entryList
+scrollutil::setFocusCheckWindow     {*}$entryList $me
+
+
+
+ +
REMARK 3:  As a similar example, suppose that + ss is a scrollsync + widget that was populated via its setwidgets subcommand with + child widgets.  Then, if the widget under the pointer is one of these + children and the focus is on any of the other children passed to that + subcommand, then the mouse wheel events sent to the child under the pointer + should be handled by that child widget itself rather than scrolling the + widget container that is an ascendant of the scrollsync.  You can + achieve this with the following code:
+ +
+
+
+set widgetList [$ss widgets]
+eval scrollutil::adaptWheelEventHandling $widgetList
+eval scrollutil::setFocusCheckWindow     $widgetList [list $ss]
+
+
+
+ +
Again, with Tcl/Tk 8.5 or above, you can use the more compact form
+ +
+
+
+set widgetList [$ss widgets]
+scrollutil::adaptWheelEventHandling {*}$widgetList
+scrollutil::setFocusCheckWindow     {*}$widgetList $ss
+
+
+
+ +
KEYWORDS
+ +
binding, focus, "focus check window"
+
+ +
+

Contents     Start page

+
+ +
+ +

The scrollutil::focusCheckWindow + Command

+ +
+
NAME
+ +
scrollutil::focusCheckWindow – Query the "focus + check window"
+ +
SYNOPSIS
+ +
+
+scrollutil::focusCheckWindow widget
+
+
+ +
REQUIRED TK VERSION
+ +
8.4 or higher on X11 and Mac OS X; 8.6b2 or later on Windows. + +
DESCRIPTION
+ +
Returns the path name of the "focus check window" associated with the + widget argument.  This is the window that is used + in the binding scripts for the tag WheeleventRedir instead of the widget when checking + whether the focus is on/inside or outside that window.  If the command + scrollutil::setFocusCheckWindow was not + invoked for widget then the return value is + widget itself.
+ +
KEYWORDS
+ +
binding, focus, "focus check window"
+
+ +
+

Contents     Start page

+
+ +
+ + ADDED embedded/www/tklib/files/modules/tablelist/adwaita.png Index: embedded/www/tklib/files/modules/tablelist/adwaita.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/adwaita.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/ambiance.png Index: embedded/www/tklib/files/modules/tablelist/ambiance.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/ambiance.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/aqua.png Index: embedded/www/tklib/files/modules/tablelist/aqua.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/aqua.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/arc.png Index: embedded/www/tklib/files/modules/tablelist/arc.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/arc.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/arrowStyles.png Index: embedded/www/tklib/files/modules/tablelist/arrowStyles.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/arrowStyles.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/arrowStyles_vista.png Index: embedded/www/tklib/files/modules/tablelist/arrowStyles_vista.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/arrowStyles_vista.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/baghira.png Index: embedded/www/tklib/files/modules/tablelist/baghira.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/baghira.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/bicolor1.png Index: embedded/www/tklib/files/modules/tablelist/bicolor1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/bicolor1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/bicolor2.png Index: embedded/www/tklib/files/modules/tablelist/bicolor2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/bicolor2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/bicolor3.png Index: embedded/www/tklib/files/modules/tablelist/bicolor3.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/bicolor3.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/bicolor4.png Index: embedded/www/tklib/files/modules/tablelist/bicolor4.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/bicolor4.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/blueMenta.png Index: embedded/www/tklib/files/modules/tablelist/blueMenta.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/blueMenta.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/browse.png Index: embedded/www/tklib/files/modules/tablelist/browse.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/browse.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/browseTree.png Index: embedded/www/tklib/files/modules/tablelist/browseTree.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/browseTree.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/bwidget.png Index: embedded/www/tklib/files/modules/tablelist/bwidget.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/bwidget.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/classic1.png Index: embedded/www/tklib/files/modules/tablelist/classic1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/classic1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/classic2.png Index: embedded/www/tklib/files/modules/tablelist/classic2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/classic2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/classic3.png Index: embedded/www/tklib/files/modules/tablelist/classic3.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/classic3.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/classic4.png Index: embedded/www/tklib/files/modules/tablelist/classic4.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/classic4.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/config.png Index: embedded/www/tklib/files/modules/tablelist/config.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/config.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/dirViewer.png Index: embedded/www/tklib/files/modules/tablelist/dirViewer.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/dirViewer.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/dust.png Index: embedded/www/tklib/files/modules/tablelist/dust.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/dust.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/dustSand.png Index: embedded/www/tklib/files/modules/tablelist/dustSand.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/dustSand.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/embeddedWindows.png Index: embedded/www/tklib/files/modules/tablelist/embeddedWindows.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/embeddedWindows.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/embeddedWindows_tile.png Index: embedded/www/tklib/files/modules/tablelist/embeddedWindows_tile.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/embeddedWindows_tile.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/gtk.png Index: embedded/www/tklib/files/modules/tablelist/gtk.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/gtk.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/index.html Index: embedded/www/tklib/files/modules/tablelist/index.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/index.html @@ -0,0 +1,62 @@ + + + + The Multi-Column Listbox and Tree Widget Package Tablelist 6.8 + + + + + + +
+

The Multi-Column Listbox and Tree Widget Package Tablelist 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Tablelist Programmer's Guide

+ +

The tablelist::tablelist + Command

+ +

Commands for Interactive Sorting by One or + More Columns

+ +

Commands Related to Binding + Scripts

+ +

Commands Related to Tile Themes

+ +

Interactive Tablelist Cell Editing Using Tk + Core Widgets

+ +

Interactive Tablelist Cell Editing Using Tile + Widgets

+ +

Interactive Tablelist Cell Editing Using + the BWidget Package

+ +

Interactive Tablelist Cell Editing Using + the Iwidgets Package

+ +

Interactive Tablelist Cell Editing Using + the combobox Package

+ +

Interactive Tablelist Cell Editing Using + the ctext Package

+ +

Interactive Tablelist Cell Editing Using + the Mentry Package

+ + ADDED embedded/www/tklib/files/modules/tablelist/klearlooks.png Index: embedded/www/tklib/files/modules/tablelist/klearlooks.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/klearlooks.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/mate.png Index: embedded/www/tklib/files/modules/tablelist/mate.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/mate.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/menta.png Index: embedded/www/tklib/files/modules/tablelist/menta.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/menta.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/mint.png Index: embedded/www/tklib/files/modules/tablelist/mint.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/mint.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/mint2.png Index: embedded/www/tklib/files/modules/tablelist/mint2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/mint2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/newWave.png Index: embedded/www/tklib/files/modules/tablelist/newWave.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/newWave.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/oxygen1.png Index: embedded/www/tklib/files/modules/tablelist/oxygen1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/oxygen1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/oxygen2.png Index: embedded/www/tklib/files/modules/tablelist/oxygen2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/oxygen2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/phase.png Index: embedded/www/tklib/files/modules/tablelist/phase.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/phase.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/plain1.png Index: embedded/www/tklib/files/modules/tablelist/plain1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/plain1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/plain2.png Index: embedded/www/tklib/files/modules/tablelist/plain2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/plain2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/plain3.png Index: embedded/www/tklib/files/modules/tablelist/plain3.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/plain3.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/plain4.png Index: embedded/www/tklib/files/modules/tablelist/plain4.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/plain4.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/plastik.png Index: embedded/www/tklib/files/modules/tablelist/plastik.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/plastik.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/plastique.png Index: embedded/www/tklib/files/modules/tablelist/plastique.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/plastique.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/radiance.png Index: embedded/www/tklib/files/modules/tablelist/radiance.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/radiance.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/scrollbars.png Index: embedded/www/tklib/files/modules/tablelist/scrollbars.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/scrollbars.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/styles.png Index: embedded/www/tklib/files/modules/tablelist/styles.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/styles.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/stylesheet.css Index: embedded/www/tklib/files/modules/tablelist/stylesheet.css ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/stylesheet.css @@ -0,0 +1,12 @@ +/* generic class defining a top margin whose height equals the font size */ +.tm {margin-top: 1em} + +/* background, border, and padding for the
 tag */
+pre {background: #F7F7F7; border: silver solid 1px; padding: 1px}
+
+/* background for the  tag */
+body {background: #FFFFFF}
+
+/* color for the  tag */
+span.red {color: #E00000}
+span.cmt {color: #36648b}

ADDED   embedded/www/tklib/files/modules/tablelist/tablelist.html
Index: embedded/www/tklib/files/modules/tablelist/tablelist.html
==================================================================
--- /dev/null
+++ embedded/www/tklib/files/modules/tablelist/tablelist.html
@@ -0,0 +1,2791 @@
+
+
+
+  Tablelist Programmer's Guide
+
+  
+  
+
+  
+
+
+
+  
+

Tablelist Programmer's Guide

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Overview

+ + + +

Examples

+ + + + + +
+ +

Overview

+ +

What Is Tablelist?

+ +

Tablelist is a library package for Tcl/Tk versions 8.0 or higher, written + in pure Tcl/Tk code.  It contains:

+ +
    +
  • the implementation of the tablelist mega-widget, including a + general utility module for mega-widgets;
  • + +
  • a demo script containing a useful procedure that displays the + configuration options of an arbitrary widget in a tablelist and enables you + to edit their values interactively;
  • + +
  • a demo script implementing a widget browser based on a tablelist used + as multi-column listbox;
  • + +
  • a demo script implementing a widget browser based on a tablelist used + as multi-column tree widget;
  • + +
  • a demo script implementing a directory viewer based on a tablelist used + as multi-column tree widget;
  • + +
  • a demo script showing several ways to improve the appearance of a + tablelist widget;
  • + +
  • four further demo scripts, illustrating the interactive cell editing + with the aid of various widgets from the Tk core and from the packages + tile, BWidget, Iwidgets, combobox (by Bryan Oakley), and Mentry;
  • + +
  • one further demo script, with a tablelist widget containing embedded + windows;
  • + +
  • tile-based counterparts of the above-mentioned demo scripts;
  • + +
  • this tutorial;
  • + +
  • reference pages in HTML format.
  • +
+ +

A tablelist is a multi-column listbox and tree widget.  The width of + each column can be dynamic (i.e., just large enough to hold all its elements, + including the header) or static (specified in characters or pixels).  + The columns are, per default, resizable.  The alignment of each column + can be specified as left, right, or + center.

+ +

The columns, rows, and cells can be configured individually.  Several + of the global and column-specific options refer to the header titles, + implemented as label widgets.  For instance, the + -labelcommand option specifies a Tcl command to be invoked when + mouse button 1 is released over a header label.  The most common value + of this option sorts the items based on the respective column.

+ +

The Tablelist package provides a great variety of tree styles controlling + the look & feel of the column that displays the tree hierarchy with the aid + of indentations and expand/collapse controls.

+ +

Interactive editing of the elements of a tablelist widget can be enabled + for individual cells and for entire columns.  A great variety of widgets + from the Tk core and from the packages tile, BWidget, Iwidgets, combobox, + ctext, and Mentry (or Mentry_tile) is supported for being used as embedded + edit window.  In addition, a rich set of keyboard bindings is provided + for a comfortable navigation between the editable cells.

+ +

The Tcl command corresponding to a tablelist widget is very similar to the + one associated with a normal listbox.  There are column-, row-, and + cell-specific counterparts of the configure and + cget subcommands (columnconfigure, + rowconfigure, cellconfigure, ...).  They can + be used, among others, to insert images into the cells and the header labels, + or to insert embedded windows into the cells.  The index, + nearest, and see command options refer to the rows, + but similar subcommands are provided for the columns and cells + (columnindex, cellindex, ...).  The items can + be sorted with the sort, sortbycolumn, and + sortbycolumnlist command options.

+ +

The bindings defined for the body of a tablelist widget make it behave + just like a normal listbox.  This includes the support for the virtual + event <<ListboxSelect>> (which is equivalent to + <<TablelistSelect>>).  In addition, versions + 2.3 or higher of the widget callback package Wcb (written in pure Tcl/Tk code + as well) can be used to define callbacks for the activate,  + selection set,  and  selection + clear  commands, and Wcb versions 3.0 or higher also support + callbacks for the activatecellcellselection + set,  and  cellselection clear  + commands.  The download location of Wcb is

+ +
+
+ https://www.nemethi.de +
+
+ +

How to Get It?

+ +

Tablelist is available for free download from the same URL as Wcb.  + The distribution file is tablelist6.8.tar.gz for UNIX and + tablelist6_8.zip for Windows.  These files contain the same + information, except for the additional carriage return character preceding + the linefeed at the end of each line in the text files for Windows.

+ +

Tablelist is also included in tklib, which has the address

+ +
+
+ https://core.tcl.tk/tklib +
+
+ +

How to Install It?

+ +

Install the package as a subdirectory of one of the directories given by + the auto_path variable.  For example, you can install it as + a directory at the same level as the Tcl and Tk script libraries.  The + locations of these library directories are given by the + tcl_library and tk_library variables, + respectively.

+ +

To install Tablelist on UNIX, cd to the desired + directory and unpack the distribution file + tablelist6.8.tar.gz:

+ +
+
+gunzip -c tablelist6.8.tar.gz | tar -xf -
+
+
+ +

On most UNIX systems this can be replaced with

+ +
+
+tar -zxf tablelist6.8.tar.gz
+
+
+ +

Both commands will create a directory named tablelist6.8, + with the subdirectories demos, doc, and + scripts.

+ +

On Windows, use WinZip or some other program capable of unpacking + the distribution file tablelist6_8.zip into the directory + tablelist6.8, with the subdirectories demos, + doc, and scripts.

+ +

The file tablelistEdit.tcl in the scripts + directory is only needed for applications making use of interactive cell + editing.  Similarly, the file tablelistMove.tcl in the same + directory is only required for scripts invoking the move or + movecolumn command.  Finally, the file + tablelistThemes.tcl is only needed for applications using the + package Tablelist_tile (see next section).

+ +

Next, you should check the exact version number of your Tcl/Tk + distribution, given by the tcl_patchLevel and + tk_patchLevel variables.  If you are using Tcl/Tk version + 8.2.X, 8.3.0 - 8.3.2, or 8.4a1, then you should upgrade your Tcl/Tk + distribution to a higher release.  This is because a bug in these Tcl + versions (fixed in Tcl 8.3.3 and 8.4a2) causes excessive memory use when + calling  info exists  on non-existent array elements, + and Tablelist makes a lot of invocations of this command.

+ +

If for some reason you cannot upgrade your Tcl/Tk version, then you should + execute the Tcl script repair.tcl in the directory + scripts.  This script makes backup copies of several files + contained in this directory, and then creates new versions of them by + replacing all invocations of  info exists  for array + elements with a call to the helper procedure + arrElemExists.  The patched files work with all Tcl/Tk + releases starting with 8.0, but the original ones have a much better + performance.

+ +

Notice that in tklib the Tablelist demos directory is + replaced with the subdirectory tablelist of the + examples directory.  Please take this into account when + reading the examples below.

+ +

How to Use It?

+ +

The Tablelist distribution provides two packages, called Tablelist + and Tablelist_tile.  The main difference between the two is that + Tablelist_tile enables the tile-based, theme-specific appearance of tablelist + widgets; this package requires Tcl/Tk 8.4 or higher and tile 0.6 or + higher.  It is not possible to use both packages in one and the same + application, because both are implemented in the same tablelist + namespace and provide identical commands.

+ +

To be able to access the commands and variables defined in the package + Tablelist, your scripts must contain one of the lines

+ +
+
+package require tablelist ?version?
+package require Tablelist ?version?
+
+
+ +

You can use either one of the two statements above because the file + tablelist.tcl contains both lines

+ +
+
+package provide tablelist ...
+package provide Tablelist ...
+
+
+ +

Likewise, to be able to access the commands and variables defined in the + package Tablelist_tile, your scripts must contain one of the lines

+ +
+
+package require tablelist_tile ?version?
+package require Tablelist_tile ?version?
+
+
+ +

Again, you can use either one of the two statements above because the file + tablelist_tile.tcl contains both lines

+ +
+
+package provide tablelist_tile ...
+package provide Tablelist_tile ...
+
+
+ +

You are free to remove one of the above lines from + tablelist.tcl and tablelist_tile.tcl, respectively, + if you want to prevent the corresponding packages from making themselves + known under two different names each.  Of course, by doing so you + restrict the argument of  package require  to a single + name per package.

+ +

Please note that ActiveTcl versions 8.5 and later use a modified + package mechanism, which only exports the all-lowercase names + tablelist and tablelist_tile.

+ +

REMARK:  If you have an earlier Tablelist version as part of + ActiveTcl 8.5 or above and the new Tablelist release 6.8, then it is highly + recommended to specify the version number 6.8 in the  + package require  command, because otherwise the interpreter + will load the old Tablelist version included in ActiveTcl as Tcl + Module.  The examples below use the + statement  package require tablelist 6.8,  and their + tile-based counterparts invoke the command  package require + tablelist_tile 6.8.

+ +

Since the packages Tablelist and Tablelist_tile are implemented in the + tablelist namespace, you must either invoke the

+ +
+
+namespace import tablelist::pattern ?tablelist::pattern ...?
+
+
+ +

command to import the procedures you need, or use qualified names + like tablelist::tablelist.  In the examples below we have + chosen the latter approach.

+ +

To access Tablelist variables, you must use qualified + names.  There are only 5 Tablelist variables (and one more when using + Tablelist_tile) that are designed to be accessed outside the namespace + tablelist:

+ +
    +
  • The variable tablelist::version holds the current version + number of the Tablelist and Tablelist_tile packages.
  • + +
  • The variable tablelist::library holds the location of the + Tablelist installation directory.
  • + +
  • The variable tablelist::scalingpct holds the scaling + percentage used by Tablelist when adapting the sizes of the tree styles + vistaAero, vistaClassic, win7Aero, + win7Classic, and win10 to the display's DPI + scaling level.  The currently supported values are 100, + 125, 150, and 200.  You can use + the value of this variable, e.g., if you want to create images of different + sizes, depending on the DPI scaling factor.  For example, if your + application uses images of size 16 x 16 on an unscaled display and + tablelist::scalingpct has the value 150, then the + image size for this display should be 24 x 24.
  • + +
  • The boolean variable tablelist::strictTk (having the + default value 0) controls the strict listbox-compatibility of + the default bindings.
  • + +
  • The read-only boolean variable tablelist::usingTile has + the value 0 in the package Tablelist and the value + 1 in Tablelist_tile.
  • + +
  • In Tablelist_tile the array tablelist::themeDefaults holds + the theme-specific default values of a series of Tablelist configuration + options.
  • +
+ +

More on Tablelist_tile

+ +

A tablelist widget consists of a body (containing the items) and a header + (displaying the column titles and optional header items).  Both + components are contained in a hull, implemented as a frame.  The header + has a rather complex structure, consisting, among others, of frame and label + widgets.  While in the Tablelist package all of these components are Tk + widgets, the Tablelist_tile package uses both Tk and tile frame and label + widgets.  Due to several incompatibilities between Tk and tile, it is + currently not possible to replace all Tk widgets making up a tablelist with + their tile counterparts.

+ +

From the above it follows that the package Tablelist_tile will only + work as expected if the Tk frame and label commands + haven't been overridden by using  namespace import -force + ttk::*  at global scope.  While earlier tile releases + suggested using this command at global scope for the really adventurous, in + newer tile versions this is considered a Really Bad Idea, causing many things + to break.  Instead, you should explicitly invoke + ttk::frame, ttk::label, etc. whenever you want to + use a tile widget.

+ +

Overriding some other Tk widgets at global scope may be equally + dangerous when using various widgets from the Tk core and from the packages + BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry for + interactive cell editing, because these packages expect Tk widgets, which + may not always be replaced by their tile counterparts.

+ +

Another restriction to be taken into account is due to the fact that in + earlier tile versions the  (ttk::)style theme use  + command could only be used to set the current theme, but not to retrieve + it.  For this reason, the package Tablelist_tile 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-based tablelist widgets will only have + the expected appearance if the platform-specific default theme is either left + unchanged or replaced with another theme by invoking the procedure + ttk::setTheme or tile::setTheme, depending on the + current tile version.  (See also the tablelist::setTheme command.)

+ +

After these cautions concerning the use of tile, the rest of this section + describes the differences between the packages Tablelist and + Tablelist_tile.

+ +

The Tablelist_tile package checks whether the required Tk and tile + versions are present, by executing the commands

+ +
+
+package require Tk 8.4
+if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
+    package require tile 0.6
+}
+
+
+ +

The second command above reflects the fact that, beginning with Tk 8.5a6, + tile is integrated into the Tk core and therefore it should only be loaded + explicitly when using an earlier Tk version.

+ +

Apart from this and the _tile suffix in the  + package require  command, the only difference (from the + programmer's point of view) between the packages Tablelist and Tablelist_tile + is related to the supported configuration options:  The + -highlightbackground, -highlightcolor, + -highlightthickness, -labelbackground, + -labelactivebackground, -labelactiveforeground, + -labeldisabledforeground, and -labelheight options + (the latter at both widget and column levels), present in the Tablelist + package, are not supported by Tablelist_tile.  The first three are + standard Tk widget options that are not available for tile widgets.  The + -labelbackground option stands for the -background + option of the column labels, and current versions of the tile engine don't + support setting the background color for these widgets with a special header + layout.  The remaining options stand for the + -activebackground, -activeforeground, + -disabledforeground, and -height options of the + column labels, and these configuration options are not supported for tile + label widgets.

+ +

Also, take into account that in some themes, setting the + -labelborderwidth option (at widget or column level) to a value + other than the default might be ignored by tile and thus could cause + alignment problems.  This is because the border of tile widgets is drawn + with theme-specific methods, which will not always produce the results known + from Tk widgets.

+ +

Finally, notice that, when using the tileqt theme, the + version number of the tile::theme::tileqt package must be 0.4 or + higher, and tileqt itself won't work with tile versions earlier + than 0.7.

+ +
+

Contents     Start page

+
+ +
+ +

Examples

+ +

A tablelist Widget for Displaying and Editing + Configuration Options

+ +

The file config.tcl in the demos directory + contains a procedure demo::displayConfig that displays the + configuration options of an arbitrary widget in a tablelist contained in a + newly created toplevel widget and allows you to edit these options.  + This procedure can prove to be quite useful during interactive GUI + development.  To test it, start wish and evaluate the file + by using the source command as follows:

+ +
    +
  • + If wish was started in the demos directory then + it is sufficient to enter + +
    +
    +source config.tcl
    +
    +
    +
  • + +
  • + If wish was started in some other directory then you can use + the tablelist::library variable to find the location of the + file.  For example, assuming that your Tablelist installation has + the directory structure described in the How to + install it? section, the required commands are: + +
    +
    +package require tablelist 6.8
    +source [file join $tablelist::library demos config.tcl]
    +
    +
    +
  • +
+ +

In both cases, the script will print the following message to + stdout:

+ +
+
+To display the configuration options of an arbitrary widget, enter
+
+        demo::displayConfig <widgetName>
+
+
+ +

<widgetName> can be the path name of any already + existing widget.  For example, if you enter

+ +
+
+demo::displayConfig .
+
+
+ +

then you will see that a tablelist widget .configTop.tf.tbl + in a new toplevel window is created and its name is printed to + stdout.  If you then enter

+ +
+
+demo::displayConfig .configTop.tf.tbl
+
+
+ +

then another toplevel window containing the tablelist widget + .configTop2.tf.tbl will pop up.  The latter looks like in + the following figure:

+ +
+ Configuration Options +
+ +

It is assumed that the Tcl command associated with the widget specified by + <widgetName> has a configure subcommand + which, when invoked without any argument, returns a list describing all of + the available configuration options for the widget, in the common format + known from the standard Tk widgets.  The + demo::displayConfig procedure inserts the items of this list + into a scrolled tablelist with 5 dynamic-width columns and interactive sort + capability, and returns the name of the newly created tablelist widget:

+ +
+
+package require tablelist 6.8
+
+namespace eval demo {
+    #
+    # Get the current windowing system ("x11", "win32", "classic", or "aqua")
+    # and add some entries to the Tk option database for the following
+    # widget hierarchy within a toplevel widget of the class DemoTop:
+    #
+    # Name              Class
+    # -----------------------------
+    # tf                Frame
+    #   tbl               Tabellist
+    #   vsb, hsb          Scrollbar
+    # bf                Frame
+    #   b1, b2, b3        Button
+    #
+    variable winSys
+    if {[catch {tk windowingsystem} winSys] != 0} {
+        switch $::tcl_platform(platform) {
+            unix        { set winSys x11 }
+            windows     { set winSys win32 }
+            macintosh   { set winSys classic }
+        }
+    }
+    if {[string compare $winSys "x11"] == 0} {
+        #
+        # Create the font TkDefaultFont if not yet present
+        #
+        catch {font create TkDefaultFont -family Helvetica -size -12}
+
+        option add *DemoTop*Font                        TkDefaultFont
+        option add *DemoTop*selectBackground            #5294e2
+        option add *DemoTop*selectForeground            white
+    }
+    option add *DemoTop.tf.borderWidth                  1
+    option add *DemoTop.tf.relief                       sunken
+    option add *DemoTop.tf.tbl.borderWidth              0
+    option add *DemoTop.tf.tbl.highlightThickness       0
+    option add *DemoTop.tf.tbl.background               white
+    option add *DemoTop.tf.tbl.stripeBackground         #f0f0f0
+    option add *DemoTop.tf.tbl.setGrid                  yes
+    option add *DemoTop.tf.tbl*Entry.background         white
+    option add *DemoTop.bf.Button.width                 10
+}
+
+#------------------------------------------------------------------------------
+# demo::displayConfig
+#
+# Displays the configuration options of the widget w in a tablelist widget
+# contained in a newly created toplevel widget.  Returns the name of the
+# tablelist widget.
+#------------------------------------------------------------------------------
+proc demo::displayConfig w {
+    if {![winfo exists $w]} {
+        bell
+        tk_messageBox -title "Error" -icon error -message \
+            "Bad window path name \"$w\""
+        return ""
+    }
+
+    #
+    # Create a toplevel widget of the class DemoTop
+    #
+    set top .configTop
+    for {set n 2} {[winfo exists $top]} {incr n} {
+        set top .configTop$n
+    }
+    toplevel $top -class DemoTop
+    wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\""
+
+    #
+    # Create a scrolled tablelist widget with 5 dynamic-width
+    # columns and interactive sort capability within the toplevel
+    #
+    set tf $top.tf
+    frame $tf
+    set tbl $tf.tbl
+    set vsb $tf.vsb
+    set hsb $tf.hsb
+    tablelist::tablelist $tbl \
+        -columns {0 "Command-Line Name"
+                  0 "Database/Alias Name"
+                  0 "Database Class"
+                  0 "Default Value"
+                  0 "Current Value"} \
+        -labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \
+        -editendcommand demo::applyValue -height 15 -width 100 -stretch all \
+        -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
+    if {[$tbl cget -selectborderwidth] == 0} {
+        $tbl configure -spacing 1
+    }
+    $tbl columnconfigure 3 -maxwidth 30
+    $tbl columnconfigure 4 -maxwidth 30 -editable yes
+    scrollbar $vsb -orient vertical   -command [list $tbl yview]
+    scrollbar $hsb -orient horizontal -command [list $tbl xview]
+
+    #
+    # Create three buttons within a frame child of the toplevel widget
+    #
+    set bf $top.bf
+    frame $bf
+    set b1 $bf.b1
+    set b2 $bf.b2
+    set b3 $bf.b3
+    button $b1 -text "Refresh"     -command [list demo::putConfig $w $tbl]
+    button $b2 -text "Sort as Set" -command [list $tbl sort]
+    button $b3 -text "Close"       -command [list destroy $top]
+
+    #
+    # Manage the widgets
+    #
+    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
+    variable winSys
+    if {[string compare $winSys "win32"] == 0} {
+        grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
+    } else {
+        grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
+        grid $vsb              -row 1 -column 1 -sticky ns
+    }
+    grid $hsb -row 2 -column 0 -sticky ew
+    grid rowconfigure    $tf 1 -weight 1
+    grid columnconfigure $tf 0 -weight 1
+    pack $b1 $b2 $b3 -side left -expand yes -pady 10
+    pack $bf -side bottom -fill x
+    pack $tf -side top -expand yes -fill both
+
+    #
+    # Populate the tablelist with the configuration options of the given widget
+    #
+    putConfig $w $tbl
+    return $tbl
+}
+
+
+ +

The procedure invokes the tablelist::tablelist command to create a + tablelist widget.  The value of the -columns option passed to this + command specifies the widths, titles, and alignments of the 5 columns.  + The width of each column is given as 0, specifying that the + column's width is to be made just large enough to hold all the elements in + the column, including its title, which is the string following the + width.  We have omitted the alignment specifications (which can + optionally follow the titles), because the columns shall all be + left-justified.

+ +

Since all columns are of dynamic width and left-aligned, instead of + -columns we could have used the -columntitles option as + follows:

+ +
+
+    tablelist::tablelist $tbl \
+        -columntitles {"Command-Line Name"
+                       "Database/Alias Name"
+                       "Database Class"
+                       "Default Value"
+                       "Current Value"} \
+        . . .
+
+
+ +

The command tablelist::sortByColumn, + specified as the value of the -labelcommand option, will be + invoked whenever mouse button 1 is released over one of the labels.  + This command sorts the items based on the column corresponding to that label, + in the right order, by invoking the sortbycolumn subcommand of the + Tcl command associated with the tablelist widget.

+ +

As seen from the creation of the button displaying the text  + "Sort as Set",  the items will also be sorted by invoking + the sort + subcommand.  This makes it necessary to specify a command to be used for + the comparison of the items, as the value of the -sortcommand option.  In + our example this is the demo::compareAsSet procedure shown + below.

+ +

The -editendcommand option + specifies the command to be invoked automatically whenever the interactive + editing of a cell's content is finished and the final content of the + temporary embedded entry widget used for the editing are different from its + original one.  Per default, the elements of a tablelist widget can only + be edited programmatically, but we enable the interactive editing for the + cells of the last column with the aid of the -editable column configuration + option.

+ +

By specifying the value all for the -stretch configuration option we + make sure that all of the columns will be stretched to eliminate the blank + space that might appear at the right of the table.

+ +

If the default value of the -selectborderwidth option is + 0 (this is the case on the Windows and Macintosh platforms, and + also in an X11 envronment with Tk 8.5 or above) then we use the + -spacing option to + provide some additional space above and below the rows.

+ +

For the last two columns of the tablelist we use the -maxwidth column configuration + option, to make sure that the dynamic widths of these columns won't exceed 30 + average-width characters.

+ +

Besides the options given on the command line, our tablelist widget will + automatically inherit the ones contained in the Tk option database entries + specified in the namespace initialization preceding the + demo::displayConfig procedure.  The database name + stripeBackground corresponds to the -stripebackground + configuration option.  According to this entry, every other row of the + tablelist widget will be displayed in the background color + #f0f0f0, which improves the readability of the items and gives + the widget a nice appearance.

+ +

The option database entries for *DemoTop.tf.borderWidth, + *DemoTop.tf.relief, *DemoTop.tf.tbl.borderWidth, + and *DemoTop.tf.tbl.highlightThickness are implicitly used when + managing the tablelist widget and the two scrollbars with the aid of + grid.  Notice how the cornerpath subcommand enables us + to achieve a native look & feel with respect to the vertical scrollbar on the + windowing systems other than win32 (i.e., aqua and + x11).

+ +

We populate the tablelist by invoking the demo::putConfig + procedure discussed below.  The same script is associated with the + Refresh button, as the value of its -command + configuration option.  This procedure is implemented as follows:

+ +
+
+#------------------------------------------------------------------------------
+# demo::putConfig
+#
+# Outputs the configuration options of the widget w into the tablelist widget
+# tbl.
+#------------------------------------------------------------------------------
+proc demo::putConfig {w tbl} {
+    if {![winfo exists $w]} {
+        bell
+        tk_messageBox -title "Error" -icon error -message \
+            "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
+        return ""
+    }
+
+    #
+    # Display the configuration options of w in the tablelist widget tbl
+    #
+    $tbl delete 0 end
+    foreach configSet [$w configure] {
+        #
+        # Insert the list configSet into the tablelist widget
+        #
+        $tbl insert end $configSet
+
+        if {[llength $configSet] == 2} {
+            $tbl rowconfigure end -foreground gray50 -selectforeground gray75
+            $tbl cellconfigure end -editable no
+        } else {
+            #
+            # Change the colors of the first and last cell of the row
+            # if the current value is different from the default one
+            #
+            set default [lindex $configSet 3]
+            set current [lindex $configSet 4]
+            if {[string compare $default $current] != 0} {
+                foreach col {0 4} {
+                    $tbl cellconfigure end,$col \
+                         -foreground red -selectforeground yellow
+                }
+            }
+        }
+    }
+
+    $tbl sortbycolumn 0
+    $tbl activate 0
+    $tbl attrib widget $w
+}
+
+
+ +

After deleting the current items of the tablelist widget tbl, + the procedure inserts the items of the list returned by the + configure subcommand of the Tcl command associated with the + widget w.  For each option that is merely an abbreviated + form of some other one, we use the rowconfigure tablelist + subcommand to change the normal and selection foreground colors of the item + just appended, and we disable the interactive editing in the last inserted + cell by using the -editable cell configuration + option.  The cellconfigure tablelist + operation is also invoked for each real option whose current value is + different from the default one, to change the values of the + -foreground and -selectforeground options of the + cells no. 0 and 4, containing the command-line name of the option and its + current value.

+ +

Each tablelist widget may have any number of private attributes, + which can be set and retrieved with the aid of the attrib subcommand of the Tcl command + corresponding to the widget.  The demo::putConfig procedure + sets the widget attribute to the name of the widget whose + options are displayed in the tablelist.

+ +

The implementation of the comparison command + demo::compareAsSet mentioned above is quite simple:

+ +
+
+#------------------------------------------------------------------------------
+# demo::compareAsSet
+#
+# Compares two items of a tablelist widget used to display the configuration
+# options of an arbitrary widget.  The item in which the current value is
+# different from the default one is considered to be less than the other; if
+# both items fulfil this condition or its negation then string comparison is
+# applied to the two option names.
+#------------------------------------------------------------------------------
+proc demo::compareAsSet {item1 item2} {
+    foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \
+            {opt2 dbName2 dbClass2 default2 current2} $item2 {
+        set changed1 [expr {[string compare $default1 $current1] != 0}]
+        set changed2 [expr {[string compare $default2 $current2] != 0}]
+        if {$changed1 == $changed2} {
+            return [string compare $opt1 $opt2]
+        } elseif {$changed1} {
+            return -1
+        } else {
+            return 1
+        }
+    }
+}
+
+
+ +

Finally, here is the implementation of the demo::applyValue + procedure, specified as the value of the -editendcommand + option:

+ +
+
+#------------------------------------------------------------------------------
+# demo::applyValue
+#
+# Applies the new value of the configuraton option contained in the given row
+# of the tablelist widget tbl to the widget whose options are displayed in it,
+# and updates the colors of the first and last cell of the row.
+#------------------------------------------------------------------------------
+proc demo::applyValue {tbl row col text} {
+    #
+    # Try to apply the new value of the option contained in
+    # the given row to the widget whose options are displayed
+    # in the tablelist; reject the value if the attempt fails
+    #
+    set w [$tbl attrib widget]
+    set opt [$tbl cellcget $row,0 -text]
+    if {[catch {$w configure $opt $text} result] != 0} {
+        bell
+        tk_messageBox -title "Error" -icon error -message $result \
+            -parent [winfo toplevel $tbl]
+        $tbl rejectinput
+        return ""
+    }
+
+    #
+    # Replace the new option value with its canonical form and
+    # update the colors of the first and last cell of the row
+    #
+    set text [$w cget $opt]
+    set default [$tbl cellcget $row,3 -text]
+    if {[string compare $default $text] == 0} {
+        foreach col {0 4} {
+            $tbl cellconfigure $row,$col \
+                 -foreground "" -selectforeground ""
+        }
+    } else {
+        foreach col {0 4} {
+            $tbl cellconfigure $row,$col \
+                 -foreground red -selectforeground yellow
+        }
+    }
+
+    return $text
+}
+
+
+ +

The procedure retrieves the name of the widget whose options are displayed + in the tablelist, as the value of its widget attribute, and + invokes the cellcget + tablelist subcommand to get the name of the option specified in the first + cell of the row whose last element was just edited.  Next, it tries to + apply the new value of the option to the widget, and invokes the + rejectinput + subcommand if the attempt fails.  Otherwise it replaces the new option + value with its canonical form and updates the normal and selection foreground + colors of the cells no. 0 and 4.  The canonical form of the option value + is given by the cget subcommand of the Tcl command associated + with that widget.  For example, a boolean value will always be replaced + with 1 or 0, even if the entry contains the string + yes or no.  The procedure returns this + canonical option value, thus making sure that the latter will become the new + content of the cell that was just edited.

+ +

Two Widget Browsers Based on a tablelist

+ +

The files browse.tcl and browseTree.tcl in the + demos directory contain a procedure + demo::displayChildren that displays information about the + children of an arbitrary widget in a tablelist contained in a newly created + toplevel widget.  To test it, start wish and evaluate the + chosen file by using the source command, in a similar way as in + the case of the previous example.

+ +

Both scripts will print the following message to stdout:

+ +
+
+To display information about the children of an arbitrary widget, enter
+
+        demo::displayChildren <widgetName>
+
+
+ +

<widgetName> can be the path name of any already + existing widget.  For example, if you enter

+ +
+
+demo::displayChildren .
+
+
+ +

then you will see that a tablelist widget .browseTop.tf.tbl + in a new toplevel window is created and its name is printed to + stdout.

+ +

The tablelist created by the procedure demo::displayChildren + in the file browse.tcl is a multi-column listbox:

+ +
+ Widget Browser +
+ +

The tablelist created by the procedure of the same name in the file + browseTree.tcl is a multi-column tree widget:

+ +
+ Widget Browser +
+ +

The demo::displayChildren command inserts some data of the + children of the widget specified by <widgetName> into a + vertically scrolled tablelist with 9 dynamic-width columns and interactive + sort capability, and returns the name of the newly created tablelist + widget.  By double-clicking an item (e.g., the one containing the path + name .browseTop in browse.tcl and the name + browseTop in browseTree.tcl) or invoking the first + entry of a pop-up menu within the body of the tablelist, you can display the + data of the children of the widget corresponding to the selected item, and + with the second menu entry you can display its configuration options (see the + previous example for details).  To go one level + up, click on the Parent button.

+ +

There is a lot of code common to the scripts browse.tcl and + browseTree.tcl.  We will restrict the description below to + the second one, which requires Tk 8.3 or later, due to the use of several + tree-related tablelist options and subcommands.

+ +
+
+package require Tk 8.3
+package require tablelist 6.8
+
+namespace eval demo {
+    variable dir [file dirname [info script]]
+
+    #
+    # Create two images, needed in the procedure putChildren
+    #
+    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
+                      -background coral -foreground gray50]
+    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
+                      -background yellow -foreground gray50]
+}
+
+source [file join $demo::dir config.tcl]
+
+#------------------------------------------------------------------------------
+# demo::displayChildren
+#
+# Displays information on the children of the widget w in a tablelist widget
+# contained in a newly created toplevel widget.  Returns the name of the
+# tablelist widget.
+#------------------------------------------------------------------------------
+proc demo::displayChildren w {
+    if {![winfo exists $w]} {
+        bell
+        tk_messageBox -title "Error" -icon error -message \
+            "Bad window path name \"$w\""
+        return ""
+    }
+
+    #
+    # Create a toplevel widget of the class DemoTop
+    #
+    set top .browseTop
+    for {set n 2} {[winfo exists $top]} {incr n} {
+        set top .browseTop$n
+    }
+    toplevel $top -class DemoTop
+
+    #
+    # Create a vertically scrolled tablelist widget with 9 dynamic-width
+    # columns and interactive sort capability within the toplevel
+    #
+    set tf $top.tf
+    frame $tf
+    set tbl $tf.tbl
+    set vsb $tf.vsb
+    tablelist::tablelist $tbl \
+        -columns {0 "Name"      left
+                  0 "Class"     left
+                  0 "X"         right
+                  0 "Y"         right
+                  0 "Width"     right
+                  0 "Height"    right
+                  0 "Mapped"    center
+                  0 "Viewable"  center
+                  0 "Manager"   left} \
+        -expandcommand demo::expandCmd -labelcommand demo::labelCmd \
+        -yscrollcommand [list $vsb set] -setgrid no -width 0
+    if {[$tbl cget -selectborderwidth] == 0} {
+        $tbl configure -spacing 1
+    }
+    foreach col {2 3 4 5} {
+        $tbl columnconfigure $col -sortmode integer
+    }
+    foreach col {6 7} {
+        $tbl columnconfigure $col -formatcommand demo::formatBoolean
+    }
+    scrollbar $vsb -orient vertical -command [list $tbl yview]
+
+    #
+    # When displaying the information about the children of any
+    # ancestor of the label widgets, the widths of some of the
+    # labels and thus also the widths and x coordinates of some
+    # children may change.  For this reason, make sure the items
+    # will be updated after any change in the sizes of the labels
+    #
+    foreach l [$tbl labels] {
+        bind $l <Configure> [list demo::updateItemsDelayed $tbl]
+    }
+    bind $tbl <Configure> [list demo::updateItemsDelayed $tbl]
+
+    #
+    # Create a pop-up menu with two command entries; bind the script
+    # associated with its first entry to the <Double-1> event, too
+    #
+    set menu $top.menu
+    menu $menu -tearoff no
+    $menu add command -label "Display Children" \
+                      -command [list demo::putChildrenOfSelWidget $tbl]
+    $menu add command -label "Display Config" \
+                      -command [list demo::dispConfigOfSelWidget $tbl]
+    set bodyTag [$tbl bodytag]
+    bind $bodyTag <Double-1>   [list demo::putChildrenOfSelWidget $tbl]
+    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
+    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
+    bind $bodyTag <<Button3>> +[list demo::postPopupMenu $top %X %Y]
+
+    #
+    # Create three buttons within a frame child of the toplevel widget
+    #
+    set bf $top.bf
+    frame $bf
+    set b1 $bf.b1
+    set b2 $bf.b2
+    set b3 $bf.b3
+    button $b1 -text "Refresh"
+    button $b2 -text "Parent"
+    button $b3 -text "Close" -command [list destroy $top]
+
+    #
+    # Manage the widgets
+    #
+    . . .
+
+    #
+    # Populate the tablelist with the data of the given widget's children
+    #
+    putChildren $w $tbl root
+    return $tbl
+}
+
+
+ +

The procedure invokes the tablelist::tablelist command to create a + tablelist widget.  The value of the -columns option passed to this + command specifies the widths, titles, and alignments of the 9 columns.  + The width of each column is given as 0, specifying that the + column's width is to be made just large enough to hold all the elements in + the column, including its title, which is the string following the + width.  Each of the titles is followed by an alignment, which indicates + how to justify both the elements and the title of the respective column.

+ +

We want to display not only the data of the given widget's children, but + also those of its further descendants.  To this end, we need a command + to be invoked whenever an item corresponding to a widget with children gets + expanded.  This command is specified as the value of the -expandcommand option.  + As discussed later, the demo::expandCmd procedure will insert + the children of the row that is about to be expanded, if it has no children + yet.

+ +

The command demo::labelCmd, specified as the value of the + -labelcommand + option, will be invoked whenever mouse button 1 is released over one of the + labels.  We will discuss this procedure later.

+ +

We specify the value 0 for the widget's -width option, meaning that the + tablelist's width shall be made just large enough to hold all its + columns.

+ +

After creating the tablelist widget, we make sure that the elements of its + columns 2, 3, 4, and 5 (displaying the x and y coordinates as well as the + widths and heights of the children) will be compared as integers when sorting + the items based on one of these columns.  We do this with the aid of the + columnconfigure tablelist + operation.

+ +

The same columnconfigure subcommand enables us to specify + that, when displaying the elements of columns 6 and 7 (having the titles + "Mapped" and "Viewable", respectively), the boolean + values 1 and 0 will be replaced with the strings + "yes" and "no", returned by the + demo::formatBoolean command shown below.

+ +

After creating the vertical scrollbar, we iterate over the elements of the + list containing the path names of all header labels of the tablelist widget, + returned by the labels + subcommand of the Tcl command corresponding to the widget.  For each + element of the list, we bind the procedure + demo::updateItemsDelayed to the <Configure> + event.  In this way we make sure the procedure will be invoked whenever + the header label indicated by that list element changes size.

+ +

The four invocations of the bind command following the + creation of the pop-up menu make use of a binding tag whose name depends on + the path name of the tablelist widget and is returned by the bodytag subcommand of the Tcl + command associated with the tablelist widget.  The advantage of using + this tag instead of the path name of the tablelist's body is that this + binding tag is associated not only with the body but also with the separator + frames and with the labels displaying embedded images.  This is + important in our example because we want to make sure the + <<Button3>> and <Double-1> events + will be handled in the same way within a label containing an embedded image + as in the rest of the tablelist's body.  Both the <<Button3>> virtual + event (used in the first three bind commands) and the + TablelistBody + binding tag (used in the first binding script) are created by the Tablelist + package.  The first three bind commands make sure that a + <<Button3>> virtual event will select and activate + the nearest item and will post a pop-up menu with two command entries that + refer to the widget described by that item.

+ +

We populate the tablelist by invoking the demo::putChildren + procedure, implemented as follows:

+ +
+
+#------------------------------------------------------------------------------
+# demo::putChildren
+#
+# Outputs the data of the children of the widget w into the tablelist widget
+# tbl, as child items of the one identified by nodeIdx.
+#------------------------------------------------------------------------------
+proc demo::putChildren {w tbl nodeIdx} {
+    . . .
+
+    if {[string compare $nodeIdx "root"] == 0} {
+        set top [winfo toplevel $tbl]
+        wm title $top "Children of the [winfo class $w] Widget \"$w\""
+
+        $tbl resetsortinfo
+        $tbl delete 0 end
+        set row 0
+    } else {
+        set row [expr {$nodeIdx + 1}]
+    }
+
+    #
+    # Display the data of the children of the
+    # widget w in the tablelist widget tbl
+    #
+    variable leafImg
+    variable compImg
+    foreach c [winfo children $w] {
+        #
+        # Insert the data of the current child into the tablelist widget
+        #
+        set item {}
+        lappend item \
+                [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
+                [winfo width $c] [winfo height $c] [winfo ismapped $c] \
+                [winfo viewable $c] [winfo manager $c]
+        $tbl insertchild $nodeIdx end $item
+
+        #
+        # Insert an image into the first cell of the row; mark the
+        # row as collapsed if the child widget has children itself
+        #
+        if {[llength [winfo children $c]] == 0} {
+            $tbl cellconfigure end,0 -image $leafImg
+        } else {
+            $tbl cellconfigure end,0 -image $compImg
+            $tbl collapse $row
+        }
+
+        $tbl rowattrib $row pathName $c
+        incr row
+    }
+
+    if {[string compare $nodeIdx "root"] == 0} {
+        #
+        # Configure the "Refresh" and "Parent" buttons
+        #
+        $top.bf.b1 configure -command [list demo::refreshView $w $tbl]
+        set b2 $top.bf.b2
+        set p [winfo parent $w]
+        if {[string compare $p ""] == 0} {
+            $b2 configure -state disabled
+        } else {
+            $b2 configure -state normal -command \
+                [list demo::putChildren $p $tbl root]
+        }
+    }
+}
+
+
+ +

The last argument of this procedure indicates the tree node to become the + parent of the items displaying the data of the children of the widget passed + as first argument.  If this parent is the invisible root + node then we first reset the sorting information by invoking the + resetsortinfo + tablelist subcommand and delete the current items of the tablelist widget + tbl.  The procedure then iterates over the children of the + specified widget and inserts the items built from some data retrieved by + using the winfo command.  Each new item is added to the end + of the parent node's list of children with the aid of the insertchild(ren) + subcommand.

+ +

For each child widget, we invoke the cellconfigure tablelist + operation to set the value of the -image option of the + corresponding row's first cell, containing the leaf name of the child.  + In this way, the procedure inserts the image $leafImg or + $compImg into the first cell, depending on whether the child in + question is a leaf or a composite widget.  (Remember that both images + were created outside this procedure, within the initialization of the + demo namespace.)

+ +

We mark every newly created row corresponding to a child widget that has + children itself as collapsed by invoking the collapse subcommand.  This + will prepend an expand/collapse control to the content of the first column, + whose column index 0 is the default value of the -treecolumn configuration + option.

+ +

We use the rowattrib tablelist subcommand to + remember the full path name of every child widget as a private attribute + associated with the corresponding tablelist row, because it will be needed at + several places later on.

+ +

As mentioned above, the demo::expandCmd procedure will be + invoked automatically when expanding a row that contains an expand/collapse + control:

+ +
+
+#------------------------------------------------------------------------------
+# demo::expandCmd
+#
+# Outputs the data of the children of the widget whose leaf name is displayed
+# in the first cell of the specified row of the tablelist widget tbl, as child
+# items of the one identified by row.
+#------------------------------------------------------------------------------
+proc demo::expandCmd {tbl row} {
+    if {[$tbl childcount $row] == 0} {
+        set w [$tbl rowattrib $row pathName]
+        putChildren $w $tbl $row
+
+        #
+        # Apply the last sorting (if any) to the new items
+        #
+        $tbl refreshsorting $row
+    }
+}
+
+
+ +

The procedure invokes the childcount subcommand to check + whether the children of the row that is about to be expanded have already + been inserted into the tablelist widget, and inserts them if this is not the + case.  It also makes sure that the child items will be displayed in the + order corresponding to the last sorting (if any), with the aid of the + refreshsorting + tablelist subcommand.  Any sorting (if needed) will only be performed on + the child items just inserted into the tablelist widget.

+ +

The demo::formatBoolean and demo::labelCmd + procedures mentioned above are trivial:

+ +
+
+#------------------------------------------------------------------------------
+# demo::formatBoolean
+#
+# Returns "yes" or "no", according to the specified boolean value.
+#------------------------------------------------------------------------------
+proc demo::formatBoolean val {
+    return [expr {$val ? "yes" : "no"}]
+}
+
+#------------------------------------------------------------------------------
+# demo::labelCmd
+#
+# Sorts the content of the tablelist widget tbl by its col'th column and makes
+# sure the items will be updated 500 ms later (because one of the items might
+# refer to a canvas containing the arrow that displays the sorting order).
+#------------------------------------------------------------------------------
+proc demo::labelCmd {tbl col} {
+    tablelist::sortByColumn $tbl $col
+    updateItemsDelayed $tbl
+}
+
+
+ +

The command tablelist::sortByColumn sorts + the items of the tablelist widget by the specified column in the right order, + by invoking the sortbycolumn subcommand of the + Tcl command associated with the tablelist widget.

+ +

The implementation of the demo::updateItemsDelayed command, + invoked in this procedure and already encountered in the + demo::displayChildren procedure above, is quite simple:

+ +
+
+#------------------------------------------------------------------------------
+# demo::updateItemsDelayed
+#
+# Arranges for the items of the tablelist widget tbl to be updated 500 ms later.
+#------------------------------------------------------------------------------
+proc demo::updateItemsDelayed tbl {
+    #
+    # Schedule the demo::updateItems command for execution
+    # 500 ms later, but only if it is not yet pending
+    #
+    if {[string compare [$tbl attrib afterId] ""] == 0} {
+        $tbl attrib afterId [after 500 [list demo::updateItems $tbl]]
+    }
+}
+
+#------------------------------------------------------------------------------
+# demo::updateItems
+#
+# Updates the items of the tablelist widget tbl.
+#------------------------------------------------------------------------------
+proc demo::updateItems tbl {
+    #
+    # Reset the tablelist's "afterId" attribute
+    #
+    $tbl attrib afterId ""
+
+    #
+    # Update the items
+    #
+    set rowCount [$tbl size]
+    for {set row 0} {$row < $rowCount} {incr row} {
+        set c [$tbl cellcget $row,0 -text]
+        if {![winfo exists $c]} {
+            continue
+        }
+
+        set item {}
+        lappend item \
+                [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
+                [winfo width $c] [winfo height $c] [winfo ismapped $c] \
+                [winfo viewable $c] [winfo manager $c]
+        $tbl rowconfigure $row -text $item
+    }
+
+    #
+    # Repeat the last sort operation (if any)
+    #
+    $tbl refreshsorting
+}
+
+
+ +

As already mentioned in the previous example, + each tablelist widget may have any number of private attributes, which can be + set and retrieved with the aid of the attrib subcommand of the Tcl command + corresponding to the widget.  The afterId attribute is set + by the demo::updateItemsDelayed procedure when sheduling the + demo::updateItems command for execution 500 ms later, but only + if its value is an empty string.  For this reason, the + demo::updateItems procedure resets this attribute.  It also + makes use of the cellcget tablelist subcommand to + get the path names contained in the first cell of each row, and updates the + data of the children with the aid of the rowconfigure subcommand.  + After updating the items, the procedure repeats the most recent sorting based + on a column (if there was one), with the aid of the refreshsorting + subcommand.

+ +

The procedures demo::putChildrenOfSelWidget, + demo::dispConfigOfSelWidget, and + demo::postPopupMenu (see demo::displayChildren) are + also straight-forward.  For example, the + demo::putChildrenOfSelWidget command shown below makes use of + the curselection + subcommand to get the index of the selected row.  More precisely, + curselection returns a list, but in our case this list will have + exactly one element, hence it can be used directly as the first component of + a cell index.

+ +
+
+#------------------------------------------------------------------------------
+# demo::putChildrenOfSelWidget
+#
+# Outputs the data of the children of the selected widget into the tablelist
+# widget tbl.
+#------------------------------------------------------------------------------
+proc demo::putChildrenOfSelWidget tbl {
+    set w [$tbl cellcget [$tbl curselection],0 -text]
+    if {![winfo exists $w]} {
+        bell
+        tk_messageBox -title "Error" -icon error -message \
+            "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
+        return ""
+    }
+
+    if {[llength [winfo children $w]] == 0} {
+        bell
+    } else {
+        putChildren $w $tbl
+    }
+}
+
+
+ +

The procedure demo::refreshView, associated with the + Refresh button, is implemented as follows:

+ +
+
+#------------------------------------------------------------------------------
+# demo::refreshView
+#
+# Redisplays the data of the children of the widget w in the tablelist widget
+# tbl and restores the expanded states of the items as well as the vertical
+# view.
+#------------------------------------------------------------------------------
+proc demo::refreshView {w tbl} {
+    #
+    # Save the vertical view and get the path names of
+    # the child widgets displayed in the expanded rows
+    #
+    set yView [$tbl yview]
+    foreach key [$tbl expandedkeys] {
+        set pathName [$tbl rowattrib $key pathName]
+        set expandedWidgets($pathName) 1
+    }
+
+    #
+    # Redisplay the data of the widget's (possibly changed) children and
+    # restore the expanded states of the children, along with the vertical view
+    #
+    putChildren $w $tbl root
+    restoreExpandedStates $tbl root expandedWidgets
+    $tbl yview moveto [lindex $yView 0]
+}
+
+
+ +

Before redisplaying the tablelist's content via + demo::putChildren, we get the full keys of the currently + expanded items with the aid of the expandedkeys tablelist + subcommand and insert the correspondig widget paths into the array + expandedWidgets.  After redisplaying the data of the + (possibly changed) children of the widget given as first argument, we pass + this array to the demo::restoreExpandedStates procedure shown + below:

+ +
+
+#------------------------------------------------------------------------------
+# restoreExpandedStates
+#
+# Expands those children of the parent identified by nodeIdx that display the
+# data of child widgets whose path names are the names of the elements of the
+# array specified by the last argument.
+#------------------------------------------------------------------------------
+proc demo::restoreExpandedStates {tbl nodeIdx expandedWidgetsName} {
+    upvar $expandedWidgetsName expandedWidgets
+
+    foreach key [$tbl childkeys $nodeIdx] {
+        set pathName [$tbl rowattrib $key pathName]
+        if {[info exists expandedWidgets($pathName)]} {
+            $tbl expand $key -partly
+            restoreExpandedStates $tbl $key expandedWidgets
+        }
+    }
+}
+
+
+ +

The procedure retrieves the list of full keys of the children of the + parent node indicated by nodeIdx, by means of the childkeys tablelist + subcommand.  It then loops over this list, and for each key for which + the corresponding row was previously expanded, it invokes the expand tablelist subcommand and then + calls itself recursively to restore the expanded states of that row's + children.

+ +

A Directory Viewer Based on a tablelist

+ +

The script dirViewer.tcl in the demos directory + displays the contents of the volumes mounted on the system (e.g., the root + / on UNIX and the local drives on Windows) in a tablelist used + as multi-column tree widget:

+ +
+ Directory Viewer +
+ +

By double-clicking an item or invoking the single entry of a pop-up menu + within the body of the tablelist, you can display the content of the folder + corresponding to the selected item.  To go one level up, click on the + Parent button.

+ +

There are a lot of similarities between this script and the one discussed + in the previous section.  In the following we + will only present a few procedures that invoke tablelist commands not + encountered in the examples above:

+ +
+
+package require Tk 8.3
+package require tablelist 6.8
+
+#
+# Add some entries to the Tk option database
+#
+set dir [file dirname [info script]]
+source [file join $dir option.tcl]
+
+#
+# Create three images
+#
+image create photo clsdFolderImg -file [file join $dir clsdFolder.gif]
+image create photo openFolderImg -file [file join $dir openFolder.gif]
+image create photo fileImg       -file [file join $dir file.gif]
+
+#------------------------------------------------------------------------------
+# displayContents
+#
+# Displays the content of the directory dir in a tablelist widget.
+#------------------------------------------------------------------------------
+proc displayContents dir {
+    #
+    # Create a scrolled tablelist widget with 3 dynamic-
+    # width columns and interactive sort capability
+    #
+    set tf .tf
+    frame $tf -class ScrollArea
+    set tbl $tf.tbl
+    set vsb $tf.vsb
+    set hsb $tf.hsb
+    tablelist::tablelist $tbl \
+        -columns {0 "Name"          left
+                  0 "Size"          right
+                  0 "Date Modified" left} \
+        -expandcommand expandCmd -collapsecommand collapseCmd \
+        -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] \
+        -movablecolumns no -setgrid no -showseparators yes -height 20 -width 80
+    if {[$tbl cget -selectborderwidth] == 0} {
+        $tbl configure -spacing 1
+    }
+    $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary
+    $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer
+    $tbl columnconfigure 2 -formatcommand formatString
+    scrollbar $vsb -orient vertical   -command [list $tbl yview]
+    scrollbar $hsb -orient horizontal -command [list $tbl xview]
+
+    . . .
+
+    #
+    # Populate the tablelist with the content of the given directory
+    #
+    $tbl sortbycolumn 0
+    putContents $dir $tbl root
+}
+
+
+ +

The procedure displayContents creates the tablelist widget + and the two scrollbars as children of a frame of class + ScrollArea.  For this class, the file + option.tcl, sourced into the main script, contains + some look & feel related settings similar to the ones encountered in our + first example:

+ +
+
+option add *ScrollArea.borderWidth                      1
+option add *ScrollArea.relief                           sunken
+option add *ScrollArea.Tablelist.borderWidth            0
+option add *ScrollArea.Tablelist.highlightThickness     0
+
+
+ +

The procedure specifies a value not only for the -expandcommand option of the + tablelist it creates, but also for its -collapsecommand + option.  The latter will merely restore the image shown in the first + column to the one displaying a closed folder (see below).

+ +
+
+#------------------------------------------------------------------------------
+# putContents
+#
+# Outputs the content of the directory dir into the tablelist widget tbl, as
+# child items of the one identified by nodeIdx.
+#------------------------------------------------------------------------------
+proc putContents {dir tbl nodeIdx} {
+    . . .
+
+    if {[string compare $nodeIdx "root"] == 0} {
+        if {[string compare $dir ""] == 0} {
+            if {[llength [file volumes]] == 1} {
+                wm title . "Contents of the File System"
+            } else {
+                wm title . "Contents of the File Systems"
+            }
+        } else {
+            wm title . "Contents of the Directory \"[file nativename $dir]\""
+        }
+
+        $tbl delete 0 end
+        set row 0
+    } else {
+        set row [expr {$nodeIdx + 1}]
+    }
+
+    #
+    # Build a list from the data of the subdirectories and
+    # files of the directory dir.  Prepend a "D" or "F" to
+    # each entry's name and modification date & time, for
+    # sorting purposes (it will be removed by formatString).
+    #
+    set itemList {}
+    if {[string compare $dir ""] == 0} {
+        foreach volume [file volumes] {
+            lappend itemList [list D[file nativename $volume] -1 D $volume]
+        }
+    } else {
+        foreach entry [glob -nocomplain -types {d f} -directory $dir *] {
+            if {[catch {file mtime $entry} modTime] != 0} {
+                continue
+            }
+
+            if {[file isdirectory $entry]} {
+                lappend itemList [list D[file tail $entry] -1 \
+                    D[clock format $modTime -format "%Y-%m-%d %H:%M"] $entry]
+            } else {
+                lappend itemList [list F[file tail $entry] [file size $entry] \
+                    F[clock format $modTime -format "%Y-%m-%d %H:%M"] ""]
+            }
+        }
+    }
+
+    #
+    # Sort the above list and insert it into the tablelist widget
+    # tbl as list of children of the row identified by nodeIdx
+    #
+    set itemList [$tbl applysorting $itemList]
+    $tbl insertchildlist $nodeIdx end $itemList
+
+    #
+    # Insert an image into the first cell of each newly inserted row
+    #
+    foreach item $itemList {
+        set name [lindex $item end]
+        if {[string compare $name ""] == 0} {                   ;# file
+            $tbl cellconfigure $row,0 -image fileImg
+        } else {                                                ;# directory
+            $tbl cellconfigure $row,0 -image clsdFolderImg
+            $tbl rowattrib $row pathName $name
+
+            #
+            # Mark the row as collapsed if the directory is non-empty
+            #
+            if {[file readable $name] && [llength \
+                [glob -nocomplain -types {d f} -directory $name *]] != 0} {
+                $tbl collapse $row
+            }
+        }
+
+        incr row
+    }
+
+    . . .
+}
+
+
+ +

The main difference between the procedure putContents above + and the procedure demo::putChildren + described in the previous section is related to the + way child items are inserted into the tablelist widget.  Instead of + inserting them individually with the aid of the insertchild(ren) tablelist + subcommand, here we add the relevant data to a list of items and then invoke + the much more performant insertchildlist + subcommand.  Also, instead of first inserting the items and then sorting + them via refreshsorting, we first + perform the necessary sortings on the above-mentioned list of items by + invoking the applysorting subcommand.  + Again, this is much faster than sorting the already inserted child items.

+ +

This procedure also illustrates an effective technique based on the + -formatcommand column + configuration option:  In the tablelist widget's internal list, the + names and modification times of the directories and files are preceded by a + D and F, respectively.  This makes sure that + the directories will sort before the files (when sorting in ascending + order).  When displaying the items, the Tablelist code will + automatically invoke the formatString procedure, which removes + the first character.  Similarly, in the widget's internal list, the size + of a directory is set to -1, which sorts before the sizes of the + files.  The formatSize procedure, invoked automatically + when displaying the items, replaces this value with an empty string:

+ +
+
+#------------------------------------------------------------------------------
+# formatString
+#
+# Returns the substring obtained from the specified value by removing its first
+# character.
+#------------------------------------------------------------------------------
+proc formatString val {
+    return [string range $val 1 end]
+}
+
+#------------------------------------------------------------------------------
+# formatSize
+#
+# Returns an empty string if the specified value is negative and the value
+# itself in user-friendly format otherwise.
+#------------------------------------------------------------------------------
+proc formatSize val {
+    if {$val < 0} {
+        return ""
+    } elseif {$val < 1024} {
+        return "$val bytes"
+    } elseif {$val < 1048576} {
+        return [format "%.1f KB" [expr {$val / 1024.0}]]
+    } elseif {$val < 1073741824} {
+        return [format "%.1f MB" [expr {$val / 1048576.0}]]
+    } else {
+        return [format "%.1f GB" [expr {$val / 1073741824.0}]]
+    }
+}
+
+
+ +

Besides its common task of inserting the children of the row to be + expanded, the expandCmd procedure shown below also changes the + image contained in the first column to the one displaying an open + folder.  The collapseCmd procedure restores the image to + the one displaying a closed folder:

+ +
+
+#------------------------------------------------------------------------------
+# expandCmd
+#
+# Outputs the content of the directory whose leaf name is displayed in the
+# first cell of the specified row of the tablelist widget tbl, as child items
+# of the one identified by row, and updates the image displayed in that cell.
+#------------------------------------------------------------------------------
+proc expandCmd {tbl row} {
+    if {[$tbl childcount $row] == 0} {
+        set dir [$tbl rowattrib $row pathName]
+        putContents $dir $tbl $row
+    }
+
+    if {[$tbl childcount $row] != 0} {
+        $tbl cellconfigure $row,0 -image openFolderImg
+    }
+}
+
+#------------------------------------------------------------------------------
+# collapseCmd
+#
+# Updates the image displayed in the first cell of the specified row of the
+# tablelist widget tbl.
+#------------------------------------------------------------------------------
+proc collapseCmd {tbl row} {
+    $tbl cellconfigure $row,0 -image clsdFolderImg
+}
+
+. . .
+
+displayContents ""
+
+
+ +

The last line of the script invokes the procedure + displayContents with an empty string as argument, i.e., displays + the volumes mounted on the system.

+ +

Improving the Look & Feel of a tablelist Widget

+ +

The script styles.tcl in the demos directory + demonstrates some ways of making tablelist widgets smarter and improving the + readability of their items.  It creates 8 tablelist widgets, shown in + the following figure:

+ +
+ Styles +
+ +

Here is the relevant code segment:

+ +
+
+#
+# Create, configure, and populate 8 tablelist widgets
+#
+frame .f
+for {set n 0} { $n < 8} {incr n} {
+    set tbl .f.tbl$n
+    tablelist::tablelist $tbl \
+        -columntitles {"Label 0" "Label 1" "Label 2" "Label 3"} \
+        -background white -height 4 -width 40 -stretch all
+    if {[$tbl cget -selectborderwidth] == 0} {
+        $tbl configure -spacing 1
+    }
+
+    switch $n {
+        1 {
+            $tbl configure -showseparators yes
+        }
+        2 {
+            $tbl configure -stripebackground #f0f0f0
+        }
+        3 {
+            $tbl configure -stripebackground #f0f0f0 -showseparators yes
+        }
+        4 {
+            $tbl columnconfigure 1 -background LightYellow
+            $tbl columnconfigure 3 -background LightCyan
+        }
+        5 {
+            $tbl configure -showseparators yes
+            $tbl columnconfigure 1 -background LightYellow
+            $tbl columnconfigure 3 -background LightCyan
+        }
+        6 {
+            $tbl configure -stripebackground #f0f0f0
+            $tbl columnconfigure 1 -background LightYellow \
+                -stripebackground #f0f0d2
+            $tbl columnconfigure 3 -background LightCyan \
+                -stripebackground #d2f0f0
+        }
+        7 {
+            $tbl configure -stripebackground #f0f0f0 -showseparators yes
+            $tbl columnconfigure 1 -background LightYellow \
+                -stripebackground #f0f0d2
+            $tbl columnconfigure 3 -background LightCyan \
+                -stripebackground #d2f0f0
+        }
+    }
+
+    foreach row {0 1 2 3} {
+        $tbl insert end \
+             [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"]
+    }
+}
+
+
+ +

The only configuration option used here but not discussed in the first + three examples (although already encountered in the previous one) is -showseparators.  The + visual effect it produces looks nice both by itself and combined with + horizontal or vertical stripes, created by using the -stripebackground option + and the columnconfigure subcommand, + respectively.

+ +

Advanced Interactive tablelist Cell Editing

+ +

The scripts tileWidgets.tcl, bwidget.tcl, + iwidgets.tcl, and miscWidgets.tcl in the + demos directory create a tablelist widget displaying some + parameters of 16 serial lines, and demonstrate how to use various widgets + from the Tk core and from the packages tile, BWidget, Iwidgets, combobox (by + Bryan Oakley), ctext, and Mentry (or Mentry_tile) for interactive cell + editing.  The following figure shows the tablelist widget, together with + a BWidget ComboBox used to edit the content of one of its cells:

+ +
+ Serial Line Configuration +
+ +

Here is the relevant code segment from the script bwidget.tcl + (the scripts tileWidgets.tcl, iwidgets.tcl, and + miscWidgets.tcl are similar).  A few parts of the code are + shown in red color – we will return to this + towards the end of the section.

+ +
+
+package require Tk 8.4                          ;# because of "-compound"
+package require tablelist 6.8
+package require BWidget
+
+wm title . "Serial Line Configuration"
+
+#
+# Add some entries to the Tk option database
+#
+set dir [file dirname [info script]]
+source [file join $dir option.tcl]
+option add *Tablelist*Entry.background white
+
+#
+# Register some widgets from the BWidget package for interactive cell editing
+#
+tablelist::addBWidgetEntry
+tablelist::addBWidgetSpinBox
+tablelist::addBWidgetComboBox
+
+#
+# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
+# names like "img#FF0000", displaying colors identified by names like "red"
+#
+source [file join $dir images.tcl]
+
+#
+# Create a tablelist widget with editable columns (except the first one)
+#
+set tbl .tbl
+tablelist::tablelist $tbl \
+    -columns {0 "No."             right
+              0 "Available"       center
+              0 "Name"            left
+              0 "Baud Rate"       right
+              0 "Data Bits"       center
+              0 "Parity"          left
+              0 "Stop Bits"       center
+              0 "Handshake"       left
+              0 "Activation Date" center
+              0 "Activation Time" center
+              0 "Cable Color"     center} \
+    -editstartcommand editStartCmd -editendcommand editEndCmd \
+    -height 0 -width 0
+if {[$tbl cget -selectborderwidth] == 0} {
+    $tbl configure -spacing 1
+}
+$tbl columnconfigure 0 -sortmode integer
+$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
+    -formatcommand emptyStr
+$tbl columnconfigure 2 -name lineName  -editable yes -editwindow Entry \
+    -sortmode dictionary
+$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow ComboBox \
+    -sortmode integer
+$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow SpinBox
+$tbl columnconfigure 5 -name parity    -editable yes -editwindow ComboBox
+$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow ComboBox
+$tbl columnconfigure 7 -name handshake -editable yes -editwindow ComboBox
+$tbl columnconfigure 8 -name actDate   -editable yes -editwindow Entry \
+    -formatcommand formatDate -sortmode integer
+$tbl columnconfigure 9 -name actTime   -editable yes -editwindow Entry \
+    -formatcommand formatTime -sortmode integer
+$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
+    -formatcommand emptyStr
+
+proc emptyStr   val { return "" }
+proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
+proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
+
+#
+# Populate the tablelist widget; set the activation
+# date & time to 10 minutes past the current clock value
+#
+set clock [expr {[clock seconds] + 600}]
+for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
+    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
+        $clock $clock [lindex $colorNames $i]]
+
+    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
+    $tbl cellconfigure end,available -image $availImg
+    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
+}
+
+set btn [button .btn -text "Close" -command exit]
+
+#
+# Manage the widgets
+#
+pack $btn -side bottom -pady 10
+pack $tbl -side top -expand yes -fill both
+
+
+ +

We invoke the tablelist::addBWidgetEntry, + tablelist::addBWidgetSpinBox, and + tablelist::addBWidgetComboBox + commands to register the Entry, SpinBox, and ComboBox widgets from the + BWidget package for interactive cell editing.  These commands return the + values "Entry", "SpinBox", and + "ComboBox", respectively, which we then use in the + -editwindow + column configuration option to set the edit window for the columns no. 2, + ..., 10.  In columns no. 1 and 10 we use the Tk core checkbutton and + menubutton widgets, which are automatically registered for interactive cell + editing.

+ +

Notice the use of the -name column configuration option, + which allows us to access the columns by their names instead of by numerical + column indices.  This is important, because the file + option.tcl, which is sourced into the main script, + contains the line

+ +
+
+option add *Tablelist.movableColumns    yes
+
+
+ +

The editStartCmd and editEndCmd procedures shown + below use the columncget subcommand to + retrieve the name of the column from the numerical column index.

+ +

By the way, two further option database settings contained in the file + option.tcl are:

+ +
+
+option add *Tablelist.labelCommand      tablelist::sortByColumn
+option add *Tablelist.labelCommand2     tablelist::addToSortColumns
+
+
+ +

The tablelist::sortByColumn and + tablelist::addToSortColumns + commands specified in these settings enable the user to sort the items by one + or more columns, with the aid of the left mouse button and of the + Shift key.

+ +

The editStartCmd procedure, specified as the value of the + -editstartcommand + configuration option, needs the path name of the edit window, in order to be + able to configure the widget in various ways.  This is a common + situation, and Tablelist provides the editwinpath subcommand for this + purpose:

+ +
+
+#------------------------------------------------------------------------------
+# editStartCmd
+#
+# Applies some configuration options to the edit window; if the latter is a
+# ComboBox, the procedure populates it.
+#------------------------------------------------------------------------------
+proc editStartCmd {tbl row col text} {
+    set w [$tbl editwinpath]
+
+    switch [$tbl columncget $col -name] {
+        lineName {
+            #
+            # Set an upper limit of 20 for the number of characters
+            #
+            $w configure -invalidcommand bell -validate key \
+                         -validatecommand {expr {[string length %P] <= 20}}
+        }
+
+        baudRate {
+            #
+            # Populate the ComboBox and allow no more
+            # than 6 digits in its Entry component
+            #
+            $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400
+                                  57600 115200 230400 460800 921600}
+            $w configure -invalidcommand bell -validate key -validatecommand \
+                {expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}}
+        }
+
+        dataBits {
+            #
+            # Configure the SpinBox
+            #
+            $w configure -range {5 8 1} -editable no
+        }
+
+        parity {
+            #
+            # Populate the ComboBox and make it non-editable
+            #
+            $w configure -values {None Even Odd Mark Space} -editable no
+        }
+
+        . . .
+
+        color {
+            #
+            # Populate the menu and make sure the menubutton will display the
+            # color name rather than $text, which is "", due to -formatcommand
+            #
+            set menu [$w cget -menu]
+            foreach name $::colorNames {
+                $menu add radiobutton -compound left \
+                    -image img$::colors($name) -label $name
+            }
+            $menu entryconfigure 8 -columnbreak 1
+            return [$tbl cellcget $row,$col -text]
+        }
+    }
+
+    return $text
+}
+
+
+ +

The editEndCmd procedure, specified as the value of the + -editendcommand + configuration option, is responsible for a final validation of the edit + window's text.  Another purpose of this command is to convert the text + contained in the edit window to the cell's new internal content, which + is necessary because the internal value of the activation date and time is a + clock value in seconds:

+ +
+
+#------------------------------------------------------------------------------
+# editEndCmd
+#
+# Performs a final validation of the text contained in the edit window and gets
+# the cell's internal content.
+#------------------------------------------------------------------------------
+proc editEndCmd {tbl row col text} {
+    switch [$tbl columncget $col -name] {
+        available {
+            #
+            # Update the image contained in the cell
+            #
+            set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
+            $tbl cellconfigure $row,$col -image $img
+        }
+
+        baudRate {
+            #
+            # Check whether the baud rate is an integer in the range 50..921600
+            #
+            if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
+                bell
+                tk_messageBox -title "Error" -icon error -message \
+                    "The baud rate must be an integer in the range 50..921600"
+                $tbl rejectinput
+            }
+        }
+
+        actDate {
+            #
+            # Get the activation date in seconds from the last argument
+            #
+            if {[catch {clock scan $text} actDate] != 0} {
+                bell
+                tk_messageBox -title "Error" -icon error -message "Invalid date"
+                $tbl rejectinput
+                return ""
+            }
+
+            #
+            # Check whether the activation clock value is later than the
+            # current one; if this is the case then make sure the cells
+            # "actDate" and "actTime" will have the same internal value
+            #
+            set actTime [$tbl cellcget $row,actTime -text]
+            set actClock [clock scan [formatTime $actTime] -base $actDate]
+            if {$actClock <= [clock seconds]} {
+                bell
+                tk_messageBox -title "Error" -icon error -message \
+                    "The activation date & time must be in the future"
+                $tbl rejectinput
+            } else {
+                $tbl cellconfigure $row,actTime -text $actClock
+                return $actClock
+            }
+        }
+
+        . . .
+
+        color {
+            #
+            # Update the image contained in the cell
+            #
+            $tbl cellconfigure $row,$col -image img$::colors($text)
+        }
+    }
+
+    return $text
+}
+
+
+ +

Instead of making the "Available" column editable via a + temporary checkbutton and displaying the images + "checkedImg" and "uncheckedImg" in its cells, we + can use the embedcheckbuttons + subcommand to populate the column with persistently embedded + checkbuttons.  The necessary changes are as follows:

+ +
    +
  • Remove those parts of the code above that are shown in + red color.
  • + +
  • + Invoke + +
    +
    +$tbl embedcheckbuttons 1
    +
    +
    + + after populating the tablelist widget. +
  • +
+ +

As mentioned above, the scripts tileWidgets.tcl, + iwidgets.tcl, and miscWidgets.tcl are similar to + bwidget.tcl.  The first one makes use of the tile entry, + spinbox, combobox, checkbutton, and menubutton widgets.  The second one + uses (besides the Tk core checkbutton and menubutton) the entryfield, + spinint, combobox, dateentry, and timeentry widgets from the Iwidgets package + and the validation facilities specific to that library.  The third + script makes use of the entry, spinbox, checkbutton, and menubutton widgets + from the Tk core, Bryan Oakley's combobox, and of the mentry widgets of type + "Date" and "Time", and it performs the entry + validation with the aid of the Wcb package (which is required anyway for the + Mentry library).

+ +

A tablelist Widget Containing Embedded Windows

+ +

The script embeddedWindows.tcl in the demos + directory creates a tablelist widget whose items correspond to the Tk library + scripts.  The size of each file (in bytes) is not only displayed as a + number, but is also illustrated with the aid of a frame with red background, + created as a child of an embedded frame with ivory background.  The + files can be viewed by clicking on the corresponding embedded button + widgets.

+ +

The following screenshot shows the tablelist widget with the mouse cursor + over the first header label, causing this label to appear in + active state:

+ +
+ Embedded Windows +
+ +

First, we create and populate the tablelist widget:

+ +
+
+package require tablelist 6.8
+
+wm title . "Tk Library Scripts"
+
+#
+# Add some entries to the Tk option database
+#
+set dir [file dirname [info script]]
+source [file join $dir option.tcl]
+
+#
+# Create the font TkFixedFont if not yet present
+#
+catch {font create TkFixedFont -family Courier -size -12}
+
+#
+# Create an image to be displayed in buttons embedded in a tablelist widget
+#
+image create photo openImg -file [file join $dir open.gif]
+
+#
+# Create a vertically scrolled tablelist widget with 5
+# dynamic-width columns and interactive sort capability
+#
+set tf .tf
+frame $tf -class ScrollArea
+set tbl $tf.tbl
+set vsb $tf.vsb
+tablelist::tablelist $tbl \
+    -columns {0 "File Name" left
+              0 "Bar Chart" center
+              0 "File Size" right
+              0 "View"      center
+              0 "Seen"      center} \
+    -setgrid no -yscrollcommand [list $vsb set] -width 0
+if {[$tbl cget -selectborderwidth] == 0} {
+    $tbl configure -spacing 1
+}
+$tbl columnconfigure 0 -name fileName
+$tbl columnconfigure 1 -formatcommand emptyStr -sortmode integer
+$tbl columnconfigure 2 -name fileSize -sortmode integer
+$tbl columnconfigure 4 -name seen
+scrollbar $vsb -orient vertical -command [list $tbl yview]
+
+proc emptyStr val { return "" }
+
+#
+# Create a bold font
+#
+set tblFont [$tbl cget -font]
+set size [font actual $tblFont -size]
+if {$size == 0} {                                       ;# e.g., on Ubuntu
+    set size -12
+}
+eval font create BoldFont [font actual $tblFont] -size $size -weight bold
+
+#
+# Populate the tablelist widget
+#
+cd $tk_library
+set totalSize 0
+set maxSize 0
+foreach fileName [lsort [glob *.tcl]] {
+    set fileSize [file size $fileName]
+    $tbl insert end [list $fileName $fileSize $fileSize "" no]
+
+    incr totalSize $fileSize
+    if {$fileSize > $maxSize} {
+        set maxSize $fileSize
+    }
+}
+if {$tk_version >= 8.5} {
+    $tbl header insert 0 [list "[$tbl size] *.tcl files" "" $totalSize "" ""]
+    $tbl header rowconfigure 0 -foreground blue
+}
+
+
+ +

We insert the size of each file not only into the column with the + title  "File Size",  but also into the column  + "Bar Chart".  Since we configured this column with  + -formatcommand emptyStr,  the text will remain hidden in + it.  It will, however, be needed when sorting the items by that + column.

+ +

After populating the tablelist's body, we create a header item displaying + the total number and size of the library files, by invoking the  + header + insert  subcommand, and change its foreground color with the + aid of the  header + rowconfigure  subcommand.

+ +

To be able to create the embedded windows, we have first to implement the + creation scripts for them, as specified in the description of the + -window cell + configuration option.  Here is the script that creates a frame to be + embedded into the column displaying the bar chart:

+ +
+
+#------------------------------------------------------------------------------
+# createFrame
+#
+# Creates a frame widget w to be embedded into the specified cell of the
+# tablelist widget tbl, as well as a child frame representing the size of the
+# file whose name is diplayed in the first column of the cell's row.
+#------------------------------------------------------------------------------
+proc createFrame {tbl row col w} {
+    #
+    # Create the frame and replace the binding tag "Frame"
+    # with "TablelistBody" in the list of its binding tags
+    #
+    frame $w -width 102 -height 14 -background ivory -borderwidth 1 \
+             -relief solid
+    bindtags $w [lreplace [bindtags $w] 1 1 TablelistBody]
+
+    #
+    # Create the child frame and replace the binding tag "Frame"
+    # with "TablelistBody" in the list of its binding tags
+    #
+    frame $w.f -height 12 -background red -borderwidth 1 -relief raised
+    bindtags $w.f [lreplace [bindtags $w] 1 1 TablelistBody]
+
+    #
+    # Manage the child frame
+    #
+    set fileSize [$tbl cellcget $row,fileSize -text]
+    place $w.f -relwidth [expr {double($fileSize) / $::maxSize}]
+}
+
+
+ +

Since the frame will be embedded into the tablelist's body, we want to + have the same handling of the mouse events in the frame and in its child + frame as in the rest of the tablelist's body.  To this end we replace + the binding tag Frame (which has no own bindings anyway) with + TablelistBody, + thus making sure that the default binding scripts associated with that tag + will be valid for the parent frame and its child, too.

+ +

We place the red child frame within its parent using the + -relwidth option, to make sure that its width will remain + proportional to the size of the corresponding file when resizing the parent + frame (which will happen when resizing its column, as seen below).

+ +

The creation script for the buttons used for viewing the Tk library files + is quite simple:

+ +
+
+#------------------------------------------------------------------------------
+# createButton
+#
+# Creates a button widget w to be embedded into the specified cell of the
+# tablelist widget tbl.
+#------------------------------------------------------------------------------
+proc createButton {tbl row col w} {
+    set key [$tbl getkeys $row]
+    button $w -image openImg -highlightthickness 0 -takefocus 0 \
+              -command [list viewFile $tbl $key]
+}
+
+#------------------------------------------------------------------------------
+# viewFile
+#
+# Displays the content of the file whose name is contained in the row with the
+# given key of the tablelist widget tbl.
+#------------------------------------------------------------------------------
+proc viewFile {tbl key} {
+    set top .top$key
+    if {[winfo exists $top]} {
+        raise $top
+        focus $top
+        return ""
+    }
+
+    toplevel $top
+    set fileName [$tbl cellcget k$key,fileName -text]
+    wm title $top "File \"$fileName\""
+
+    #
+    # Create a vertically scrolled text widget as a grandchild of the toplevel
+    #
+    set tf $top.tf
+    frame $tf -class ScrollArea
+    set txt $tf.txt
+    set vsb $tf.vsb
+    text $txt -background white -font TkFixedFont -setgrid yes \
+              -yscrollcommand [list $vsb set]
+    catch {$txt configure -tabstyle wordprocessor}      ;# for Tk 8.5 and above
+    scrollbar $vsb -orient vertical -command [list $txt yview]
+
+    #
+    # Insert the file's content into the text widget
+    #
+    set chan [open $fileName]
+    $txt insert end [read -nonewline $chan]
+    close $chan
+
+    . . .
+
+    #
+    # Mark the file as seen
+    #
+    $tbl rowconfigure k$key -font BoldFont
+    $tbl cellconfigure k$key,seen -text yes
+}
+
+
+ +

Each file will be displayed in a text widget contained in a toplevel whose + name is .top$key, where $key is obtained with the + aid of the getkeys + subcommand.  By using the key instead of the row number, we will have a + unique name for the toplevel, even if the order of the items changes due to + interactive sorting by a column.  (Remember that the embedded windows + will be destroyed and automatically recreated when sorting the items or + moving the columns.)

+ +

Having implemented the creation scripts for the frames and buttons, we can + now use the cellconfigure subcommand to + effectively create these widgets as embedded windows.  Notice the + -stretchwindow option + used for the embedded frames, to make sure that their width will be adapted + to that of the containing column when the latter is being resized + interactively.

+ +
+
+#
+# Create embedded windows in the columns no. 1 and 3
+#
+set rowCount [$tbl size]
+for {set row 0} {$row < $rowCount} {incr row} {
+    $tbl cellconfigure $row,1 -window createFrame -stretchwindow yes
+    $tbl cellconfigure $row,3 -window createButton
+}
+
+
+ +

Tile-Based Demo Scripts

+ +

The Tablelist distribution contains also tile-based counterparts of the + demo scripts discussed above.  As described in the More on Tablelist_tile section of this tutorial, it is quite + easy to port an application using the Tablelist package to one based on + Tablelist_tile.  For example, let's see how to transform the demo script + bwidget.tcl into a tile-based one, + called bwidget_tile.tcl.  The changes are shown below in + red color:

+ +

First, we replace the starting lines

+ +
+
+package require Tk 8.3                          ;# because of entry validation
+package require tablelist 6.8
+
+
+ +

with

+ +
+
+package require tablelist_tile 6.8
+
+
+ +

and the command

+ +
+
+source [file join $dir option.tcl]
+
+
+ +

with

+ +
+
+source [file join $dir option_tile.tcl]
+
+
+ +

To ensure that the overall appearance of the GUI will conform to the + currently used theme, we create a theme-specific container for our + widgets:

+ +
+
+#
+# Improve the window's appearance by using a tile
+# frame as a container for the other widgets
+#
+set f [ttk::frame .f]
+
+
+ +

This implies that we have to replace the statement

+ +
+
+set tbl .tbl
+
+
+ +

defining the path name of our tablelist widget with

+ +
+
+set tbl $f.tbl
+
+
+ +

Similarly, instead of a Tk button created by the command

+ +
+
+set btn [button .btn -text "Close" -command exit]
+
+
+ +

we use a tile button that is a child of the above tile frame:

+ +
+
+set btn [ttk::button $f.btn -text "Close" -command exit]
+
+
+ +

We manage this frame in the usual manner:

+ +
+
+pack $f -expand yes -fill both
+
+
+ +

The script option_tile.tcl is nearly identical to + option.tcl.  Its tile-specific part uses the values written + by the command tablelist::setThemeDefaults + into the array tablelist::themeDefaults, to make sure that the + selection will have the same theme-specific look in all the widgets created + by the application:

+ +
+
+tablelist::setThemeDefaults
+if {[tablelist::getCurrentTheme] eq "aqua"} {
+    option add *Listbox.selectBackground \
+               $tablelist::themeDefaults(-selectbackground)
+    option add *Listbox.selectForeground \
+               $tablelist::themeDefaults(-selectforeground)
+} else {
+    option add *selectBackground  $tablelist::themeDefaults(-selectbackground)
+    option add *selectForeground  $tablelist::themeDefaults(-selectforeground)
+}
+option add *selectBorderWidth     $tablelist::themeDefaults(-selectborderwidth)
+
+
+ +

The demo script tileWidgets.tcl uses not only the + Tablelist_tile package for creating a tablelist widget with a modern + theme-specific look & feel, but also the tile entry, spinbox, combobox, + checkbutton, and menubutoon widgets for interactive cell editing.  The + resulting window has a nice theme-specific appearance:

+ +
+ Serial Line Configuration +
+ +

The tile-based version of the demo script embeddedWindows.tcl contains a bit more changes, but + most of them are not Tablelist-specific.  Please take a look at the file + embeddedWindows_tile.tcl in the demos directory for + the details.  Here is a screenshot of the resulting window:

+ +
+ Embedded Windows +
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistBWidget.html Index: embedded/www/tklib/files/modules/tablelist/tablelistBWidget.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistBWidget.html @@ -0,0 +1,232 @@ + + + + Interactive Tablelist Cell Editing Using the BWidget Package + + + + + + + + +
+

Interactive Tablelist Cell Editing Using the BWidget Package

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The BWidget package is a library extension for Tcl/Tk versions 8.1.1 or + higher, written in pure Tcl/Tk code.  Its download location is

+ +
+
+ https://sourceforge.net/projects/tcllib/files +
+
+ +

Tablelist supports interactive cell editing with the aid of the Entry, + SpinBox, and ComboBox widgets from the BWidget package.  The steps + needed for using one of these widgets for editing the cells of a given column + are as follows:

+ +
    +
  1. Register the desired widget for interactive cell editing by invoking + one of the commands described in this reference page.
  2. + +
  3. Use the tablelist widget's columnconfigure + subcommand to set the given column's -editable option to true + and its -editwindow option to + the value returned by the command mentioned above.  (These options are + supported at cell level, too, with the aid of the cellconfigure + subcommand.)
  4. +
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addBWidgetEntry + Command

+ +
+
NAME
+ +
tablelist::addBWidgetEntry – Register the Entry + widget from the BWidget package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addBWidgetEntry ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the Entry widget from the BWidget package for + interactive cell editing in tablelist widgets.  The optional argument + specifies the name to be used for the Entry widget as the value of the + -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + Entry.  The command returns its + name argument.
+ +
KEYWORDS
+ +
tablelist, editing, BWidget, Entry
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addBWidgetSpinBox + Command

+ +
+
NAME
+ +
tablelist::addBWidgetSpinBox – Register the SpinBox + widget from the BWidget package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addBWidgetSpinBox ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the SpinBox widget from the BWidget package for + interactive cell editing in tablelist widgets.  The optional argument + specifies the name to be used for the SpinBox widget as the value of the + -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + SpinBox.  The command returns its + name argument.
+ +
The temporary embedded SpinBox widget associated with the + above name will be created with its + -editable option set to 1.  You can + use the script corresponding to the -editstartcommand + tablelist configuration option to make the SpinBox non-editable or define + validations for it, as well as for setting its (range of) values and its + -wrap option.
+ +
KEYWORDS
+ +
tablelist, editing, BWidget, SpinBox
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addBWidgetComboBox + Command

+ +
+
NAME
+ +
tablelist::addBWidgetComboBox – Register the + ComboBox widget from the BWidget package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addBWidgetComboBox ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the ComboBox widget from the BWidget package for + interactive cell editing in tablelist widgets.  The optional argument + specifies the name to be used for the ComboBox widget as the value of the + -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + ComboBox.  The command returns its + name argument.
+ +
The temporary embedded ComboBox widget associated with the + above name will be created with its + -editable option set to 1.  You can + use the script corresponding to the -editstartcommand + tablelist configuration option to make the ComboBox non-editable or define + validations for it, as well as for populating its listbox component (with + the aid of the ComboBox widget's -values option).
+ +
KEYWORDS
+ +
tablelist, editing, BWidget, ComboBox
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistBinding.html Index: embedded/www/tklib/files/modules/tablelist/tablelistBinding.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistBinding.html @@ -0,0 +1,278 @@ + + + + Commands Related to Binding Scripts + + + + + + + + +
+

Commands Related to Binding Scripts

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The first three commands described in this reference page are designed to + be used in binding scripts associated with the binding tags whose names are + returned by the bodytag and labeltag subcommands of the + Tcl command associated with a tablelist widget.  The first two of these + commands are also used in the default binding scripts associated with the + binding tag TablelistBody.  For details and examples + see the sections DEFAULT AND + INDIVIDUAL BINDINGS FOR THE TABLELIST BODY and DEFAULT AND INDIVIDUAL BINDINGS FOR THE + HEADER LABELS.

+ +

The last command is related to the default binding scripts for Tk core + panedwindow and ttk::panedwindow widgets.  It can be used to control the + frequency of the sash position updates, which might be necessary to eliminate + some artifacts caused by dragging a sash if one or more of the panes contains + a tablelist widget with embedded images.

+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::convEventFields + Command

+ +
+
NAME
+ +
tablelist::convEventFields – Convert event fields + relative to a descendant of a tablelist widget
+ +
SYNOPSIS
+ +
+
+tablelist::convEventFields descendantPathName x y
+
+
+ +
DESCRIPTION
+ +
This command gets the path name of a tablelist widget and the x and y + coordinates relative to the latter from the path name + descendantPathName of one of its descendants and from + the x and y coordinates x, y + relative to this descendant.  The command returns these values as the + components of a list consisting of three elements.
+ +
+ In a binding script, the descendant widget corresponds to the event field + %W, which can be the tablelist's body, one of the + separator frames, a label widget displaying an embedded image, or (a + descendant of) an embedded window.  It can also be a header label or + an additional widget placed by Tablelist into a header label for + displaying a header image or a sort arrow.  Likewise, the arguments + x and y correspond to the event + fields %x and %y.  The three + elements of the list returned by the command are usually assigned to the + help variables tablelist::W, + tablelist::x, and tablelist::y, + by using the statement + +
+
+foreach {tablelist::W tablelist::x tablelist::y} \
+    [tablelist::convEventFields %W %x %y] {}
+
+
+
+ +
KEYWORDS
+ +
tablelist, event fields, binding script
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::getTablelistPath + Command

+ +
+
NAME
+ +
tablelist::getTablelistPath – Get the path name of a + tablelist widget from the path name of one of its descendants
+ +
SYNOPSIS
+ +
+
+tablelist::getTablelistPath descendantPathName
+
+
+ +
DESCRIPTION
+ +
This command gets the path name of a tablelist widget from the path + name descendantPathName of one of its descendants.
+ +
In a binding script, the descendant widget corresponds to + the event field %W, which can be the tablelist's body, + one of the separator frames, a label widget displaying an embedded image, + or (a descendant of) an embedded window.  It can also be a header + label or an additional widget placed by Tablelist into a header label for + displaying a header image or a sort arrow.  The return value is often + assigned to the help variable tablelist::W.
+ +
KEYWORDS
+ +
tablelist, path name, binding script
+
+ +
+

Contents     Start page

+
+ +
+ +

The + tablelist::getTablelistColumn Command

+ +
+
NAME
+ +
tablelist::getTablelistColumn – Get the column + number from the path name of a tablelist header label
+ +
SYNOPSIS
+ +
+
+tablelist::getTablelistColumn headerLabelPathName
+
+
+ +
DESCRIPTION
+ +
This command gets the column number from the path name + headerLabelPathName of a tablelist header label or of + an additional widget placed by Tablelist into a header label for displaying + a header image or a sort arrow.
+ +
In a binding script, the command argument corresponds to the + event field %W.  The return value is often + assigned to the help variable tablelist::col.
+ +
KEYWORDS
+ +
tablelist, path name, binding script
+
+ +
+

Contents     Start page

+
+ +
+ +

The + tablelist::delaySashPosUpdates Command

+ +
+
NAME
+ +
tablelist::delaySashPosUpdates – Set a delay for the + panedwindow sash position updates
+ +
SYNOPSIS
+ +
+
+tablelist::delaySashPosUpdates panedwindowPathName ms
+
+
+ +
DESCRIPTION
+ +
This command sets a delay for the updates of the sash position caused + by dragging a sash of the panedwindow widget specified by the first + argument, which must be the path name of a Tk core panedwindow or + ttk::panedwindow widget.  ms must be an integer + giving the delay in milliseconds.  If this number is non-negative then + the sash position updates via  sash place ...  + (for a Tk core panedwindow widget) or  sashpos + ...  (for a ttk::panedwindow widget) will be scheduled for + execution ms milliseconds later, in such a way that, + until the time for an already scheduled update expires, new drag events + won't schedule new update operations (only their data will be + remembered).  This will reduce the frequency of the sash position + updates caused by dragging a sash of the specified widget, depending on the + value of ms.  If this number is negative then any + dragging of a sash of the specified widget will immediately trigger an + update of the sash position, as implemented in the default binding scripts + for Tk core panedwindow and ttk::panedwindow widgets.
+ +
This command can be used to control the frequency of the + sash position updates for a given panedwindow widget, which might be + necessary to eliminate some artifacts caused by dragging a sash if one or + more of the panes contains a tablelist widget with embedded images.  + The value of ms (typically a number between 10 and 100) + is application- and platform-specific (on Windows and Mac OS X Aqua you + will need a higher value than on X11).
+ +
KEYWORDS
+ +
panedwindow, tablelist, path name, binding script
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistColSort.html Index: embedded/www/tklib/files/modules/tablelist/tablelistColSort.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistColSort.html @@ -0,0 +1,214 @@ + + + + Commands for Interactive Sorting by One or More Columns + + + + + + + + +
+

Commands for Interactive Sorting by One or More Columns

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The commands described in this reference page enable the user to sort the + items of a tablelist widget based on one or more of its columns, with the aid + of the left mouse button.

+ +

If the tablelist::sortByColumn command was specified + as the value of the -labelcommand + configuration option, then by pressing mouse button 1 over one of the header + labels and later releasing it over the same label, the items will be sorted + based on the elements of the corresponding column.

+ +

If the tablelist::addToSortColumns command was + specified as the value of the -labelcommand2 + configuration option, then by pressing mouse button 1 together with the + Shift key over one of the header labels and later releasing it + over the same label, the corresponding column will be appended to the list of + sort columns, or (if it was already contained in that list) the corresponding + sort order will be toggled; in both cases, the items will be sorted based on + the updated lists of sort columns and sort orders.

+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::sortByColumn + Command

+ +
+
NAME
+ +
tablelist::sortByColumn – Sort the items of a + tablelist widget based on one of its columns
+ +
SYNOPSIS
+ +
+
+tablelist::sortByColumn pathName columnIndex
+
+
+ +
DESCRIPTION
+ +
This command sorts the items of the tablelist widget pathName + based on the elements of the column specified by + columnIndex.  This is done by invoking the + sortbycolumn subcommand + of the Tcl command associated with the given tablelist widget.  If the + items were last sorted in increasing order, based on the same column given + by columnIndex, and no subsequent invocation of the + resetsortinfo + subcommand was made, then the last argument passed to + sortbycolumn will be -decreasing, + otherwise -increasing.
+ +
After sorting the items, the virtual event + <<TablelistColumnSorted>> is + generated.  For Tk versions 8.5 or higher, this virtual event is + generated with its -data option set to a list + consisting of the numerical column index and the sort order + (decreasing or increasing).  + The command returns the sort order, as decreasing or + increasing.
+ +
If the specified column's -showlinenumbers + option has been set to true, then the actions described above are not + performed and the return value is an empty string.
+ +
tablelist::sortByColumn is usually + specified as the value of the -labelcommand + configuration option for a tablelist widget.
+ +
KEYWORDS
+ +
tablelist, sort, column, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addToSortColumns + Command

+ +
+
NAME
+ +
tablelist::addToSortColumns – Add a column index to + the list of sort columns and perform the multi-column sorting
+ +
SYNOPSIS
+ +
+
+tablelist::addToSortColumns pathName columnIndex
+
+
+ +
DESCRIPTION
+ +
This command adds the column index specified by + columnIndex to the list of sort columns of the tablelist widget pathName + and sorts the items based on the elements of the columns indicated by the + modified list.  This is done by invoking the sortbycolumnlist + subcommand of the Tcl command associated with the given tablelist + widget.  The two arguments passed to + sortbycolumnlist are built as follows: (a) if the given + column index is already contained in the widget's list of sort columns + (returned by the sortcolumnlist + subcommand) then this list is left unchanged and the sort order list + (returned by the sortorderlist + subcommand) is updated by toggling its corresponding element from + increasing to decreasing and + vice-versa; (b) otherwise the column index is appended to the list of sort + columns and the value increasing is appended to the + list of sort orders.
+ +
After sorting the items by passing the two updated lists to + the sortbycolumnlist subcommand, the virtual event + <<TablelistColumnsSorted>> (note the plural + form!) is generated.  For Tk versions 8.5 or higher, this virtual + event is generated with its -data option set to a list + consisting of the two above-mentioned updated lists passed to + sortbycolumnlist as arguments.  The command + returns the new sort order corresponding to the given column, as + decreasing or increasing.
+ +
If the specified column's -showlinenumbers + option has been set to true, then the actions described above are not + performed and the return value is an empty string.
+ +
tablelist::addToSortColumns is usually + specified as the value of the -labelcommand2 + configuration option for a tablelist widget.
+ +
KEYWORDS
+ +
tablelist, sort, column list, widget
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistCombobox.html Index: embedded/www/tklib/files/modules/tablelist/tablelistCombobox.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistCombobox.html @@ -0,0 +1,141 @@ + + + + Interactive Tablelist Cell Editing Using the combobox Package + + + + + + + + +
+

Interactive Tablelist Cell Editing Using the combobox Package

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

Bryan Oakley's combobox package is a library extension for Tcl/Tk versions + 8.0 or higher, written in pure Tcl/Tk code.  Its download location + is

+ +
+
+ http://www1.clearlight.com/~oakley/tcl/combobox +
+
+ +

Tablelist supports interactive cell editing with the aid of the combobox + widget implemented in the package mentioned above.  The steps needed for + using this widget for editing the cells of a given column are as follows:

+ +
    +
  1. Register the combobox widget for interactive cell editing by invoking + the tablelist::addOakleyCombobox command described + below.
  2. + +
  3. Use the tablelist widget's columnconfigure + subcommand to set the given column's -editable option to true + and its -editwindow option to + the value returned by the command mentioned above.  (These options are + supported at cell level, too, with the aid of the cellconfigure + subcommand.)
  4. +
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addOakleyCombobox + Command

+ +
+
NAME
+ +
tablelist::addOakleyCombobox – Register Bryan + Oakley's combobox widget for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addOakleyCombobox ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers Bryan Oakley's combobox widget for interactive + cell editing in tablelist widgets.  The optional argument specifies + the name to be used for the combobox widget as the value of the + -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + combobox.  The command returns its + name argument.
+ +
The temporary embedded combobox widget associated with the + above name will be created with its + -editable option set to 1.  You can + use the script corresponding to the -editstartcommand + tablelist configuration option to make the combobox non-editable or define + validations for its entry child (whose path name can be obtained by + invoking the tablelist widget's entrypath subcommand, or by + appending .entry to the path name of the combobox + widget, or, if using combobox version 2.3 or later, with the aid of the + combobox widget's  subwidget entry  + subcommand), as well as for populating its listbox component (by using the + combobox widget's  list insert  + subcommand).
+ +
KEYWORDS
+ +
tablelist, editing, combobox
+
+ + + + ADDED embedded/www/tklib/files/modules/tablelist/tablelistCtext.html Index: embedded/www/tklib/files/modules/tablelist/tablelistCtext.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistCtext.html @@ -0,0 +1,186 @@ + + + + Interactive Tablelist Cell Editing Using the ctext Package + + + + + + + + +
+

Interactive Tablelist Cell Editing Using the ctext Package

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

George Peter Staplin's ctext package is a library extension for Tcl/Tk + versions 8.0 or higher, written in pure Tcl/Tk code.  It is part of + tklib, which has the address

+ +
+
+ https://core.tcl.tk/tklib +
+
+ +

Tablelist supports interactive cell editing with the aid of the ctext + widget implemented in the package mentioned above.  The steps needed for + using this widget for editing the cells of a given column are as follows:

+ +
    +
  1. Register the ctext widget for interactive cell editing by invoking the + tablelist::addCtext command + described below.
  2. + +
  3. Use the tablelist widget's columnconfigure + subcommand to set the given column's -editable option to true + and its -editwindow option to + the value returned by the command mentioned above.  (These options are + supported at cell level, too, with the aid of the cellconfigure + subcommand.)
  4. +
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addCtext Command

+ +
+
NAME
+ +
tablelist::addCtext – Register the ctext widget for + interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addCtext ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the ctext widget for interactive cell editing in + tablelist widgets.  The optional argument specifies the name to be + used for the ctext widget as the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + ctext.  The command returns its + name argument.
+ +
The temporary embedded ctext widget used for interactive + cell editing will be created with its -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.  There is, + however, an exception from this rule:  If the -wrap option of the cell's + column was set to true and Tk version 8.5 or higher is being used, then the + ctext widget's -wrap option will be set to + word and its initial height will equal the number of + display lines (taking into account the line wraps) contained in + it.  You can use the script corresponding to the -editstartcommand + tablelist configuration option to override the initial settings (except + the height) according to your needs.
+ +
If the ctext widget's -wrap option was + set to word or char (either by + Tablelist or from within the above-mentioned script) and Tk version 8.5 or + higher is being used, then, whenever its width changes (e.g., due to + interactive column resizing), its height will be set automatically to the + number of display lines contained in it.  (The number of display lines + is retrieved with the aid of the  count + -displaylines  text widget subcommand, introduced in Tk + 8.5.)
+ +
If the widget callback package Wcb was loaded into the + interpreter (via  package require Wcb  + or  package require wcb)  then the ctext + widget's height will be updated automatically 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 ctext + widget.  (The above-mentioned callback is created via + wcb::cbappend, after returning from that + script.)
+ +
The Tab key is reserved for navigation between + the editable cells, but the user can insert a tabulator character into the + ctext widget by pressing Control-i.
+ +
Unlike in the case of the other widgets used for interactive + cell editing (except the Tk core text widget), the Return and + KP_Enter keys insert a newline character into the ctext + 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 + (except the Tk core text widget).  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).
+ +
KEYWORDS
+ +
tablelist, editing, ctext
+
+ + + + ADDED embedded/www/tklib/files/modules/tablelist/tablelistIwidgets.html Index: embedded/www/tklib/files/modules/tablelist/tablelistIwidgets.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistIwidgets.html @@ -0,0 +1,362 @@ + + + + Interactive Tablelist Cell Editing Using the Iwidgets Package + + + + + + + + +
+

Interactive Tablelist Cell Editing Using the Iwidgets Package

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The Iwidgets package (also known as [incr Widgets]) is a library extension + for Tcl/Tk versions 8.0 or higher, written in pure Tcl/Tk code.  It + requires the compiled packages Itcl and Itk (also known as [incr Tcl] and + [incr Tk], respectively).  The download location of these three library + packages is

+ +
+
+ https://sourceforge.net/projects/incrtcl/files +
+
+ +

Tablelist supports interactive cell editing with the aid of the + entryfield, datefield, dateentry, timefield, timeentry, spinner, spinint, and + combobox widgets from the Iwidgets package.  The steps needed for using + one of these widgets for editing the cells of a given column are as + follows:

+ +
    +
  1. Register the desired widget for interactive cell editing by invoking + one of the commands described in this reference page.
  2. + +
  3. Use the tablelist widget's columnconfigure + subcommand to set the given column's -editable option to true + and its -editwindow option to + the value returned by the command mentioned above.  (These options are + supported at cell level, too, with the aid of the cellconfigure + subcommand.)
  4. +
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addIncrEntryfield + Command

+ +
+
NAME
+ +
tablelist::addIncrEntryfield – Register the + entryfield widget from the Iwidgets package for interactive cell + editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIncrEntryfield ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the entryfield widget from the Iwidgets package + for interactive cell editing in tablelist widgets.  The optional + argument specifies the name to be used for the entryfield widget as the + value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + entryfield.  The command returns its + name argument.
+ +
KEYWORDS
+ +
tablelist, editing, Iwidgets, entryfield
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addIncrDateTimeWidget + Command

+ +
+
NAME
+ +
tablelist::addIncrDateTimeWidget – Register the + datefield, dateentry, timefield, or timeentry widget from the Iwidgets + package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIncrDateTimeWidget datefield|dateentry|timefield|timeentry ?-seconds? ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the datefield, dateentry, timefield, or + timeentry widget from the Iwidgets package for interactive cell editing in + tablelist widgets.  If the -seconds argument is + present then the finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing as an integer clock value (in seconds), otherwise as a + string.  Use this option for tablelist widgets whose internal list + contains date or time information in seconds (displayed with the aid of + commands given by the -formatcommand + column configuration option).  The second optional argument specifies + the name to be used for the datefield, dateentry, timefield, or timeentry + widget as the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + datefield, dateentry, + timefield, or timeentry, as given + by the first argument.  The command returns its + name argument.
+ +
When editing a cell with the aid of the temporary embedded + datefield, dateentry, timefield, or timeentry widget associated with the + above name, you can use the script corresponding to the + -editstartcommand + tablelist configuration option to set any of the widget's options, like + -gmt, -iq, -int + ("international" date format, supported by datefield and dateentry + widgets), or -format (for timefield and timeentry + widgets, with the values civilian and + military).
+ +
KEYWORDS
+ +
tablelist, editing, Iwidgets, datefield, dateentry, timefield, + timeentry
+
+ +
+

Contents     Start page

+
+
+ +

The tablelist::addIncrSpinner + Command

+ +
+
NAME
+ +
tablelist::addIncrSpinner – Register the spinner + widget from the Iwidgets package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIncrSpinner ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the spinner widget from the Iwidgets package for + interactive cell editing in tablelist widgets.  The optional argument + specifies the name to be used for the spinner widget as the value of the + -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + spinner.  The command returns its + name argument.
+ +
When editing a cell with the aid of the temporary embedded + spinner widget associated with the above name, you can + use the script corresponding to the -editstartcommand + tablelist configuration option to define validations for the widget or set + any of its other options, like -decrement and + -increment.
+ +
KEYWORDS
+ +
tablelist, editing, Iwidgets, spinner
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addIncrSpinint + Command

+ +
+
NAME
+ +
tablelist::addIncrSpinint – Register the spinint + widget from the Iwidgets package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIncrSpinint ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the spinint widget from the Iwidgets package for + interactive cell editing in tablelist widgets.  The optional argument + specifies the name to be used for the spinint widget as the value of the + -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + spinint.  The command returns its + name argument.
+ +
When editing a cell with the aid of the temporary embedded + spinint widget associated with the above name, you can + use the script corresponding to the -editstartcommand + tablelist configuration option to define validations for the widget or set + any of its other options, like -range, + -step, and -wrap.
+ +
KEYWORDS
+ +
tablelist, editing, Iwidgets, spinint
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addIncrCombobox + Command

+ +
+
NAME
+ +
tablelist::addIncrCombobox – Register the combobox + widget from the Iwidgets package for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIncrCombobox ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the dropdown-style combobox widget from the + Iwidgets package for interactive cell editing in tablelist widgets.  + The optional argument specifies the name to be used for the combobox widget + as the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + combobox.  The command returns its + name argument.
+ +
The temporary embedded combobox widget associated with the + above name will be created with its + -editable option set to 1 and its + -grab option set to global.  + You can use the script corresponding to the -editstartcommand + tablelist configuration option to make the combobox non-editable or define + validations for it, as well as for populating its listbox component (by + using the combobox widget's  insert list  + subcommand).
+ +
KEYWORDS
+ +
tablelist, editing, Iwidgets, combobox
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistMentry.html Index: embedded/www/tklib/files/modules/tablelist/tablelistMentry.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistMentry.html @@ -0,0 +1,498 @@ + + + + Interactive Tablelist Cell Editing Using the Mentry Package + + + + + + + + +
+

Interactive Tablelist Cell Editing Using the Mentry Package

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The multi-entry package Mentry is a library extension for Tcl/Tk versions + 8.0 or higher, written in pure Tcl/Tk code.  Its download location + is

+ +
+
+ https://www.nemethi.de +
+
+ +

Starting with version 3.0, the Mentry distribution provides not only the + package Mentry, but also its tile-based equivalent Mentry_tile, which enables + the theme-specific appearance of mentry widgets; this package requires Tcl/Tk + 8.4 or higher and tile 0.6 or higher.

+ +

Tablelist supports interactive cell editing with the aid of the mentry + widgets of type "Date", "Time", + "DateTime, "FixedPoint", "IPAddr", and + "IPv6Addr".  The steps needed for using one of these + widgets for editing the cells of a given column are as follows:

+ +
    +
  1. Register the desired widget for interactive cell editing by invoking + one of the commands described in this reference page.
  2. + +
  3. Use the tablelist widget's columnconfigure + subcommand to set the given column's -editable option to true + and its -editwindow option to + the value returned by the command mentioned above.  (These options are + supported at cell level, too, with the aid of the cellconfigure + subcommand.)
  4. +
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addDateMentry Command

+ +
+
NAME
+ +
tablelist::addDateMentry – Register the mentry + widget of type "Date" for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addDateMentry format separator ?-gmt? ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the widget created by the + mentry::dateMentry command from the Mentry (or + Mentry_tile) package for interactive cell editing in tablelist + widgets.  The format and + separator arguments have the same meanings as in the + mentry::dateMentry command.  If the + -gmt argument is present then both the internal clock + value and its external date representation in the mentry widget will be + viewed as Greenwich Mean Time, otherwise as local time.  The second + optional argument specifies the name to be used for the mentry widget as + the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + dateMentry.  The command returns its + name argument.
+ +
A tablelist column having the above name + as the value of its -editwindow option must contain as + internal cell values date information in seconds (displayed with the aid of + a command given by the -formatcommand + column configuration option).  The finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing by invoking the mentry::getClockVal + command.  The value returned by this command (a clock value in seconds + or one of the error strings "EMPTY", "BAD", + "BAD_DATE", or "BAD_YEAR") will be passed to the + script corresponding to the -editendcommand + tablelist configuration option (if any), as its last argument.  If + this value is one of the above error strings then the script should reject + the mentry's content by invoking the rejectinput + subcommand.
+ +
KEYWORDS
+ +
tablelist, editing, Mentry, date
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addTimeMentry Command

+ +
+
NAME
+ +
tablelist::addTimeMentry – Register the mentry + widget of type "Time" for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addTimeMentry format separator ?-gmt? ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the widget created by the + mentry::timeMentry command from the Mentry (or + Mentry_tile) package for interactive cell editing in tablelist + widgets.  The format and + separator arguments have the same meanings as in the + mentry::timeMentry command.  If the + -gmt argument is present then both the internal clock + value and its external time representation in the mentry widget will be + viewed as Greenwich Mean Time, otherwise as local time.  The second + optional argument specifies the name to be used for the mentry widget as + the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + timeMentry.  The command returns its + name argument.
+ +
A tablelist column having the above name + as the value of its -editwindow option must contain as + internal cell values time information in seconds (displayed with the aid of + a command given by the -formatcommand + column configuration option).  The finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing by invoking the mentry::getClockVal + command.  The value returned by this command (a clock value in seconds + or one of the error strings "EMPTY" or "BAD") + will be passed to the script corresponding to the -editendcommand + tablelist configuration option (if any), as its last argument.  If + this value is one of the above error strings then the script should reject + the mentry's content by invoking the rejectinput + subcommand.
+ +
KEYWORDS
+ +
tablelist, editing, Mentry, time
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addDateTimeMentry + Command

+ +
+
NAME
+ +
tablelist::addDateTimeMentry – Register the mentry + widget of type "DateTime" for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addDateTimeMentry format dateSeparator timeSeparator ?-gmt? ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the widget created by the + mentry::dateTimeMentry command from the Mentry (or + Mentry_tile) package for interactive cell editing in tablelist + widgets.  The format, + dateSeparator, and timeSeparator + arguments have the same meanings as in the + mentry::dateTimeMentry command.  If the + -gmt argument is present then both the internal clock + value and its external date & time representation in the mentry widget will + be viewed as Greenwich Mean Time, otherwise as local time.  The second + optional argument specifies the name to be used for the mentry widget as + the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + dateTimeMentry.  The command returns its + name argument.
+ +
A tablelist column having the above name + as the value of its -editwindow option must contain as + internal cell values date & time information in seconds (displayed with the + aid of a command given by the -formatcommand + column configuration option).  The finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing by invoking the mentry::getClockVal + command.  The value returned by this command (a clock value in seconds + or one of the error strings "EMPTY", "BAD", + "BAD_DATE", or "BAD_YEAR") will be passed to the + script corresponding to the -editendcommand + tablelist configuration option (if any), as its last argument.  If + this value is one of the above error strings then the script should reject + the mentry's content by invoking the rejectinput + subcommand.
+ +
KEYWORDS
+ +
tablelist, editing, Mentry, date, time
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addFixedPointMentry + Command

+ +
+
NAME
+ +
tablelist::addFixedPointMentry – Register the mentry + widget of type "FixedPoint" for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addFixedPointMentry count1 count2 ?-comma? ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the widget created by the + mentry::fixedPointMentry command from the Mentry (or + Mentry_tile) package for interactive cell editing in tablelist + widgets.  The count1, count2, + and -comma arguments have the same meanings as in the + mentry::fixedPointMentry command.  The second + optional argument specifies the name to be used for the mentry widget as + the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + fixedPointMentry_count1.count2 + (e.g., fixedPointMentry_6.2) or + fixedPointMentry_count1,count2 + (e.g., fixedPointMentry_6,2), depending on the presence + of the optional -comma argument.  The command + returns its name argument.
+ +
A tablelist column having the above name + as the value of its -editwindow option must contain + real numbers as internal cell values.  The finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing by invoking the mentry::getReal command.  + The value returned by this command (a real number or the error string + "EMPTY") will be passed to the script corresponding to the + -editendcommand + tablelist configuration option (if any), as its last argument.  If + this value is the above error string then the script should reject the + mentry's content by invoking the rejectinput + subcommand.
+ +
KEYWORDS
+ +
tablelist, editing, Mentry, real number
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addIPAddrMentry + Command

+ +
+
NAME
+ +
tablelist::addIPAddrMentry – Register the mentry + widget of type "IPAddr" for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIPAddrMentry ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the widget created by the + mentry::ipAddrMentry command from the Mentry (or + Mentry_tile) package for interactive cell editing in tablelist + widgets.  The optional argument specifies the name to be used for the + mentry widget as the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + ipAddrMentry.  The command returns its + name argument.
+ +
A tablelist column having the above name + as the value of its -editwindow option must contain IP + addresses as internal cell values.  The finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing by invoking the mentry::getIPAddr + command.  The value returned by this command (an IP address or the + error string "EMPTY") will be passed to the script + corresponding to the -editendcommand + tablelist configuration option (if any), as its last argument.  If + this value is the above error string then the script should reject the + mentry's content by invoking the rejectinput + subcommand.
+ +
KEYWORDS
+ +
tablelist, editing, Mentry, IP address
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::addIPv6AddrMentry + Command

+ +
+
NAME
+ +
tablelist::addIPv6AddrMentry – Register the mentry + widget of type "IPv6Addr" for interactive cell editing
+ +
SYNOPSIS
+ +
+
+tablelist::addIPv6AddrMentry ?name?
+
+
+ +
DESCRIPTION
+ +
This command registers the widget created by the + mentry::ipv6AddrMentry command from the Mentry (or + Mentry_tile) package for interactive cell editing in tablelist + widgets.  The optional argument specifies the name to be used for the + mentry widget as the value of the -editwindow column or + cell configuration option.  It may be any string that is different + from the Tk core and tile edit window names.  The default is + ipv6AddrMentry.  The command returns its + name argument.
+ +
A tablelist column having the above name + as the value of its -editwindow option must contain + IPv6 addresses as internal cell values.  The finishediting + subcommand of the Tcl command associated with the tablelist widget will + retrieve the content of the embedded window used for interactive cell + editing by invoking the mentry::getIPv6Addr + command.  The value returned by this command (an IPv6 address or the + error string "EMPTY") will be passed to the script + corresponding to the -editendcommand + tablelist configuration option (if any), as its last argument.  If + this value is the above error string then the script should reject the + mentry's content by invoking the rejectinput + subcommand.
+ +
KEYWORDS
+ +
tablelist, editing, Mentry, IPv6 address
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistThemes.html Index: embedded/www/tklib/files/modules/tablelist/tablelistThemes.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistThemes.html @@ -0,0 +1,276 @@ + + + + Commands Related to Tile Themes + + + + + + + + +
+

Commands Related to Tile Themes

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

The commands described in this reference page should only be invoked when + using the package Tablelist_tile.  They enable you to set and query the + current theme, to retrieve a list of the available themes, and to make sure + that your widgets will have a theme-specific appearance.

+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::setTheme Command

+ +
+
NAME
+ +
tablelist::setTheme – Set the current theme
+ +
SYNOPSIS
+ +
+
+tablelist::setTheme theme
+
+
+ +
DESCRIPTION
+ +
This command sets the current theme to theme, + loading it if necessary.  It is simply an alias for + ttk::setTheme or tile::setTheme, + depending on the tile version loaded into the interpreter.  (The + tile::setTheme command was renamed to + ttk::setTheme in tile version 0.8.)
+ +
Being just an alias for a tile library procedure, the + tablelist::setTheme command does exactly the same as + the original one: It loads the package implementing the given theme if + needed, sets the theme to the specified one, and saves the latter in the + variable ttk::currentTheme or + tile::currentTheme, depending on the current tile + version.
+ +
KEYWORDS
+ +
tablelist, theme, tile
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::getCurrentTheme + Command

+ +
+
NAME
+ +
tablelist::getCurrentTheme – Get the current + theme
+ +
SYNOPSIS
+ +
+
+tablelist::getCurrentTheme
+
+
+ +
DESCRIPTION
+ +
This command returns the value of the variable + ttk::currentTheme or + tile::currentTheme, depending on the tile version + loaded into the interpreter.  (The namespace containing the variable + currentTheme was changed in tile version 0.8 from + tile to ttk.)
+ +
KEYWORDS
+ +
tablelist, theme, tile
+
+ +
+

Contents     Start page

+
+ +
+ +

The tablelist::getThemes Command

+ +
+
NAME
+ +
tablelist::getThemes – Get the themes registered in + the package database
+ +
SYNOPSIS
+ +
+
+tablelist::getThemes
+
+
+ +
DESCRIPTION
+ +
This command returns a list of the themes registered in the package + database.  It is simply an alias for ttk::themes + or tile::availableThemes, depending on the tile version + loaded into the interpreter.  (The + tile::availableThemes command was renamed to + ttk::themes in tile version 0.8.)
+ +
KEYWORDS
+ +
tablelist, theme, tile
+
+ +
+

Contents     Start page

+
+ +
+ +

tablelist::setThemeDefaults + Command

+ +
+
NAME
+ +
tablelist::setThemeDefaults – Set theme-specific + default values of some tablelist configuration options
+ +
SYNOPSIS
+ +
+
+tablelist::setThemeDefaults
+
+
+ +
DESCRIPTION
+ +
This command populates the array + tablelist::themeDefaults with theme-specific default + values of a series of Tablelist configuration options.  The array + names are the command-line names of the options, and the corresponding + array values are the default values of these configuration options for the + currently set tile theme.
+ +
The options whose names and values are written into the + array tablelist::themeDefaults are: + -background, -foreground, + -disabledforeground, + -stripebackground, + -selectbackground, + -selectforeground, + -selectborderwidth, -font, + -labelforeground, -labelfont, + -labelborderwidth, -labelpady, + -arrowcolor, -arrowdisabledcolor, + -arrowstyle, and -treestyle.  + In addition, the command sets some other array elements to theme-specific + default values of the background and foreground colors of the column labels + in normal, disabled, + active, and pressed states.  + (Tablelist needs the label colors for handling sort arrows and images with + transparent background in the column labels.)
+ +
The tablelist::setThemeDefaults command + is invoked by Tablelist_tile automatically whenever a tablelist widget is + createad or the <<ThemeChanged>> virtual + event is received by a tablelist widget.  In the latter case, the + widget is reconfigured, using the new default values of those options that + were not set explicitly to values different from the corresponding + defaults.
+ +
Besides being used by the Tablelist_tile code, this command + can also be invoked in Tcl scripts, still before creating any tile-based + tablelist widget.  By calling it explicitly and using the values + written by it into the array tablelist::themeDefaults, + you can make sure that classical Tk widgets, e.g., listbox and text, will + have a theme-specific appearance, just like the tile widgets.  For + example, you can add some common configuration options to the option + database as follows:
+ +
+
+
+tablelist::setThemeDefaults
+if {$tile::currentTheme eq "aqua"} {
+    option add *Listbox.selectBackground \
+               $tablelist::themeDefaults(-selectbackground)
+    option add *Listbox.selectForeground \
+               $tablelist::themeDefaults(-selectforeground)
+} else {
+    option add *selectBackground  $tablelist::themeDefaults(-selectbackground)
+    option add *selectForeground  $tablelist::themeDefaults(-selectforeground)
+}
+option add *selectBorderWidth     $tablelist::themeDefaults(-selectborderwidth)
+
+
+
+ +
KEYWORDS
+ +
tablelist, theme, tile
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistTile.html Index: embedded/www/tklib/files/modules/tablelist/tablelistTile.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistTile.html @@ -0,0 +1,287 @@ + + + + Interactive Tablelist Cell Editing Using Tile Widgets + + + + + + + + +
+

Interactive Tablelist Cell Editing Using Tile Widgets

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

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

+ +
+
+ https://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 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.)

+ +

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, + 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::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
+
+ +
+ + + +
+
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

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistTkCore.html Index: embedded/www/tklib/files/modules/tablelist/tablelistTkCore.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistTkCore.html @@ -0,0 +1,296 @@ + + + + Interactive Tablelist Cell Editing Using Tk Core Widgets + + + + + + + + +
+

Interactive Tablelist Cell Editing Using Tk Core Widgets

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Overview

+ +

Tablelist supports interactive cell editing with the aid of the Tk core + entry, text, spinbox, checkbutton, and menubutton 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, checkbutton, or + menubutton, 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.

+ +
+

Contents     Start page

+
+ +
+ +

Interactive Cell Editing Using the entry Widget

+ +
+
DESCRIPTION
+ +
As mentioned above, the interactive cell editing in a tablelist widget + takes place per default with the aid of an embedded entry widget.  + Refer to the INTERACTIVE CELL + EDITING section of the reference page describing the + tablelist::tablelist command for details on the editing + process.
+ +
KEYWORDS
+ +
tablelist, editing, entry
+
+ +
+

Contents     Start page

+
+ +
+ +

Interactive Cell Editing Using the text Widget

+ +
+
DESCRIPTION
+ +
The temporary embedded text widget used for interactive cell editing + will be created with its -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.  There is, + however, an exception from this rule:  If the -wrap option of the cell's + column was set to true and Tk version 8.5 or higher is being used, then the + text widget's -wrap option will be set to + word and its initial height will equal the number of + display lines (taking into account the line wraps) contained in + it.  You can use the script corresponding to the -editstartcommand + tablelist configuration option to override the initial settings (except + the height) according to your needs.
+ +
If the text widget's -wrap option was + set to word or char (either by + Tablelist or from within the above-mentioned script) and Tk version 8.5 or + higher is being used, then, whenever its width changes (e.g., due to + interactive column resizing), its height will be set automatically to the + number of display lines contained in it.  (The number of display lines + is retrieved with the aid of the  count + -displaylines  text widget subcommand, introduced in Tk + 8.5.)
+ +
If the widget callback package Wcb was loaded into the + interpreter (via  package require Wcb  + or  package require wcb)  then the text + widget's height will be updated automatically 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.  (The above-mentioned callback is created via + wcb::cbappend, after returning from that + script.)
+ +
The 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.
+ +
Unlike in the case of the other widgets used for interactive + cell editing, the 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).
+ +
KEYWORDS
+ +
tablelist, editing, text
+
+ +
+

Contents     Start page

+
+ +
+ +

Interactive Cell Editing Using the spinbox Widget

+ +
+
DESCRIPTION
+ +
The temporary embedded spinbox widget used for interactive cell editing + will be created 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.
+ +
KEYWORDS
+ +
tablelist, editing, spinbox
+
+ +
+

Contents     Start page

+
+ +
+ +

Interactive Cell Editing Using the checkbutton + Widget

+ +
+
DESCRIPTION
+ +
On Windows, Mac OS Classic, and Mac OS X Aqua the temporary embedded + checkbutton widget used for interactive cell editing will be created with + explicitly set values for its -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 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.
+ +
KEYWORDS
+ +
tablelist, editing, checkbutton
+
+ +
+ + + +
+
DESCRIPTION
+ +
The temporary embedded menubutton widget used for interactive cell + editing will be created with explicitly set values for its + -anchor, -indicatoron, + -justify, -padx, + -pady, -relief, 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, menubutton
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tablelistWidget.html Index: embedded/www/tklib/files/modules/tablelist/tablelistWidget.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tablelistWidget.html @@ -0,0 +1,11889 @@ + + + + The tablelist::tablelist Command + + + + + + + + +
+

The tablelist::tablelist Command

+ +

For Tablelist Version 6.8

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ + + + + +
+ +

Quick Reference

+ +
+
NAME
+ +
tablelist::tablelist – Create and manipulate + tablelist widgets
+ +
SYNOPSIS
+ +
+
+tablelist::tablelist pathName ?options?
+
+
+ +
DESCRIPTION
+ +
STANDARD OPTIONS
+ +
+
+-borderwidth          -highlightthickness  -setgrid
+-cursor               -relief              -xscrollcommand
+-exportselection      -selectbackground    -yscrollcommand
+-highlightbackground  -selectborderwidth
+-highlightcolor       -selectforeground
+
+
+ +
OPTIONS FOR THE BODY AND HEADER COMPONENTS OF + THE WIDGET
+ +
+
+-background  -disabledforeground  -font  -foreground
+
+
+ +
WIDGET-SPECIFIC OPTIONS
+ +
-acceptchildcommand + command
+ +
-acceptdropcommand + command
+ +
-activestyle + frame|none|underline
+ +
-arrowcolor + color
+ +
-arrowdisabledcolor + color
+ +
-arrowstyle + flat5x3|flat5x4|flat6x4|flat7x4|flat7x5|flat7x7|
+             flat8x4|flat8x5|flat9x5|flat9x6|flat11x6|flat15x8|
+             flatAngle7x4|flatAngle7x5|flatAngle9x5|flatAngle9x6|
+             flatAngle9x7|flatAngle10x6|flatAngle10x7|flatAngle11x6|
+             flatAngle15x8|photo7x4|photo7x7|photo9x5|photo11x6|
+             photo15x8|sunken8x7|sunken10x9|sunken12x11
+ +
-autofinishediting + boolean
+ +
-autoscan + boolean
+ +
-collapsecommand + command
+ +
-colorizecommand + command
+ +
-columns {width title + ?left|right|center? width title + ?left|right|center? ...}
+ +
-columntitles {title + title ...}
+ +
-customdragsource + boolean
+ +
-displayondemand + boolean
+ +
-editendcommand + command
+ +
-editselectedonly + boolean
+ +
-editstartcommand + command
+ +
-expandcommand + command
+ +
-forceeditendcommand + boolean
+ +
-fullseparators + boolean
+ +
-height units
+ +
-incrarrowtype + up|down
+ +
-instanttoggle + boolean
+ +
-labelactivebackground + color
+ +
-labelactiveforeground + color
+ +
-labelbackground + color  or  -labelbg + color
+ +
-labelborderwidth + screenDistance  or  -labelbd + screenDistance
+ +
-labelcommand + command
+ +
-labelcommand2 + command
+ +
-labeldisabledforeground + color
+ +
-labelfont + font
+ +
-labelforeground + color  or  -labelfg + color
+ +
-labelheight + lines
+ +
-labelpady + screenDistance
+ +
-labelrelief + raised|sunken|flat|ridge|solid|groove
+ +
-listvariable + variable
+ +
-movablecolumns + boolean
+ +
-movablerows + boolean
+ +
-movecolumncursor + cursor
+ +
-movecursor + cursor
+ +
-populatecommand + command
+ +
-protecttitlecolumns + boolean
+ +
-resizablecolumns + boolean
+ +
-resizecursor + cursor
+ +
-selectfiltercommand + command
+ +
-selectmode + single|browse|multiple|extended
+ +
-selecttype + row|cell
+ +
-setfocus + boolean
+ +
-showarrow + boolean
+ +
-showbusycursor + boolean
+ +
-showeditcursor + boolean
+ +
-showhorizseparator + boolean
+ +
-showlabels + boolean
+ +
-showseparators + boolean
+ +
-snipstring + string
+ +
-sortcommand + command
+ +
-spacing + screenDistance
+ +
-state + normal|disabled
+ +
-stretch + all|columnIndexList
+ +
-stripebackground + color  or  -stripebg + color
+ +
-stripeforeground + color  or  -stripefg + color
+ +
-stripeheight + lines
+ +
-takefocus + 0|1|""|command
+ +
-targetcolor + color
+ +
-tight boolean
+ +
-titlecolumns + number
+ +
-tooltipaddcommand + command
+ +
-tooltipdelcommand + command
+ +
-treecolumn + columnIndex
+ +
-treestyle + adwaita|ambiance|aqua|arc|baghira|bicolor1|bicolor2|bicolor3|bicolor4|blueMenta|
+            classic1|classic2|classic3|classic4|dust|dustSand|gtk|klearlooks|mate|menta|
+            mint|mint2|newWave|oxygen1|oxygen2|phase|plain1|plain2|plain3|plain4|plastik|
+            plastique|radiance|ubuntu|ubuntu2|ubuntu3|ubuntuMate|vistaAero|vistaClassic|
+            win7Aero|win7Classic|win10|winnative|winxpBlue|winxpOlive|winxpSilver|yuyo
+ +
-width characters
+ +
-xmousewheelwindow + window
+ +
-ymousewheelwindow + window
+ +
COLUMN CONFIGURATION OPTIONS
+ +
-align + left|right|center
+ +
-background + color  or  -bg + color
+ +
-changesnipside + boolean
+ +
-changetitlesnipside + boolean
+ +
-editable + boolean
+ +
-editwindow + name
+ +
-font font
+ +
-foreground + color  or  -fg + color
+ +
-formatcommand + command
+ +
-hide boolean
+ +
-labelalign + left|right|center
+ +
-labelbackground + color  or  -labelbg + color
+ +
-labelborderwidth + screenDistance  or  -labelbd + screenDistance
+ +
-labelcommand + command
+ +
-labelcommand2 + command
+ +
-labelfont + font
+ +
-labelforeground + color  or  -labelfg + color
+ +
-labelheight + lines
+ +
-labelimage + image
+ +
-labelpady + screenDistance
+ +
-labelrelief + raised|sunken|flat|ridge|solid|groove
+ +
-labelvalign + center|top|bottom
+ +
-maxwidth + width
+ +
-name name
+ +
-resizable + boolean
+ +
-selectbackground + color
+ +
-selectfiltercommand + command
+ +
-selectforeground + color
+ +
-showarrow + boolean
+ +
-showlinenumbers + boolean
+ +
-sortcommand + command
+ +
-sortmode + ascii|asciinocase|command|dictionary|integer|real
+ +
-stretchable + boolean
+ +
-stripebackground + color
+ +
-stripeforeground + color
+ +
-text list
+ +
-title title
+ +
-valign + center|top|bottom
+ +
-width width
+ +
-wrap boolean
+ +
ROW CONFIGURATION OPTIONS IN THE + TABLELIST BODY
+ +
-background + color  or  -bg + color
+ +
-font font
+ +
-foreground + color  or  -fg + color
+ +
-hide boolean
+ +
-name name
+ +
-selectable + boolean
+ +
-selectbackground + color
+ +
-selectforeground + color
+ +
-text list
+ +
ROW CONFIGURATION OPTIONS IN THE + TABLELIST HEADER
+ +
-background + color  or  -bg + color
+ +
-font font
+ +
-foreground + color  or  -fg + color
+ +
-name name
+ +
-text list
+ +
CELL CONFIGURATION OPTIONS IN THE + TABLELIST BODY
+ +
-background + color  or  -bg + color
+ +
-editable + boolean
+ +
-editwindow + name
+ +
-font font
+ +
-foreground + color  or  -fg + color
+ +
-image image
+ +
-imagebackground + color
+ +
-selectbackground + color
+ +
-selectforeground + color
+ +
-stretchwindow + boolean
+ +
-text text
+ +
-valign + center|top|bottom
+ +
-window + command
+ +
-windowdestroy + command
+ +
-windowupdate + command
+ +
CELL CONFIGURATION OPTIONS IN + THE TABLELIST HEADER
+ +
-background + color  or  -bg + color
+ +
-font font
+ +
-foreground + color  or  -fg + color
+ +
-image + image
+ +
-imagebackground + color
+ +
-stretchwindow + boolean
+ +
-text text
+ +
-valign + center|top|bottom
+ +
-window + command
+ +
-windowdestroy + command
+ +
-windowupdate + command
+ +
COLORS AND FONTS
+ +
USING A TABLELIST AS MULTI-COLUMN + TREE WIDGET
+ +
INTERACTIVE CELL EDITING
+ +
DRAG & DROP + SUPPORT
+ +
VIRTUAL EVENTS
+ +
ROW INDICES
+ +
+
+number  knumber  active  anchor  end  last  top  bottom  @x,y  name
+
+
+ +
NODE INDICES
+ +
+
+root  number  knumber  active  anchor  end  last  top  bottom  @x,y  name
+
+
+ +
COLUMN INDICES
+ +
+
+number  active  anchor  end  last  left  right  @x,y  name
+
+
+ +
CELL INDICES
+ +
+
+row,col  active  anchor  end  last  @x,y
+
+    row: number  knumber  active  anchor  end  last  top  bottom  name
+    col: number  active  anchor  end  last  left  right  name
+
+
+ +
HEADER ROW INDICES
+ +
+
+number  hknumber  end  last  @x,y  name
+
+
+ +
HEADER CELL INDICES
+ +
+
+headerRow,col  end  last  @x,y
+
+    headerRow: number  hknumber  end  last  name
+    col:       number  active  anchor  end  last  left  right  name
+
+
+ +
WIDGET COMMAND
+ +
pathName activate + index
+ +
pathName activatecell + cellIndex
+ +
pathName applysorting + itemList
+ +
pathName attrib ?name? + ?value name value ...?
+ +
pathName bbox + index
+ +
pathName bodypath
+ +
pathName bodytag
+ +
pathName canceledediting
+ +
pathName cancelediting
+ +
pathName cellattrib + cellIndex ?name? ?value name value + ...?
+ +
pathName cellbbox + cellIndex
+ +
pathName cellcget + cellIndex option
+ +
pathName cellconfigure + cellIndex ?option? ?value option value + ...?
+ +
pathName cellindex + cellIndex
+ +
+ pathName cellselection + option args + +
+
pathName cellselection anchor + cellIndex
+ +
pathName cellselection clear firstCell + lastCell
+ +
pathName cellselection clear + cellIndexList
+ +
pathName cellselection includes + cellIndex
+ +
pathName cellselection set firstCell + lastCell
+ +
pathName cellselection set + cellIndexList
+
+
+ +
pathName cget + option
+ +
pathName childcount + nodeIndex
+ +
pathName childindex + index
+ +
pathName childkeys + nodeIndex
+ +
pathName collapse + indexList ?-fully|-partly?
+ +
pathName collapseall + ?-fully|-partly?
+ +
pathName columnattrib + columnIndex ?name? ?value name value + ...?
+ +
pathName columncget + columnIndex option
+ +
pathName columnconfigure columnIndex + ?option? ?value option value ...?
+ +
pathName columncount
+ +
pathName columnindex + columnIndex
+ +
pathName columnwidth + columnIndex + ?-requested|-stretched|-total?
+ +
pathName configcelllist {cellIndex option + value cellIndex option value ...}
+ +
pathName configcells + ?cellIndex option value cellIndex option + value ...?
+ +
pathName configcolumnlist {columnIndex + option value columnIndex option value + ...}
+ +
pathName configcolumns + ?columnIndex option value columnIndex + option value ...?
+ +
pathName configrowlist + {index option value index option + value ...}
+ +
pathName configrows + ?index option value index option + value ...?
+ +
pathName configure + ?option? ?value option value ...?
+ +
pathName containing + y
+ +
pathName containingcell x y
+ +
pathName containingcolumn x
+ +
pathName cornerlabelpath
+ +
pathName cornerpath ?-ne|-sw?
+ +
pathName curcellselection + ?-all|-nonhidden|-viewable?
+ +
pathName curselection + ?-all|-nonhidden|-viewable?
+ +
pathName delete + firstIndex lastIndex
+ +
pathName delete + indexList
+ +
pathName deletecolumns + firstColumn lastColumn
+ +
pathName deletecolumns + columnIndexList
+ +
pathName depth + nodeIndex
+ +
pathName descendantcount nodeIndex
+ +
pathName dicttoitem + dictionary
+ +
pathName editcell + cellIndex
+ +
pathName editinfo
+ +
pathName editwinpath
+ +
pathName editwintag
+ +
pathName embedcheckbutton cellIndex + ?command?
+ +
pathName embedcheckbuttons columnIndex + ?command?
+ +
pathName embedttkcheckbutton cellIndex + ?command?
+ +
pathName embedttkcheckbuttons columnIndex + ?command?
+ +
pathName entrypath
+ +
pathName expand + indexList ?-fully|-partly?
+ +
pathName expandall + ?-fully|-partly?
+ +
pathName expandedkeys
+ +
pathName fillcolumn + columnIndex text
+ +
pathName findcolumnname name
+ +
pathName findrowname + name ?-descend? ?-parent nodeIndex?
+ +
pathName finishediting
+ +
pathName formatinfo
+ +
pathName get firstIndex + lastIndex
+ +
pathName get + indexList
+ +
pathName getcells + firstCell lastCell
+ +
pathName getcells + cellIndexList
+ +
pathName getcolumns + firstColumn lastColumn
+ +
pathName getcolumns + columnIndexList
+ +
pathName getformatted + firstIndex lastIndex
+ +
pathName getformatted + indexList
+ +
pathName getformattedcells firstCell + lastCell
+ +
pathName getformattedcells + cellIndexList
+ +
pathName getformattedcolumns firstColumn + lastColumn
+ +
pathName getformattedcolumns + columnIndexList
+ +
pathName getfullkeys + firstIndex lastIndex
+ +
pathName getfullkeys + indexList
+ +
pathName getkeys + firstIndex lastIndex
+ +
pathName getkeys + indexList
+ +
pathName hasattrib + name
+ +
pathName hascellattrib + cellIndex name
+ +
pathName hascolumnattrib columnIndex + name
+ +
pathName hasrowattrib + index name
+ +
pathName header option + ?arg arg ...?
+ +
pathName headerpath
+ +
pathName headertag
+ +
pathName hidetargetmark
+ +
pathName imagelabelpath cellIndex
+ +
pathName index + index
+ +
pathName insert index + ?item item ...?
+ +
pathName insertchildlist parentNodeIndex + childIndex itemList
+ +
pathName insertchild(ren) parentNodeIndex + childIndex ?item item ...?
+ +
pathName insertcolumnlist columnIndex + {width title ?left|right|center? + width title ?left|right|center? + ...}
+ +
pathName insertcolumns + columnIndex ?width title + ?left|right|center? width title + ?left|right|center? ...?
+ +
pathName insertlist + index itemList
+ +
pathName iselemsnipped + cellIndex fullTextName
+ +
pathName isexpanded + index
+ +
pathName istitlesnipped columnIndex + fullTextName
+ +
pathName isviewable + index
+ +
pathName itemlistvar
+ +
pathName itemtodict + item
+ +
pathName labelpath + columnIndex
+ +
pathName labels
+ +
pathName labeltag
+ +
pathName move + sourceIndex targetIndex
+ +
pathName move + sourceIndex targetParentNodeIndex + targetChildIndex
+ +
pathName movecolumn + sourceColumn targetColumn
+ +
pathName nearest + y
+ +
pathName nearestcell + x y
+ +
pathName nearestcolumn + x
+ +
pathName noderow + parentNodeIndex childIndex
+ +
pathName parentkey + nodeIndex
+ +
pathName refreshsorting + ?parentNodeIndex?
+ +
pathName rejectinput
+ +
pathName resetsortinfo
+ +
pathName restorecursor
+ +
pathName rowattrib + index ?name? ?value name value + ...?
+ +
pathName rowcget + index option
+ +
pathName rowconfigure + index ?option? ?value option value + ...?
+ +
pathName scan + mark|dragto x y
+ +
pathName searchcolumn + columnIndex pattern ?options?
+ +
pathName see + index
+ +
pathName seecell + cellIndex
+ +
pathName seecolumn + columnIndex
+ +
+ pathName selection + option args + +
+
pathName selection anchor + index
+ +
pathName selection clear firstIndex + lastIndex
+ +
pathName selection clear + indexList
+ +
pathName selection includes + index
+ +
pathName selection set firstIndex + lastIndex
+ +
pathName selection set + indexList
+
+
+ +
pathName separatorpath + ?columnIndex?
+ +
pathName separators
+ +
pathName setbusycursor
+ +
pathName showtargetmark before|inside + index
+ +
pathName size
+ +
pathName sort + ?-increasing|-decreasing?
+ +
pathName sortbycolumn + columnIndex ?-increasing|-decreasing?
+ +
pathName sortbycolumnlist columnIndexList + ?sortOrderList?
+ +
pathName sortcolumn
+ +
pathName sortcolumnlist
+ +
pathName sortorder
+ +
pathName sortorderlist
+ +
pathName targetmarkpath
+ +
pathName targetmarkpos + y ?-any|-horizontal|-vertical?
+ +
pathName togglecolumnhide firstColumn + lastColumn
+ +
pathName togglecolumnhide + columnIndexList
+ +
pathName togglerowhide + firstIndex lastIndex
+ +
pathName togglerowhide + indexList
+ +
pathName toplevelkey + index
+ +
pathName unsetattrib + name
+ +
pathName unsetcellattrib cellIndex + name
+ +
pathName unsetcolumnattrib columnIndex + name
+ +
pathName unsetrowattrib index + name
+ +
pathName viewablerowcount ?firstIndex + lastIndex?
+ +
pathName windowpath + cellIndex
+ +
+ pathName xview + ?args? + +
+
pathName xview
+ +
pathName xview units
+ +
pathName xview moveto + fraction
+ +
pathName xview scroll number + units|pages
+
+
+ +
+ pathName yview + ?args? + +
+
pathName yview
+ +
pathName yview units
+ +
pathName yview moveto + fraction
+ +
pathName yview scroll number + units|pages
+
+
+ +
HEADER-RELATED + SUBCOMMANDS
+ +
pathName header bbox + headerIndex
+ +
pathName header + cellattrib headerCellIndex ?name? ?value + name value ...?
+ +
pathName header + cellbbox headerCellIndex
+ +
pathName header + cellcget headerCellIndex option
+ +
pathName header + cellconfigure headerCellIndex ?option? ?value + option value ...?
+ +
pathName header + cellindex headerCellIndex
+ +
pathName header + configcelllist {headerCellIndex option value + headerCellIndex option value ...}
+ +
pathName header + configcells ?headerCellIndex option value + headerCellIndex option value ...?
+ +
pathName header + configrowlist {headerIndex option value + headerIndex option value ...}
+ +
pathName header + configrows ?headerIndex option value + headerIndex option value ...?
+ +
pathName header + containing y
+ +
pathName header + containingcell x y
+ +
pathName header delete + firstHeaderIndex lastHeaderIndex
+ +
pathName header delete + headerIndexList
+ +
pathName header + embedcheckbutton headerCellIndex + ?command?
+ +
pathName header + embedcheckbuttons columnIndex ?command?
+ +
pathName header + embedttkcheckbutton headerCellIndex + ?command?
+ +
pathName header + embedttkcheckbuttons columnIndex + ?command?
+ +
pathName header + fillcolumn columnIndex text
+ +
pathName header + findrowname name
+ +
pathName header get + firstHeaderIndex lastHeaderIndex
+ +
pathName header get + headerIndexList
+ +
pathName header + getcells firstHeaderCell lastHeaderCell
+ +
pathName header + getcells headerCellIndexList
+ +
pathName header + getcolumns firstColumn lastColumn
+ +
pathName header + getcolumns columnIndexList
+ +
pathName header + getformatted firstHeaderIndex + lastHeaderIndex
+ +
pathName header + getformatted headerIndexList
+ +
pathName header + getformattedcells firstHeaderCell + lastHeaderCell
+ +
pathName header + getformattedcells headerCellIndexList
+ +
pathName header + getformattedcolumns firstColumn + lastColumn
+ +
pathName header + getformattedcolumns columnIndexList
+ +
pathName header + getfullkeys firstHeaderIndex + lastHeaderIndex
+ +
pathName header + getfullkeys headerIndexList
+ +
pathName header getkeys + firstHeaderIndex lastHeaderIndex
+ +
pathName header getkeys + headerIndexList
+ +
pathName header + hascellattrib headerCellIndex name
+ +
pathName header + hasrowattrib headerIndex name
+ +
pathName header + imagelabelpath headerCellIndex
+ +
pathName header index + headerIndex
+ +
pathName header insert + headerIndex ?item item ...?
+ +
pathName header + insertlist headerIndex itemList
+ +
pathName header + iselemsnipped headerCellIndex + fullTextName
+ +
pathName header + itemlistvar
+ +
pathName header nearest + y
+ +
pathName header + nearestcell x y
+ +
pathName header + rowattrib headerIndex ?name? ?value + name value ...?
+ +
pathName header rowcget + headerIndex option
+ +
pathName header + rowconfigure headerIndex ?option? ?value + option value ...?
+ +
pathName header + size
+ +
pathName header + unsetcellattrib headerCellIndex name
+ +
pathName header + unsetrowattrib headerIndex name
+ +
pathName header + windowpath headerCellIndex
+ +
DEFAULT AND INDIVIDUAL BINDINGS FOR + THE TABLELIST BODY
+ +
DEFAULT AND INDIVIDUAL BINDINGS + FOR THE HEADER ITEMS
+ +
DEFAULT AND INDIVIDUAL BINDINGS + FOR THE HEADER LABELS
+ +
DEFAULT BINDINGS FOR INTERACTIVE + CELL EDITING
+ +
KEYWORDS
+ +
tablelist, multi-column, listbox, tree, widget
+
+ +
+

Contents     Start page

+
+ +
+ +

Detailed Reference

+ +
+
NAME
+ +
tablelist::tablelist – Create and manipulate + tablelist widgets
+ +
SYNOPSIS
+ +
+
+tablelist::tablelist pathName ?options?
+
+
+ +
DESCRIPTION
+ +
The tablelist::tablelist command creates a new + window named pathName and of the class + Tablelist, and makes it into a tablelist + widget.  Additional options, described below, may be specified on the + command line or in the option database to configure aspects of the + tablelist such as its colors, font, and columns.  The + tablelist::tablelist command returns its + pathName argument.  At the time this command is + invoked, there must not exist a window named pathName, + but pathName's parent must exist.
+ +
A tablelist is a multi-column listbox and tree widget, + implemented as a mega-widget, consisting of a body and a + header.  The body displays a list of items, one per + line.  Each item is a list of elements, which are aligned in + columns.  In other words, an item is the content of a row, and an + element is the text contained in a cell.  The header consists of label + widgets displaying the column titles.  They can be used, among others, + for interactive column resizing and column-based sorting of the body items, + as described below.  For Tk versions 8.5 and higher, the header + component can also contain (a typically small number of) items, just like + the body.  The order of the header items is not affected by any + sorting-related commands or bindings.  The end of the header row area + is visualized with the aid of a horizontal separator, placed just below the + last header row (if any).
+ +
The reason for restricting the support for header items to + Tk versions 8.5 and later is that the header's height is set to be just + large enough to hold all its items.  This is done with the aid of + the  count -ypixels  text widget command, + which was introduced in Tk 8.5.
+ +
Each cell (in both the body and the header) and each header + label of a tablelist widget can also contain an image, which is placed to + the left or right of the text, depending on the column's alignment.  + Instead of an image, a tablelist cell (in both the body and the header) can + also contain an embedded window, placed to the left or right of the text, + just like an embedded image.
+ +
When a tablelist is used as a tree widget, one of its + columns will display the tree hierarchy with the aid of indentations and + expand/collapse controls.  The Tablelist package provides a great + variety of tree styles controlling the look & feel of that column, and + chooses the correct default style depending on the windowing system, + operating system version, and tile theme.  In a tablelist used as a + multi-column tree widget, every row of its body (but not of its header) is + at the same time a tree node, having exactly one parent node + and any number of child nodes.  The tree's origin is the + invisible root node, which has no parent itself and whose children + are the top-level nodes.
+ +
The elements of a tablelist widget can, per default, be only + edited programmatically.  However, interactive editing can be enabled + for individual cells and for entire columns of the widget's body.  Per + default, the interactive cell editing uses a temporary embedded entry + widget, thus making sure that all the validation facilities available for + entry widgets can be used during the editing process.  A great variety + of widgets from the packages BWidget, Iwidgets, combobox (by Bryan Oakley), + ctext, and Mentry (or Mentry_tile), as well as Tk core text, spinbox, + checkbutton, and menubutton widgets, along with tile entry, spinbox, + combobox, checkbutton, and menubutton widgets are also supported as + temporary embedded widgets used for cell editing.  In addition, a rich + set of keyboard bindings is provided for a comfortable navigation between + the editable cells.
+ +
When first created, a new tablelist widget has no + items.  Items (in both the body and the header) may be added, deleted, + or updated using widget commands described below.  In addition, one or + more items or elements of the widget's body may be selected.  If a + tablelist widget is exporting its selection (see the + -exportselection option), then it will observe the + standard X11 protocols for handling the selection.  Tablelist widget + selections are available as types STRING and + UTF8_STRING; the value of the selection will be a text + built by taking all of the rows having at least one viewable selected element, joining these elements + together with tabs, and the resulting strings in turn with newlines.  + If a tablelist widget that is exporting its selection is the selection + owner and some other window claims ownership of the selection away from it, + then the virtual event + <<TablelistSelectionLost>> is + generated.
+ +
It is not necessary for all the elements to be displayed in + the tablelist widget at once; commands described below may be used to + change the horizontal view in the window and the vertical view in the body + (but not in the header).  Tablelist widgets allow scrolling in both + directions (but no vertical scrolling in the header component), using the + standard -xscrollcommand and + -yscrollcommand options.  They also support + scanning in the widget's body (but not in its header), as described + below.
+ +
Each tablelist widget, as well as each tablelist column, + row, and cell (in both the body and the header) may have any number of + attributes, which can be used in commands that create or manipulate + tablelist widgets for particular purposes.
+ +
STANDARD OPTIONS
+ +
+
+-borderwidth          -highlightthickness  -setgrid
+-cursor               -relief              -xscrollcommand
+-exportselection      -selectbackground    -yscrollcommand
+-highlightbackground  -selectborderwidth
+-highlightcolor       -selectforeground
+
+
+ +
See the options manual entry for details on the standard + options.  The -highlightbackground, + -highlightcolor, and + -highlightthickness options are only supported by the + Tablelist package, but not by Tablelist_tile.  When using the package + Tablelist_tile, the options -selectbackground, + -selectborderwidth, and + -selectforeground have theme-specific default + values.
+ +
REMARK 1:  If the value of the -width configuration option is zero or less and the + tablelist has stretchable columns, then the + -setgrid option will be ignored.  This minor + restriction has technical reasons and is only relevant on X11.
+ +
REMARK 2:  Instead of creating the scrollbar(s) + manually and setting the -xscrollcommand and/or + -yscrollcommand options accordingly, you might consider + to use the scrollarea widget + of the Scrollutil package, + which greatly simplifies the creation of arbitrary scrolled widgets, + supports both static and dynamic scrollbars, and respects the header + component and title columns of tablelist widgets.
+ +
OPTIONS FOR THE BODY AND HEADER + COMPONENTS OF THE WIDGET
+ +
+
+-background  -disabledforeground  -font  -foreground
+
+
+ +
These options (described in the options manual entry) are only + valid for the body and header components of the tablelist widget.  As + discussed in the next section, the colors and font used when drawing the + header labels can be different from those specified for the body and + header items.  When using the package Tablelist_tile, these + options have theme-specific default values.
+ +
WIDGET-SPECIFIC OPTIONS
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -acceptchildcommand
Database Name: acceptChildCommand
Database Class: AcceptChildCommand
+ +
+

Specifies a Tcl command used to decide whether a given tablelist + node may accept a specified item being moved interactively as a child.  The + specified command is automatically concatenated with the path name of + the tablelist widget, the node index of the would-be new parent node, + and the row index of the dragged item, the resulting script is + evaluated in the global scope, and the return value (which must be a + boolean) will determine whether to allow to move the source item to the + current mouse position as a child of the given parent node.

+ +

For example, in the case of a tablelist widget used as a file + manager, in which the top-level items represent volumes mounted on the + system, the command specified by this option might look like in the + (pseudo-)code below:

+ +
+
+proc acceptChildCmd {tbl targetParentNodeIdx sourceRow} {
+    if {[string compare $targetParentNodeIdx "root"] == 0} {
+        # Allow only volumes as top-level items
+        return [expr {[$tbl depth $sourceRow] == 1}]
+    } else {
+        # Allow only directories as parent items
+        return [$targetParentNodeIdx represents a directory]
+    }
+}
+
+
+ +

For technical reasons (the use of the -elide + text widget tag option for collapsing a row), this option is not + supported for Tk versions earlier than 8.3.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -acceptdropcommand
Database Name: acceptDropCommand
Database Class: AcceptDropCommand
+ +
+

Specifies a Tcl command used to decide whether a given tablelist row + may accept a specified item being moved + interactively to be dropped as a sibling just before that + row.  The specified command is automatically concatenated with the + path name of the tablelist widget, the row index of the would-be new + target, and the row index of the dragged item, the resulting script is + evaluated in the global scope, and the return value (which must be a + boolean) will determine whether to allow to move the source item to the + current mouse position, just before the given row.

+ +

For example, to make sure that the position of the last row of a + tablelist widget won't be affected by the interactive row move + operation, the command specified by this option might look like in the + code below:

+ +
+
+proc acceptDropCmd {tbl targetRow sourceRow} {
+    set rowCount [[$tbl size]
+    return [expr {$sourceRow != $rowCount - 1 && $targetRow < $rowCount}]
+}
+
+
+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -activestyle
Database Name: activeStyle
Database Class: ActiveStyle
+ +
+

Specifies how to diplay the active item or element (depending on the + value of the -selecttype + configuration option) when the tablelist has the keyboard focus.  + The allowed values are frame, + none, and underline.  The + default value frame shows a thin frame around the + active item or element, which in most cases looks nice.  It looks + less pretty when applied to the active item if the background color of + some of its cells was changed by using the columnconfigure or cellconfigure widget command and no + column separators are shown.  The value none + specifies that no special indication of the active item or element is + to be performed.  The value underline produces + the same visual effect as in the case of the Tk core listbox.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -arrowcolor
Database Name: arrowColor
Database Class: ArrowColor
+ +
+

Specifies the color to use for the up- or down-arrow placed into a + column label by the sortbycolumn or sortbycolumnlist subcommand of the + Tcl command associated with the widget.  This option is only + relevant if the value of the -showarrow option is true.  The + default value depends on the windowing system in the Tablelist package + and on the current theme in Tablelist_tile.  For example, if the + windowing system is x11 then the default arrow + color is black and the -arrowstyle option has the default value + flat8x4.  The same holds true for some tile + themes, like alt, clam, and + default.  On the windowing system + win32, the default arrow color is + #595959 for Windows 10, #569bc0 for Windows + Vista, 7, and 8, #aca899 for Windows XP, and an empty + string for older Windows versions, paired with the default arrow style + flatAngle7x4, photo7x4, + flat9x5, and sunken8x7, + respectively.  Finally, for the windowing systems + classic and aqua on the + Macintosh, the default arrow color and style depend on the version of + the operating system:  Starting with version 10.10 (Yosemite) of + Mac OS X, the default arrow color for the windowing system + aqua is #404040 and the default arrow + style is flatAngle7x4.  For earlier operating + system versions on the Mac, the default values are the arrow color + #777777 and the arrow style flat7x7 + (or photo7x7, in the presence of PNG support).

+ +

REMARK:  If the arrow color is as empty string then the + sort arrow will inherit the background color of the header label in + which it is placed.  In this case, the arrow style should be set + to one of sunken8x7, + sunken10x9, or sunken12x11, + which will give rise to sort arrows with 3-D border and sunken + relief.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -arrowdisabledcolor
Database Name: arrowDisabledColor
Database Class: ArrowDisabledColor
+ +
+

Specifies the color to use for the up- or down-arrow placed into a + column label by the sortbycolumn or sortbycolumnlist subcommand of the + Tcl command associated with the widget when the tablelist's + state is + disabled.  This option is only relevant if the + value of the -showarrow + option is true.  When the default value of the -arrowcolor option is an empty string then + this is the default for the -arrowdisabledcolor + option, too; otherwise the latter's default value equals the default + foreground color of the header labels in disabled + state.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -arrowstyle
Database Name: arrowStyle
Database Class: ArrowStyle
+ +
+

Specifies the relief, shape, width, and height of the up- or + down-arrow placed into a column label by the sortbycolumn or sortbycolumnlist subcommand of the + Tcl command associated with the widget.  This option is only + relevant if the value of the -showarrow option is true.  The + currently supported values are flat5x3, + flat5x4, flat6x4, + flat7x4, flat7x5, + flat7x7, flat8x4, + flat8x5, flat9x5, + flat9x6, flat11x6, + flat15x8, flatAngle7x4, + flatAngle7x5, flatAngle9x5, + flatAngle9x6, flatAngle9x7, + flatAngle10x6, flatAngle10x7, + flatAngle11x6, flatAngle15x8, + photo7x4, photo7x7, + photo9x5, photo11x6, + photo15x8, sunken8x7, + sunken10x9, and sunken12x11, as + shown in the picture below (except photo*).  + The default value depends on the windowing system in the Tablelist + package and on the current theme in Tablelist_tile; see the description + of the -arrowcolor option + for details.  As mentioned there, the default arrow style on + Windows 10 is flatAngle7x4.  While this is in + most cases true, notice that the default chosen by Tablelist can also + be flatAngle9x5, flatAngle11x6, + or flatAngle15x8, depending on the display's + scaling level.  Similarly, on Windows Vista, 7, and 8, the default + chosen by Tablelist will be photo7x4, + photo9x5, photo11x6, or + photo15x8, depending on the display's scaling + level.

+ +

Arrow Styles

+ +

While the sort arrows of the styles flat* and + sunken* are created from bitmaps, the arrow styles + photo7x4, photo9x5, + photo11x6, and photo15x8 use + GIF images that look very close to the native sort arrows on Windows + Vista, 7, and 8.  When using one of these styles, the + -arrowcolor and + -arrowdisabledcolor options have + no effect.

+ +

On Windows Vista, 7, 8, and 10, the sort arrows are shown + horizontally centered in the header labels, just below their top + edges:

+ +

Arrow Styles Vista

+ +

The arrow style photo7x7 uses PNG images that + look and behave very close to the native sort arrows on Mac OS X Aqua + versions earlier than 10.10 (Yosemite).  This arrow style is only + supported if the Tk version is either 8.6 (with built-in PNG support), + or 8.5 and the img::png package can be loaded into + the interpreter.  When supported, photo7x7 + will be the default value of the -arrowstyle option + in Tablelist_tile with the aqua theme for Mac OS X + versions earlier than 10.10 (otherwise flat7x7 will + be used as default for these earlier OS X versions).  When using + this arrow style, the -arrowcolor and -arrowdisabledcolor options have + no effect, but, due to the transparency information contained in the + PNG images, the arrows will automatically adapt their color to the + various states of the header labels, just like the native sort + arrows.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -autofinishediting
Database Name: autoFinishEditing
Database Class: AutoFinishEditing
+ +
+

Specifies a boolean value that controls whether the interactive cell + editing with the aid of a tile combobox, BWidget ComboBox, Iwidgets + combobox, Oakley combobox, Tk core menubutton, or tile menubutton + widget will be finished automatically by selecting an entry of the + combobox or of the menu associated with the menubutton.  The + default value is 0.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -autoscan
Database Name: autoScan
Database Class: AutoScan
+ +
+

Specifies a boolean value that controls whether to trigger the + automatic scrolling when the mouse leaves the tablelist window with + button 1 down.  The default is 1, meaning that + automatic scrolling will be in effect, just like in the case of the Tk + listbox widget.  However, when using the TkDND package or some + other drag & drop implementation, you might want to set this option to + 0, in order to avoid any conflicts between the drag + operation and the automatic scrolling.

+ +

REMARK:  Starting with Tablelist version 5.12, this + option has become obsolete, because the default bindings now suppress + the above-mentioned automatic scrolling if the tablelist's body + component was registered as a drag source for mouse button 1 via + the  tkdnd::drag_source register  or the + BWidget DragSite::register command, or the + tablelist's -customdragsource option was set to + true.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -collapsecommand
Database Name: collapseCommand
Database Class: CollapseCommand
+ +
+

Specifies a Tcl command to be invoked when collapsing a row of a + tablelist used as a tree widget (with the aid of the collapse or collapseall subcommand).  The + specified command is automatically concatenated with the path name of + the tablelist widget and the row index, and the resulting script is + evaluated in the global scope, before hiding the descendants of the row + in question.

+ +

For technical reasons (the use of the -elide + text widget tag option for collapsing a row), this option is not + supported for Tk versions earlier than 8.3.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -colorizecommand
Database Name: colorizeCommand
Database Class: ColorizeCommand
+ +
+

Specifies a Tcl command that can be used to change the colors of + arbitrary character regions within the cells of the currently visible + rows.  Whenever the Tablelist package needs to display the various + foreground and background colors (including the stripe- and + selection-specific ones), it runs over the cells of the body and header + rows that are currently visible in the tablelist window and displays + the colors by adding appropriate tags to the body and header text + widget areas making up the formatted contents of the cells.  After + activating the colors for a cell, the Tablelist code invokes the + command specified as the value of this configuration option (provided + that it is a nonempty string), in the global scope and with the + following arguments specific to the body or header cell being + processed:

+ +
    +
  • the path name of the tablelist widget;
  • + +
  • the path name of the tablelist's body or header text widget;
  • + +
  • the full key of the item containing the element being processed + (remember that this starts with the prefix k for + a body item and with hk for a header item);
  • + +
  • the numerical row or header row index of that item;
  • + +
  • the numerical index of the cell's column;
  • + +
  • the text index (of the form line.char) + of the first \t character delimiting the cell in the + underlying text widget;
  • + +
  • the text index (of the form line.char) + of the second \t character delimiting the cell in the + underlying text widget;
  • + +
  • the boolean value 0 or 1 indicating + whether the cell being processed is contained in a stripe (see, e.g., + the description of the -stripebackground option);
  • + +
  • the boolean value 0 or 1 indicating + whether the cell being processed is currently selected.
  • +
+ +

From the above it follows that the value of this configuration + option will typically be the name of a procedure like in the following + example:

+ +
+
+proc myColorizeCmd {tbl textWidget key row col tabIdx1 tabIdx2 inStripe selected} { ... }
+
+
+ +

REMARK 1:  To change the colors of some parts of a + cell's displayed content, the command specified as the value of this + configuration option will have to make use of text widget tags having + the desired background and/or foreground colors.  Besides + -background and -foreground, + the command may also use a few other tag configuration options, like + -overstrike and + -underline.  On the other hand, be aware that + the use of some other tag configuration options (particularly + -elide and -font) can cause + conflicts with the way Tablelist renders the elements, thus giving rise + to various layout problems within the body or header of your tablelist + widget!

+ +

REMARK 2:  Since the multi-line elements are displayed + with the aid of embedded message widgets, there is currently no way to + change the colors of text areas within multi-line cells.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -columns
Database Name: columns
Database Class: Columns
+ +
+

Specifies the widths, titles, and alignments of the columns.  + The option's value must be a list of the form

+ +
+
+width title ?alignment? width title ?alignment? ...
+
+
+ +

Each width must be a number.  A positive + value specifies the column's width in average-size characters of the + widget's font.  If width is negative, its + absolute value is interpreted as a column width in pixels.  + Finally, a value of zero specifies that the column's width is to be + made just large enough to hold all the elements in the column, + including its header (but no larger than the maximum width indicated by + the -maxwidth column + configuration option).  In all three cases, the effective column + width will be somewhat greater because of the margins created + automatically to the left and right of the column.

+ +

Each title specifies the text to be displayed in + the column's header, and may optionally be followed in the next list + element by an alignment, which specifies how to + align the elements of the column.  Each + alignment must be one of left, + right, or center.  The + default is left.  The + alignment also refers to the column's title as long + as the -labelalign + option hasn't been specified for that column, or if its value is an + empty string.

+ +

The default value of this option is an empty list, specifying that + initially the widget has no columns.

+ +

REMARK:  Columns whose width was specified as zero are + called dynamic-width columns.  In general, they are more + user-friendly than their static-width counterparts, being that + their widths are automatically adapted to their contents.  On the + other hand, if the -displayondemand option is true + (which is the default) then the static-width columns perform + significantly better on item insertion and sorting than the + dynamic-width ones.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -columntitles
Database Name: columnTitles
Database Class: ColumnTitles
+ +
+

This option provides a simplified form of specifying dynamic-width, + left-aligned tablelist columns.  Its value is viewed as a list of + column titles.  The default is an empty list.

+ +

In the simplest case that no columns have been specified yet, + setting this option to the value given by the list

+ +
+
+title title ...
+
+
+ +

is equivalent to setting the -columns option to the value given by the + list

+ +
+
+0 title left 0 title left ...
+
+
+ +

If the columns have already been specified then this option updates + their titles (as many of them as possible) and, if the number of + elements of its value is greater than the number of columns then it + uses the remaining elements as titles of additional dynamic-width, + left-aligned columns.  For example, if the widget has 3 columns + and the option's value is a list of length 5 then the option will + update the titles of the 3 columns and will append 2 new dynamic-width, + left-aligned columns having as titles the last 2 elements of the + list.  If the widget has 3 columns and the option specifies just 2 + texts then it will update the titles of the first 2 columns only.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -customdragsource
Database Name: customDragSource
Database Class: CustomDragSource
+ +
+

Specifies a boolean value that indicates whether the tablelist + widget is a drag source for some drag & drop implementation other than + TkDND and the drag & drop framework included in BWidget.  If true + then the default bindings will perform an automatic drag-friendly handling of the selection and + will suppress the automatic scrolling when the mouse leaves the + tablelist window with button 1 down.  The default is + 0.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -displayondemand
Database Name: displayOnDemand
Database Class: DisplayOnDemand
+ +
+

Specifies a boolean value that controls the way the texts of newly + inserted rows in the tablelist's body will be displayed in the + underlying text widget.  If true then the texts of the new rows + won't be inserted into the body text widget until the corresponding + cells become visible (e.g., as a result of horizontal or vertical + scrolling).  Otherwise the texts of the new rows will be displayed + in the underlying text widget immediately after inserting the + rows.  The default is 1.

+ +

REMARK 1:  The default value true of this option makes + the item insertion and sorting significantly faster, especially in the + presence of static-width columns, because the snipping of elements that + don't fit into their cells will be postponed to the time when they get + displayed in the body text widget.  On the other hand, this + display on demand imposes some performance penalty on the scrolling, + especially if the tablelist widget has many columns.  To speed up + the scrolling, you might consider setting this option to false.

+ +

REMARK 2:  Newly inserted header rows are displayed + immediately in the underlying text widget, independently of the value + of this option.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -editendcommand
Database Name: editEndCommand
Database Class: EditEndCommand
+ +
+

Specifies a Tcl command to be invoked on normal termination of the + interactive editing of a cell's content if the final text of the + temporary embedded widget used for the editing is different from its + initial one.  The command is automatically concatenated with the + path name of the tablelist widget, the cell's row and column indices, + as well as the final content of the edit window, the resulting script + is evaluated in the global scope, and the return value becomes the + cell's new content after destroying the temporary embedded + widget.  The main purpose of this script is to perform a final + validation of the edit window's content.  See the description of + the -forceeditendcommand option for + more about the invocation of the command mentioned above, as well as + the INTERACTIVE CELL EDITING section for + details on the editing process.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -editselectedonly
Database Name: editSelectedOnly
Database Class: EditSelectedOnly
+ +
+

Specifies a boolean value that controls whether to start the + interactive cell editing when mouse button 1 is pressed in an editable + cell.  If this value is true then the editing will only be started + if the cell has previously been selected (interactively or + programmatically).  In this case, a first left-click will usually + just select the cell (or its row, depending on the value of the + -selecttype option), and + a second mouse click will start the editing session.  The default + is 0, meaning that the editing will be started regardless + of whether the cell is selected or not.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -editstartcommand
Database Name: editStartCommand
Database Class: EditStartCommand
+ +
+

Specifies a Tcl command to be invoked when the interactive editing + of a cell's content is started.  The command is automatically + concatenated with the path name of the tablelist widget, the cell's row + and column indices, as well as the text displayed in the cell, the + resulting script is evaluated in the global scope, and the return value + becomes the initial content of the temporary embedded widget used for + the editing.  The main purpose of this script is to define + validations for the edit window's content.  See the INTERACTIVE CELL EDITING section for details on the + editing process.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -expandcommand
Database Name: expandCommand
Database Class: ExpandCommand
+ +
+

Specifies a Tcl command to be invoked when expanding a row of a + tablelist used as a tree widget (with the aid of the expand or expandall subcommand).  The specified + command is automatically concatenated with the path name of the + tablelist widget and the row index, and the resulting script is + evaluated in the global scope, before displaying the children of the + row in question.

+ +

For technical reasons (the use of the -elide + text widget tag option for collapsing a row), this option is not + supported for Tk versions earlier than 8.3.

+ +

REMARK:  It is common practice to use the command + specified as the value of this option to insert the children of the row + that is about to be expanded, if it has no children yet.  For + example, the Directory Viewer + demo script uses the command implemented as follows:

+ +
+
+proc expandCmd {tbl row} {
+    if {[$tbl childcount $row] == 0} {
+        # Get the name of the directory whose leaf name is
+        # displayed in the first cell of the specified row
+        set dir [$tbl rowattrib $row pathName]
+
+        # Display the content of the directory $dir
+        # as child items of the one identified by $row
+        putContents $dir $tbl $row
+    }
+
+    # The rest is just eye candy:
+    if {[$tbl childcount $row] != 0} {
+        # Update the image displayed in the row's first cell
+        $tbl cellconfigure $row,0 -image openFolderImg
+    }
+}
+
+
+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -forceeditendcommand
Database Name: forceEditEndCommand
Database Class: ForceEditEndCommand
+ +
+

Specifies a boolean value that controls the invocation of the + command given by the the -editendcommand option.  If this + value is true then the command will be invoked on normal termination of + the editing process even if the final text of the temporary embedded + widget used for the editing equals its initial one, and will also be + invoked when the interactive cell editing is canceled (in the latter + case, the text passed to it as last argument will be the cell's + original content, not its final one).  The default value of this + option is 0, meaning that the command will only be invoked + on normal termination of the editing process, if the final text of the + temporary embedded widget is different from its initial one.  See + the INTERACTIVE CELL EDITING section for + details on the editing process.

+ +

If the option's value is true and no value for the + -editendcommand option was specified, then on + normal termination of the editing process the cell's new content will + be set to the text contained in the edit window, even if it has not + been changed interactively (but might have been returned by the command + given by the the -editstartcommand option).

+ +

Setting this option to true enables you to execute an arbitrary + action whenever the interactive cell editing is finished.  Just + binding a script to the <Destroy> event for + the temporary embedded widget used for the editing won't work, because + that widget might be destroyed and recreated automatically under + various circumstances.  Alternately, you can use the + <<TablelistCellUpdated>> and + <<TablelistCellRestored>> virtual + events, generated by the finishediting and cancelediting subcommands, + respectively.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -fullseparators
Database Name: fullSeparators
Database Class: FullSeparators
+ +
+

Specifies a boolean value that controls whether the separators (if + any) shall extend all of the way to the bottom of the tablelist's + body.  The default is 0, meaning that the height of + the separators will be adjusted to the widget's content, i.e., they + won't extend to the bottom of the tablelist's body if there is free + vertical space left below the widget's last row.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -height
Database Name: height
Database Class: Height
+ +
+

Specifies the desired height for the tablelist's body, in units of + characters in the font given by the -font + option.  This is at the same time the desired height in rows, + provided that no column-, row-, or cell-specific fonts, multi-line + elements, or embedded images or windows make the height of any of the + body items different from the one corresponding to the above-mentioned + font.  If the option's value is zero or less, then the body's + desired height in units of characters in the widget's font is kept in + sync with the number of viewable body items; + again, if all the items in the tablelist's body have the height + corresponding to the widget's font then this means that the body's + desired height is made just large enough to hold all the viewable body + items.

+ +

REMARK:  Embedded images and windows often make the rows + of the tablelist higher, resulting in a discrepancy between the value + of this option and the number of rows visible in the body window.  + In most cases you can work around this problem by saving the value of + the widget's -font option, setting the latter to a + sufficiently large font, and then setting the -font + row configuration option of each body and header item to the saved + widget font value.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -incrarrowtype
Database Name: incrArrowType
Database Class: IncrArrowType
+ +
+

Specifies the type of the arrow placed into a column label when + sorting the items based on that column in increasing order, with the + aid of the sortbycolumn + or sortbycolumnlist + subcommand of the Tcl command associated with the widget.  The + value of this option must be one of up or + down.  The default is + up.  This option is only relevant if the value + of the -showarrow option + is true.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -instanttoggle
Database Name: instantToggle
Database Class: InstantToggle
+ +
+

Specifies a boolean value that controls whether the interactive cell + editing with the aid of a Tk or tile checkbutton widget, if started + with the left mouse button, will be finished immediately after + automatically toggling the checked state of the temporary embedded + checkbutton.  The default value is 0, meaning that a + mouse click into the cell will only start the editing session (and + automatically toggle the checkbutton's checked state), but not also + finish it.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelactivebackground
Database Name: labelActiveBackground
Database Class: Foreground
+ +
+

Specifies the -activebackground option for the + header labels, i.e., the background color to use when the mouse cursor + is positioned over a header label and the value of + tk_strictMotif is false.  This option is only + defined in the Tablelist package if the Tk version being used supports + the -activebackground option for label + widgets.  This is checked by Tablelist at initialization time, and + will normally be the case for Tk versions 8.3.2 or higher.  On the + other hand, the Tablelist_tile package doesn't support the + -labelactivebackground option.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelactiveforeground
Database Name: labelActiveForeground
Database Class: Background
+ +
+

Specifies the -activeforeground option for the + header labels, i.e., the foreground color to use when the mouse cursor + is positioned over a header label and the value of + tk_strictMotif is false.  This option is only + defined in the Tablelist package if the Tk version being used supports + the -activeforeground option for label + widgets.  This is checked by Tablelist at initialization time, and + will normally be the case for Tk versions 8.3.2 or higher.  On the + other hand, the Tablelist_tile package doesn't support the + -labelactiveforeground option.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelbackground or + -labelbg
Database Name: labelBackground
Database Class: Background
+ +
+

Specifies the -background option for the header + labels.  This option is only supported by the Tablelist package, + but not by Tablelist_tile.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelborderwidth or + -labelbd
Database Name: labelBorderWidth
Database Class: BorderWidth
+ +
+

Specifies the -borderwidth option for the header + labels.  This option is different from the standard + -borderwidth option defined for the tablelist + widget itself.  In the package Tablelist_tile this option has a + theme-specific default value.

+ +

REMARK:  Please take into account that in some themes, + setting this option to a value other than the default might be ignored + by tile and thus could cause alignment problems.  This is because + the border of tile widgets is drawn with theme-specific methods, which + will not always produce the results known from Tk widgets.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelcommand
Database Name: labelCommand
Database Class: LabelCommand
+ +
+

Specifies a Tcl command to be invoked when mouse button 1 is pressed + over one of the header labels and later released over the same + label.  Provided that the option's value is a nonempty string, + when the <ButtonRelease-1> event occurs, the + command is automatically concatenated with the path name of the + tablelist widget and the column index of the respective label, and the + resulting script is evaluated in the global scope.  If another + nonempty command was specified as the value of the option of the same + name at column level then that column-specific command will be used + instead of the global one.  If the tablelist's state is disabled then this + action will not take place.  The most common value of this option + is tablelist::sortByColumn; + this command sorts the items based on the column whose index was passed + to it as second argument.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelcommand2
Database Name: labelCommand2
Database Class: LabelCommand2
+ +
+

Specifies a Tcl command to be invoked when mouse button 1 is pressed + together with the Shift key over one of the header labels + and later released over the same label.  Provided that the + option's value is a nonempty string, when the + <ButtonRelease-1> event occurs, the command + is automatically concatenated with the path name of the tablelist + widget and the column index of the respective label, and the resulting + script is evaluated in the global scope.  If another nonempty + command was specified as the value of the option of the same name at + column level then that column-specific command will be used instead of + the global one.  If the tablelist's state is disabled then this + action will not take place.  The most common value of this option + is tablelist::addToSortColumns; + this command adds the column index passed to it as second argument to + the list of sort columns and sorts the items based on the columns + indicated by the modified list.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labeldisabledforeground
Database Name: labelDisabledForeground
Database Class: DisabledForeground
+ +
+

Specifies the -disabledforeground option for the + header labels, i.e., the foreground color to use for the labels when + the tablelist's state is + disabled.  This option is only defined in the + Tablelist package if the Tk version being used supports the + -disabledforeground option for label widgets.  + This is checked by Tablelist at initialization time, and will normally + be the case for Tk versions 8.3.1 or higher.  On the other hand, + the Tablelist_tile package doesn't support the + -labeldisabledforeground option.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelfont
Database Name: labelFont
Database Class: Font
+ +
+

Specifies the -font option for the header + labels.  In the package Tablelist_tile this option has a + theme-specific default value.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelforeground or + -labelfg
Database Name: labelForeground
Database Class: Foreground
+ +
+

Specifies the -foreground option for the header + labels.  In the package Tablelist_tile this option has a + theme-specific default value.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelheight
Database Name: labelHeight
Database Class: Height
+ +
+

Specifies the -height option for the header + labels.  This option is only supported by the Tablelist package, + but not by Tablelist_tile.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelpady
Database Name: labelPadY
Database Class: Pad
+ +
+

In the Tablelist package this option specifies the + -pady configuration option for the header + labels.  In the Tablelist_tile package the value of the + -labelpady option is mapped to the corresponding + components of the value of the -padding + configuration option of the header labels, and the + -labelpady option has a theme-specific default + value.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -labelrelief
Database Name: labelRelief
Database Class: Relief
+ +
+

Specifies the -relief option for the header + labels.  This option is different from the standard + -relief option defined for the tablelist widget + itself.  The default value is raised.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -listvariable
Database Name: listVariable
Database Class: Variable
+ +
+

Specifies the name of a global varable or a qualified name of a + namespace variable.  The value of the variable is a list to be + displayed inside the widget's body; if the variable value changes then + the widget will automatically update itself to reflect the new + value.  The value of the variable must be a valid list.  Each + list element corresponds to a row within the widget's body, and must be + a valid list itself; its elements correspond to the cells within the + respective row.  Attempts to assign a variable whose value does + not fulfill these conditions to -listvariable will + cause an error.  Attempts to unset a variable in use as a + -listvariable will fail but will not generate an + error.

+ +

REMARK 1:  For increased efficiency, updating the widget + to reflect a changed value of the variable specified with this option + is, whenever possible, done at idle time (i.e., when there are no + events to process).  On the other hand, most tablelist subcommands + make it necessary to perform an immediate update of the widget's + internal list according to the value of this variable, before executing + the subcommand in question.  Doing this repeatedly can become + quite inefficient.  To avoid performance problems, you should + always try to separate the operations that build up the value of the + variable specified by this option from other commands.  For + example, instead of

+ +
+
+tablelist::tablelist .tbl ... -listvariable var
+set var {}
+for {set row 0} {$row < 1000} {incr row} {
+    lappend var ...
+    .tbl cellconfigure $row,3 -image ...
+}
+
+
+ +

you should write

+ +
+
+tablelist::tablelist .tbl ... -listvariable var
+set var {}
+for {set row 0} {$row < 1000} {incr row} {
+    lappend var ...
+}
+for {set row 0} {$row < 1000} {incr row} {
+    .tbl cellconfigure $row,3 -image ...
+}
+
+
+ +

The first method above is quite inefficient, because it requires + 1000 updates of the widget's internal list.  The second method + performs incomparably faster, because it needs only one synchronization + (at the beginning of the second loop).

+ +

REMARK 2:  It is not recommended to set this option for + a tablelist used as a tree widget, because adding new items to the list + specified as its value will result in inserting those list elements + into the widget without respecting the tree's internal structure.  + There is no problem if you access the variable for reading only, but + for that purpose it is more efficient to use the itemlistvar subcommand rather than the + -listvariable option.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -movablecolumns
Database Name: movableColumns
Database Class: MovableColumns
+ +
+

Specifies a boolean value that determines whether the columns can be + moved interactively.  See the DEFAULT + AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS section below for + information on moving a column interactively.  The default value + is 0.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -movablerows
Database Name: movableRows
Database Class: MovableRows
+ +
+

Specifies a boolean value that determines whether the rows displayed + in the tablelist's body can be moved interactively.  See the + LOCAL DRAG & DROP subsection of the + DEFAULT AND INDIVIDUAL BINDINGS FOR THE + TABLELIST BODY section below for information on moving a row + interactively.  The default value is 0.

+ +

REMARK:  The support for moving a row is restricted to + the widget's body component.  Moving of header rows is not + supported.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -movecolumncursor
Database Name: moveColumnCursor
Database Class: MoveColumnCursor
+ +
+

Specifies the mouse cursor to be used when moving a column + interactively.  The default value is icon on + the windowing systems x11 and + win32, and the native cursor + closedhand on the Macintosh windowing systems + classic and aqua.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -movecursor
Database Name: moveCursor
Database Class: MoveCursor
+ +
+

Specifies the mouse cursor to be used when moving a row + interactively.  The default value is hand2 on + the windowing systems x11 and + win32, and the native cursor + pointinghand on the Macintosh windowing systems + classic and aqua.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -populatecommand
Database Name: populateCommand
Database Class: PopulateCommand
+ +
+

Specifies a Tcl command to be invoked by the searchcolumn subcommand before examining + the children (or descendants, when used with the + -descend option) of a tablelist row whose children + have not been inserted yet.  The specified command is + automatically concatenated with the path name of the tablelist widget + and the row index, and the resulting script is evaluated in the global + scope.  It is expected that this script will insert the children + of the row in question, without expanding the node or changing its + appearance in any other way.

+ +

For technical reasons (the use of the -elide + text widget tag option for collapsing a row), this option is not + supported for Tk versions earlier than 8.3.

+ +

REMARK:  There are many similarities between this option + and -expandcommand.  Both options are + used in the first place to insert children on demand.  The main + differences between them are as follows:

+ +
    +
  1. The command specified by the + -populatecommand option is only invoked for rows + whose children have not been inserted yet, while the one specified by + -expandcommand is always invoked before expanding + a row, regardless of whether the children of that row are already + present in the widget or not.
  2. + +
  3. The command specified by the + -expandcommand option may perform visual changes + on the node in question, while the role of the one specified by + -populatecommand is restricted to inserting the + children, without altering the node's appearance in any way.
  4. +
+ +

A logical consequence of the above is that the value of + -populatecommand is usually just a stripped-down + version of the command specified by the + -expandcommand option.  For example, the + Directory Viewer demo script + might use a command implemented as follows:

+ +
+
+proc populateCmd {tbl row} {
+    # Get the name of the directory whose leaf name is
+    # displayed in the first cell of the specified row
+    set dir [$tbl rowattrib $row pathName]
+
+    # Display the content of the directory $dir
+    # as child items of the one identified by $row
+    putContents $dir $tbl $row
+}
+
+
+ +

Moreover, the -expandcommand option can be set + to a command that invokes the one specified by the + -populatecommand option:

+ +
+
+proc expandCmd {tbl row} {
+    if {[$tbl childcount $row] == 0} {
+        populateCmd $tbl $row
+    }
+
+    # The rest is just eye candy:
+    if {[$tbl childcount $row] != 0} {
+        # Update the image displayed in the row's first cell
+        $tbl cellconfigure $row,0 -image openFolderImg
+    }
+}
+
+
+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -protecttitlecolumns
Database Name: protectTitleColumns
Database Class: ProtectTitleColumns
+ +
+

Specifies a boolean value that determines whether the boundary of + the title column area shall be protected from being crossed when moving + a column interactively.  See the DEFAULT + AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS section below for + information on moving a column interactively.  The default value + is 0, specifying that non-title columns can be moved into + the title column area and vice-versa.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -resizablecolumns
Database Name: resizableColumns
Database Class: ResizableColumns
+ +
+

Specifies a boolean value that determines whether the columns can be + resized interactively.  See the DEFAULT + AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS section below for + information on interactive column resizing.  The default value is + 1.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -resizecursor
Database Name: resizeCursor
Database Class: ResizeCursor
+ +
+

Specifies the mouse cursor to be used during interactive column + resizing.  The default value is + sb_h_double_arrow on the windowing systems + x11 and win32, and the native + cursor resizeleftright on the Macintosh windowing + systems classic and aqua.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -selectfiltercommand
Database Name: selectFilterCommand
Database Class: SelectFilterCommand
+ +
+

Specifies a Tcl command which can be used for filtering the cells + that will be selected when the default bindings for the header labels + perform a column-wise cell + selection.  If the option's value is a nonempty string then + this command is concatenated with the path name of the tablelist widget + and the numerical index of the respective column, and the resulting + script is evaluated in the global scope.  If another nonempty + command was specified as the value of the option of the same name at + column level then that column-specific command will be used instead of + the global one.  In both cases, the resulting script is expected + to return a list consisting of the row numbers of those cells contained + in the column in question that are to be selected by the column-wise + cell selection operation.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -selectmode
Database Name: selectMode
Database Class: SelectMode
+ +
+

Specifies one of several styles for manipulating the + selection.  The value of the option may be arbitrary, but the + default bindings expect it to be either single, + browse, multiple, or + extended.  The default value is + browse.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -selecttype
Database Name: selectType
Database Class: SelectType
+ +
+

Specifies one of two selection types for the tablelist widget: + row or cell.  If the + selection type is row then the default bindings + will select and deselect entire items, and the whole row having the + location cursor will be displayed as active when the tablelist has the + keyboard focus.  If the selection type is cell + then the default bindings will select and deselect individual elements, + and the single cell having the location cursor will be displayed as + active when the tablelist has the keyboard focus.  The default + value is row.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -setfocus
Database Name: setFocus
Database Class: SetFocus
+ +
+

Specifies a boolean value that determines whether a click with the + left mouse button anywhere into the tablelist's body, including the + separators and the embedded images (more precisely, any descendants of + the tablelist widget having the binding tag TablelistBody) should set the focus to + the body of the tablelist widget if the latter's state is normal.  The + default value is 1.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -showarrow
Database Name: showArrow
Database Class: ShowArrow
+ +
+

Specifies a boolean value that determines whether the + sortbycolumn and + sortbycolumnlist + subcommands of the Tcl command associated with the widget should place + an arrow indicating the sort order into the header label(s) of the + column(s) specified by their first argument.  The default value is + 1.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -showbusycursor
Database Name: showBusyCursor
Database Class: ShowBusyCursor
+ +
+

Specifies a boolean value indicating whether the default bindings + should display a windowing system-specific busy cursor during the + actions that can take a long time to complete, using the + setbusycursor and + restorecursor + subcommands.  The default value is 1.

+ +

The potentially long-running actions that will temporarily change + the mouse cursor when this option is on are as follows:

+ +
    +
  • resizing or moving a column;
  • + +
  • invoking the command specified by the -labelcommand or -labelcommand2 option at widget or + column level (e.g., sorting the items by one or more columns);
  • + +
  • expanding or collapsing a row;
  • + +
  • extending, toggling, or canceling the (cell) selection if the + -selectmode option was + set to extended.
  • +
+ +

REMARK:  If showing the busy cursor per default during + potentially long-running actions is not what you prefer, you can + override the default for all tablelist instances by inserting the + line

+ +
+
+option add *Tablelist.showBusyCursor 0
+
+
+ +

somewhere at the beginning of your script (before creating any + tablelist widgets).

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -showeditcursor
Database Name: showEditCursor
Database Class: ShowEditCursor
+ +
+

Specifies a boolean value indicating whether the mouse cursor should + change automatically to one having the shape of a pencil whenever a + click with mouse button 1 would start an editing session.  The + default value is 1.

+ +

On X11 and Mac OS X Aqua, the cursor set by Tablelist when a mouse + click would start the interactive cell editing, is Tk's built-in cursor + pencil.  Since on Windows this cursor is ugly + and not really usable, the edit cursor shown by Tablelist on this + platform will be the one loaded from the file pencil.cur, + located in the scripts subdirectory of the Tablelist + installation directory.  If the application was started as a + starpack containing the Tablelist package, then the edit cursor will be + loaded from a copy of this file, created automatically by Tablelist in + the user's Temp directory.  The file + pencil.cur is a copy of the file  Ubuntu + Handwriting.cur,  downloaded from the address

+ +
+
+ http://www.rw-designer.com/cursor-detail/46922 +
+
+ +

REMARK:  If showing the edit cursor per default + whenever a click with mouse button 1 would start the editing is not + what you prefer, you can override the default for all tablelist + instances by inserting the line

+ +
+
+option add *Tablelist.showEditCursor 0
+
+
+ +

somewhere at the beginning of your script (before creating any + tablelist widgets).

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -showhorizseparator
Database Name: showHorizSeparator
Database Class: ShowHorizSeparator
+ +
+

Specifies a boolean value that controls whether to place a + horizontal separator just below the last row if the value of the + -showseparators + option is true, that of the -fullseparators option is false, and + there is free space left between the last row and the bottom of the + tablelist window.  The default value is 1.

+ +

REMARK:  If showing the horizontal separator per default + under the above-mentioned circumstancies is not what you prefer, you + can override the default for all tablelist instances by inserting the + line

+ +
+
+option add *Tablelist.showHorizSeparator 0
+
+
+ +

somewhere at the beginning of your script (before creating any + tablelist widgets).

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -showlabels
Database Name: showLabels
Database Class: ShowLabels
+ +
+

Specifies a boolean value that determines whether the header labels + are to be shown or not.  The default value is 1.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -showseparators
Database Name: showSeparators
Database Class: ShowSeparators
+ +
+

Specifies a boolean value that determines whether the columns are to + be separated with borders.  The default value is + 0.  The separators are implemented as thin frames + with sunken relief in the package Tablelist, and as tile separator + widgets in the package Tablelist_tile.  They are attached to the + right edges of the header labels, and are only created if the value of + this option is true.  In this case, a horizontal separator will + also be created and placed just below the last row, provided that the + value of the -showhorizseparator option is + true, that of the -fullseparators option is false, and + there is free space left between the last row and the bottom of the + tablelist window.

+ +

REMARK:  Tablelist doesn't support horizontal separators + (except for the one mentioned above and another one placed just below + the last header row), but a nice distinguishing effect for the rows in + the widget's body can be achieved with the aid of the -stripebackground option described + below.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -snipstring
Database Name: snipString
Database Class: SnipString
+ +
+

Specifies the string to be used as snip indicator when displaying + the elements that don't fit into their cells.  The default is an + ellipsis ("...").

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -sortcommand
Database Name: sortCommand
Database Class: SortCommand
+ +
+

Specifies a command to be used for the comparison of the items when + invoking the sort subcommand of + the Tcl command associated with the tablelist widget.  To compare + two items (viewed as lists of cell contents within one row each) during + the sort operation, the command is automatically + concatenated with the two items and the resulting script is + evaluated.  The script should return an integer less than, equal + to, or greater than zero if the first item is to be considered less + than, equal to, or greater than the second, respectively.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -spacing
Database Name: spacing
Database Class: Spacing
+ +
+

Specifies additional space to provide above and below each row of + the widget, in both the body and the header.  The option's value + may have any of the standard forms for screen distances.  It + defaults to 0.  See also the -tight option.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -state
Database Name: state
Database Class: State
+ +
+

Specifies one of two states for the tablelist widget: + normal or disabled.  If + the widget is disabled then neither items nor columns may be inserted, + deleted, updated, or moved, the items, header labels, and the up- or + down-arrow are drawn in the -disabledforeground, -labeldisabledforeground, and + -arrowdisabledcolor color, + respectively, the selection cannot be modified and is not shown + (although the selection information is retained), the header labels are + completely insensitive, and no interactive cell editing can be + performed.  In addition, in disabled state any color options + specified at column, row, or cell level will be ignored.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -stretch
Database Name: stretch
Database Class: Stretch
+ +
+

Specifies the stretchable columns, i.e., the columns to be + stretched in order to fill the tablelist window if necessary.  The + option's value may be all or a list of column + indices in any of the forms described in the COLUMN INDICES section below.  In the second + case, the specified column indices are replaced with their numerical + equivalents, except for end and + last, which are viewed as dynamic column indices + whose numerical equivalent (i.e., the index of the tablelist's last + column) might change during program execution and therefore will be + recomputed every time the columns are stretched.  The list will be + updated automatically whenever columns are inserted, deleted, or + moved.  The number of pixels by which a column is stretched is + proportional to its width in pixels.  The default value of this + option is an empty list, meaning that no column will be stretched to + eliminate the blank space that might appear at the right of the + table.  (Note that the blank space following the header labels is + filled with a dummy, insensitive label having the same background, + borderwidth, and relief as the "normal" header labels.)

+ +

REMARK:  If the value of the -width configuration option is zero or less and + the tablelist has stretchable columns, then the + -setgrid option will be ignored.  This minor + restriction has technical reasons and is only relevant on X11.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -stripebackground or + -stripebg
Database Name: stripeBackground
Database Class: Background
+ +
+

Specifies the background color to use when displaying the body items + belonging to a stripe.  Each stripe is composed of the same number + stripeHeight of consecutive viewable items, according to the value of the + -stripeheight + configuration option.  The first stripeHeight + viewable items are "normal" ones; they are followed by a stripe + composed of the next stripeHeight viewable items, + which in turn is followed by the same number of "normal" viewable + items, and so on.  In the Tablelist package and in most themes + supported by Tablelist_tile, the default value is an empty string, + indicating that the stripes will inherit the background color specified + by the -background + configuration option.  When using Tablelist_tile with the + tileqt theme then the default value is given by the + global KDE option alternateBackground, which in + turn depends on the current color scheme.  In this case it is + recommended to either keep that default value retrieved from KDE, or to + use an explicitly specified empty string if no stripes are to be + displayed.  The -stripebackground option has a + higher priority than the -background column + configuration option, but a lower priority than the + -background option specified at row or cell + level.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -stripeforeground or + -stripefg
Database Name: stripeForeground
Database Class: Foreground
+ +
+

Specifies the foreground color to use when displaying the body items + belonging to a stripe.  Each stripe is composed of the same number + stripeHeight of consecutive viewable items, according to the value of the + -stripeheight + configuration option.  The first stripeHeight + viewable items are "normal" ones; they are followed by a stripe + composed of the next stripeHeight viewable items, + which in turn is followed by the same number of "normal" viewable + items, and so on.  The default value is an empty string, + indicating that the stripes will inherit the foreground color specified + by the -foreground + configuration option.  The -stripeforeground + option has a higher priority than the -foreground + column configuration option, but a lower priority than the + -foreground option specified at row or cell + level.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -stripeheight
Database Name: stripeHeight
Database Class: StripeHeight
+ +
+

Specifies the number of items in each stripe.  If zero or less + then no stripes are displayed.  The default is 1.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -takefocus
Database Name: takeFocus
Database Class: TakeFocus
+ +
+

This option determines whether the widget accepts the focus during + keyboard traversal.  It is almost identical to the standard option + of the same name (see the options manual entry for + details).  The only difference is that not the widget itself but + its body child will receive the focus during keyboard traversal with + the standard keys (Tab and Shift-Tab).

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -targetcolor
Database Name: targetColor
Database Class: TargetColor
+ +
+

Specifies the color of the gap displayed in the tablelist's body or + header label area to indicate the target position when moving a row or + column interactively.  The target indicator belonging to the + tablelist's body can also be displayed explicitly with the aid of the + showtargetmark + subcommand, and its path name can be retrieved via targetmarkpath.  The default + value is black.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -tight
Database Name: tight
Database Class: Tight
+ +
+

Specifies a boolean value that determines whether to eliminate the + one-pixel additional space left below each tablelist row for Tk listbox + compatibility, in both the body and the header.  The default value + is 0, which draws a one-pixel additional space below each + row, just like a Tk core listbox.

+ +

REMARK:  You can set this option to true and at the same + time provide additional space above and below each row with the aid of + the -spacing configuratiom + option.  As a result, the space below each row will be the same as + above the row (and not one pixel higher).

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -titlecolumns
Database Name: titleColumns
Database Class: TitleColumns
+ +
+

Specifies the number of the non-scrollable columns at the left edge + of the window, also called title columns.  The positions of + these columns will not change when adjusting the horizontal view by + invoking the scan, + seecell, seecolumn, or xview subcommand.  The default value is + 0.  The value of this option also determines the + scrolling unit used by the commands mentioned above when shifting the + horizontal view: if it is positive then the horizontal scrolling is + performed column-wise, otherwise by character units (the width of the + 0 character).

+ +

The end of the title column area is visualized with the aid of a + separator, attached to the right edge of the header label corresponding + to the last non-hidden title column.  This special separator is + always displayed to mark the end of the title columns (if any), + independently of the value of the -showseparators option.  The user + can easily distinguish it from the other separators by means of its + background color, which is different from that of the other + separators.

+ +

For technical reasons (the use of the -elide + option for a text widget tag), this option is not supported for Tk + versions earlier than 8.3.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -tooltipaddcommand
Database Name: tooltipAddCommand
Database Class: TooltipAddCommand
+ +
+

Specifies a Tcl command to be used for displaying cell- and column + label-specific balloon help.  When the mouse pointer enters a cell + in the tablelist's body, the command is automatically concatenated with + the path name of the tablelist widget and the cell's row and column + indices, and the resulting script is evaluated in the global + scope.  Similarly, when the mouse pointer enters a header label, + the command is automatically concatenated with the path name of the + tablelist widget, the number -1, and the column index of + the respective label, and the resulting script is evaluated in the + global scope.  Finally, when the mouse pointer enters a cell in + the tablelist's header, the command is automatically concatenated with + the path name of the tablelist widget, the header cell's row index + prefixed by the letter h, as well as the cell's + column index, and the resulting script is evaluated in the global + scope.  In all three cases, the action described above is only + triggered if both the value of this option and that of + -tooltipdelcommand + are nonempty strings.

+ +

For example, consider the procedure tooltipAddCmd shown + below, which makes use of the DynamicHelp::add + command from the BWidget package to display the full cell and label + texts as tooltips for the cells and header labels with snipped + contents.

+ +
+
+proc tooltipAddCmd {tbl row col} {
+    if {($row >= 0 && [$tbl iselemsnipped $row,$col fullText]) ||
+        ($row <  0 && [$tbl istitlesnipped $col fullText])} {
+        DynamicHelp::add $tbl -text $fullText
+    }
+}
+
+
+ +

If the widget can also contain header items then a slightly more + complicated procedure is needed:

+ +
+
+proc tooltipAddCmd {tbl row col} {
+    if {[string is integer $row]} {
+        if {($row >= 0 && [$tbl iselemsnipped $row,$col fullText]) ||
+            ($row <  0 && [$tbl istitlesnipped $col fullText])} {
+            DynamicHelp::add $tbl -text $fullText
+        }
+    } else {
+        set row [string range $row 1 end]
+        if {[$tbl header iselemsnipped $row,$col fullText]} {
+            DynamicHelp::add $tbl -text $fullText
+        }
+    }
+}
+
+
+ +

A tablelist widget can use this procedure by specifying

+ +
+
+... -tooltipaddcommand tooltipAddCmd -tooltipdelcommand DynamicHelp::delete
+
+
+ +

If you prefer to use the tooltip::tooltip + command from the tooltip package contained in tklib then the procedure + becomes

+ +
+
+proc tooltipAddCmd {tbl row col} {
+    if {($row >= 0 && [$tbl iselemsnipped $row,$col fullText]) ||
+        ($row <  0 && [$tbl istitlesnipped $col fullText])} {
+        tooltip::tooltip $tbl $fullText
+    }
+}
+
+
+ +

or, to cover also the case of header items:

+ +
+
+proc tooltipAddCmd {tbl row col} {
+    if {[string is integer $row]} {
+        if {($row >= 0 && [$tbl iselemsnipped $row,$col fullText]) ||
+            ($row <  0 && [$tbl istitlesnipped $col fullText])} {
+            tooltip::tooltip $tbl $fullText
+        }
+    } else {
+        set row [string range $row 1 end]
+        if {[$tbl header iselemsnipped $row,$col fullText]} {
+            tooltip::tooltip $tbl $fullText
+        }
+    }
+}
+
+
+ +

and can be used by specifying

+ +
+
+... -tooltipaddcommand tooltipAddCmd -tooltipdelcommand "tooltip::tooltip clear"
+
+
+ +

Please note that in the less common case that the name of your + tablelist widget contains spaces, the  tooltip::tooltip + clear  command won't work as expected.  As a + workaround you can use the slightly modified approach shown below:

+ +
+
+proc tooltipDelCmd tbl { tooltip::tooltip $tbl "" }
+
+... -tooltipaddcommand tooltipAddCmd -tooltipdelcommand tooltipDelCmd
+
+
+ +

Both examples above make use of the iselemsnippedheader iselemsnipped,  and + istitlesnipped + subcommands, to make sure that the full cell and label texts will only + be displayed for those cells and header labels whose contents are + snipped.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -tooltipdelcommand
Database Name: tooltipDelCommand
Database Class: TooltipDelCommand
+ +
+

Specifies a Tcl command to be used for removing the cell- or column + label-specific balloon help.  When the mouse pointer leaves a cell + or a header label, the command specified by this option is + automatically concatenated with the path name of the tablelist widget + and the resulting script is evaluated in the global scope.  This + action is only triggered if both the value of this option and that of + -tooltipaddcommand + are nonempty strings.  Common values for this option are + "DynamicHelp::delete" (which requires the BWidget package) + and  "tooltip::tooltip clear"  (which requires + the tooltip package contained in tklib).  Their usage is shown in + the examples above.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -treecolumn
Database Name: treeColumn
Database Class: TreeColumn
+ +
+

Specifies the column to contain the indentations and expand/collapse + controls in the body of a tablelist used as a tree widget.  The + option's value may be a column index in any of the forms described in + the COLUMN INDICES section below.  The + specified column index is replaced with its numerical equivalent, and + it will be updated automatically whenever columns are inserted, + deleted, or moved.  The default value is 0.

+ +

For technical reasons (the use of the -elide + text widget tag option for collapsing a row), this option is not + supported for Tk versions earlier than 8.3.

+ +

REMARK:  Please note that the tree structure will only + be displayed as expected if the column specified by this option is + left-aligned.  It is your responsibility to make sure that this + restriction is fulfilled when using a tablelist as a tree widget.

+
+
+ +
+ + + + + + + + + + + + + + + + +
Command-Line Name: -treestyle
Database Name: treeStyle
Database Class: TreeStyle
+ +
+

Specifies the look & feel of the column containing the indentations + and expand/collapse controls in the body of a a tablelist used as a + tree widget.  This includes, among others, the images used for + displaying the expand/collapse controls, the indentation width, and + whether expand/collapse controls and indentations are to be protected + when selecting a row or cell.  The currently supported values are + shown at a glance in the two tables below:

+ +

Tree styles for native look & feel:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gtkadwaitablueMentaubuntuubuntu2ubuntu3
gtkadwaitablueMentaubuntuubuntu2ubuntu3
mintmint2matementaubuntuMateyuyo
mintmint2matementaubuntuMateyuyo
arcoxygen1oxygen2klearlooksbaghiraphase
arcoxygen1oxygen2klearlooksbaghiraphase
plastiqueplastikwinnativewinxpBluewinxpOlivewinxpSilver
plastiqueplastikwinnativewinxpBluewinxpOlivewinxpSilver
aquavistaAerovistaClassicwin7Aerowin7Classicwin110
aquavistaAerovistaClassicwin7Aerowin7Classicwin10
ambiancedustdustSandradiancenewWave.png
ambiancedustdustSandradiancenewWave
+ +

The sizes used by the tree styles vistaAero, + vistaClassic, win7Aero, + win7Classic, and win10 are + automatically adapted to the display's scaling level.  + Platform-independent manual scaling is supported by the + following tree styles:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
100 %125 %150 %200 %
plain1plain2plain3plain4
plain1plain2plain3plain4
bicolor1bicolor2bicolor3bicolor4
bicolor1bicolor2bicolor3bicolor4
classic1classic2classic3classic4
classic1classic2classic3classic4
+ +

If the tree style is gtk, + adwaita, blueMenta, + ubuntu, ubuntu2, + ubuntu3, mint, + mint2, mate, + menta, ubuntuMate, + arc, oxygen2, + aqua, vistaAero, + win7Aero, win10, + newWave, plain*, or + bicolor*, and the Tk version is either 8.6 (with + built-in PNG support) or 8.5 and the img::png + package can be loaded into the interpreter, then the images used for + displaying the expand/collapse controls are PNG images with alpha + channel.  Otherwise (i.e., for the other tree styles or in the + absence of PNG support) GIF images are used for the expand/collapse + controls.

+ +

The following table contains a detailed description of the tree + styles, in alphabetical order:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueScreenshotComments
adwaitaadwaitaInspired by the GTK 3 theme Adwaita.
ambianceambianceInspired by the GTK 2 theme Ambiance.  Recommended to be + used with large fonts and images.
aquaaqua + + + + + + + + + + +
Tablelist: Default for the windowing systems + aqua and + classic.
Tablelist_tile: Default for the themes aqua and + Aquativo.
+
arcarcInspired by the Arc icon theme (of the GTK 2/3 theme Arc).
baghirabaghira + + + + + +
Tablelist_tile: Default for the Qt styles baghira, + cde, and motif within + the tileqt theme.  Also used by some + flavors of qtcurve.
+
bicolor1,
+ . . .
+ bicolor4
bicolor1While the tree style bicolor1 uses "normal" + sizes, the three other styles are suitable for use with large fonts + and images (needed on high-resolution displays).
classic1,
+ . . .
+ classic4
classic1While the tree style classic1 uses "normal" + sizes, the three other styles are suitable for use with large fonts + and images (needed on high-resolution displays).
blueMentablueMentaInspired by the GTK 3 theme BlueMenta of versions 1.14 and + later of the MATE desktop.
dustdustInspired by the GTK 2 theme Dust.  Recommended to be used + with large fonts and images.
dustdustInspired by the GTK 2 theme Dust.  Recommended to be used + with large fonts and images.
dustSanddustSandInspired by the GTK 2 theme Dust Sand.  Recommended to be + used with large fonts and images.
gtkgtk + + + + + + + + + + +
Tablelist: Default for the windowing system + x11.
Tablelist_tile: Default for the themes blue, + clam, classic, + default, kroc, + sriv, srivlg, and + step, as well as for the Qt style + gtk+ within the + tileqt theme.
+
klearlooksklearlooks + Inspired by the KDE 4 style Klearlooks.
+ + + + + + +
Tablelist_tile: Default for the Qt style qtcurve + within the tileqt theme.
+
matemateInspired by a few GTK 2 themes of versions earlier than 1.14 of + the MATE desktop.
mentamentaInspired by the GTK 3 theme Menta of versions 1.14 and later of + the MATE desktop.
mintmintInspired by a few GTK 3 themes bundled with versions earlier + than 18 of the Linux Mint distribution.
mint2mintInspired by a few GTK 3 themes bundled with versions 18 and + later of the Linux Mint distribution.
newWavenewWaveInspired by the GTK 2 theme New Wave.  Recommended to be + used with large fonts and images.
oxygen1oxygen1Inspired by the KDE 4 style Oxygen.
oxygen2oxygen2 + + + + + +
Tablelist_tile: Default for the Qt style oxygen + within the tileqt theme.
+
phasephase + + + + + +
Tablelist_tile: Default for the Qt style phase within + the tileqt theme.
+
plain1,
+ . . .
+ plain4
plain1While the tree style plain1 uses "normal" + sizes, the three other styles are suitable for use with large fonts + and images (needed on high-resolution displays).
plastikplastik + + + + + +
Tablelist_tile: Default for the plastik theme and the + Qt style plastik within the + tileqt theme.
+
plastiqueplastique + + + + + +
Tablelist_tile: Default for the Qt style plastique + within the tileqt theme.
+
radianceradianceInspired by the GTK 2 theme Radiance.  Recommended to be + used with large fonts and images.
ubuntuubuntuInspired by a couple of GTK 3 themes bundled with versions + earlier than 15.04 of the Ubuntu Linux distribution.
ubuntu2ubuntu2Inspired by a couple of GTK 3 themes bundled with versions + 15.04 – 16.04 of the Ubuntu Linux distribution.
ubuntu3ubuntu3Inspired by a couple of GTK 3 themes bundled with versions + 16.10 and later of the Ubuntu Linux distribution.
ubuntuMateubuntuMateInspired by the themes Ambiant-MATE and Radiant-MATE bundled + with versions 16.10 and later of the Ubuntu MATE distribution.
vistaAerovistaAero + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows Vista.
Tablelist_tile: Default for the vista theme on + Windows Vista with the Aero style.
+
vistaClassicvistaClassic + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows Vista with the Windows + Classic style.
Tablelist_tile: Default for the vista theme on + Windows Vista with the Windows Classic style.
+
win7Aerowin7Aero + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows 7 and 8.
Tablelist_tile: Default for the vista theme on + Windows 7 and 8, with the Aero style.
+
win7Classicwin7Classic + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows 7 and 8 with the Windows + Classic style.
Tablelist_tile: Default for the vista theme on + Windows 7 and 8 with the Windows Classic style.
+
win10win10 + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows 10.
Tablelist_tile: Default for the vista theme on + Windows 10.
+
winnativewinnative + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows 2000 and Windows XP with + the Windows Classic style.
Tablelist_tile: Default for the themes alt, + keramik, keramik_alt, + winnative, and + xpnative with the Windows Classic style, + as well as for most Qt styles within the + tileqt theme.
+
winxpBluewinxpBlue + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows XP with the Blue color + scheme.
Tablelist_tile: Default for the winxpblue theme and + the xpnative theme on Windows XP with the + Blue color scheme.
+
winxpOlivewinxpOlive + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows XP with the Olive Green + color scheme.
Tablelist_tile: Default for the xpnative theme on + Windows XP with the Olive Green color scheme.
+
winxpSilverwinxpSilver + + + + + + + + + + +
Tablelist: Default for the windowing system + win32 on Windows XP with the Silver color + scheme.
Tablelist_tile: Default for the xpnative theme on + Windows XP with the Silver color scheme.
+
yuyoyuyoInspired by the GTK 2 theme Yuyo on Ubuntu MATE.
+ +

For technical reasons (the use of the -elide + text widget tag option for collapsing a row), this option is not + supported for Tk versions earlier than 8.3.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -width
Database Name: width
Database Class: Width
+ +
+

Specifies the desired width for the window, in average-size + characters of the widget's font.  If zero or less then the desired + width for the window is made just large enough to hold all the columns + in the tablelist widget.

+ +

REMARK:  If the value of this configuration option is + zero or less and the tablelist has stretchable + columns, then the -setgrid option will be + ignored.  This minor restriction has technical reasons and is only + relevant on X11.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -xmousewheelwindow
Database Name: xMouseWheelWindow
Database Class: MouseWheelWindow
+ +
+

This option is only relevant if the mouse wheel events are reported + to the widget under the pointer rather than to the one having the + focus.  This condition is fulfilled on X11 and Mac OS X, and for + Tk 8.6b2 and later on Windows, too (in earlier Tk versions the mouse + wheel events on Windows were sent to the widget having the focus).

+ +

The -xmousewheelwindow option specifies the path + name of the window to which the default bindings for the binding tags + TablelistBody and + TablelistEdit should + redirect the mouse wheel events along the x axis via  + event generate  if the focus window on the + display containing the tablelist widget is outside the tablelist.  + The default is an empty string, meaning that the mouse wheel events + along the x axis received by a widget having one of the two + above-mentioned binding tags will give rise to horizontal scrolling of + the tablelist or its edit window, regardless of whether the focus is + inside or outside the tablelist widget.

+ +

REMARK 1:  The mouse wheel events along the horizontal + axis are <Shift-MouseWheel> on Windows, + <Shift-MouseWheel> and + <Shift-Option-MouseWheel> on Mac OS X, and + <Shift-MouseWheel>, + <Shift-Button-4> and + <Shift-Button-5> on X11 (where + <Shift-MouseWheel> is not triggered by the X + server, but can be produced using  event + generate).  On X11, when using Tk 8.7a3 or later, there + are two more mouse wheel events along the horizontal axis: + <Button-6> and + <Button-7>, which are handled just like + <Shift-Button-4> and + <Shift-Button-5>, respectively.  These + events are commonly triggered by left/right tilting the scroll wheel of + a mouse having one or two additional (thumb) buttons.  (In Tk + versions 8.6.x, with x >= 10, left/right tilting the scroll wheel of + such a mouse gives rise to <Shift-MouseWheel> + events on Windows and Mac OS X Aqua, and to + <Shift-Button-4> and + <Shift-Button-5> events on X11.)

+ +

REMARK 2:  If the tablelist is contained in a scrollable + widget container like a scrollutil::scrollableframe, + BWidget ScrollableFrame, or iwidgets::scrolledframe, and you set this + option to the path name of that container window or that of the + containing toplevel widget, then a horizontal mouse wheel event over + the tablelist's body will be handled as follows:

+ +
    +
  • If the focus is inside the tablelist widget then the + event will scroll the tablelist or its edit window horizontally and + no further processing of the event will take place.
  • + +
  • If the focus is outside the tablelist widget then no + scrolling of the tablelist's body or edit window will happen.  + Instead, the event will be redirected to the widget container or the + toplevel widget with the aid of the  event + generate  command.  This in turn will give rise + to horizontal scrolling of the widget container, provided that the + containing toplevel widget or the binding tag all + has the necessary mouse wheel event bindings.
  • +
+ +

REMARK 3:  If you pass the tablelist widget to the + scrollutil::adaptWheelEventHandling + command then the latter sets this option to the path name of the + containing toplevel window.

+
+
+ +
+ + + + + + + + + + + + + + + +
Command-Line Name: -ymousewheelwindow
Database Name: yMouseWheelWindow
Database Class: MouseWheelWindow
+ +
+

This option is only relevant if the mouse wheel events are reported + to the widget under the pointer rather than to the one having the + focus.  This condition is fulfilled on X11 and Mac OS X, and for + Tk 8.6b2 and later on Windows, too (in earlier Tk versions the mouse + wheel events on Windows were sent to the widget having the focus).

+ +

The -ymousewheelwindow option specifies the path + name of the window to which the default bindings for the binding tags + TablelistBody and + TablelistEdit should + redirect the mouse wheel events along the y axis via  + event generate  if the focus window on the + display containing the tablelist widget is outside the tablelist.  + The default is an empty string, meaning that the mouse wheel events + along the y axis received by a widget having one of the two + above-mentioned binding tags will give rise to vertical scrolling of + the tablelist or its edit window, regardless of whether the focus is + inside or outside the tablelist widget.

+ +

REMARK 1:  The mouse wheel events along the vertical + axis are <MouseWheel> on Windows, + <MouseWheel> and + <Option-MouseWheel> on Mac OS X, and + <MouseWheel>, + <Button-4> and + <Button-5> on X11 (where + <MouseWheel> is not triggered by the X + server, but can be produced using  event + generate).

+ +

REMARK 2:  If the tablelist is contained in a scrollable + widget container like a scrollutil::scrollableframe, + BWidget ScrollableFrame, or iwidgets::scrolledframe, and you set this + option to the path name of that container window or that of the + containing toplevel widget, then a vertical mouse wheel event over the + tablelist's body will be handled as follows:

+ +
    +
  • If the focus is inside the tablelist widget then the + event will scroll the tablelist or its edit window vertically and no + further processing of the event will take place.
  • + +
  • If the focus is outside the tablelist widget then no + scrolling of the tablelist's body or edit window will happen.  + Instead, the event will be redirected to the widget container or the + toplevel widget with the aid of the  event + generate  command.  This in turn will give rise + to vertical scrolling of the widget container, provided that the + containing toplevel widget or the binding tag all + has the necessary mouse wheel event bindings.
  • +
+ +

REMARK 3:  If you pass the tablelist widget to the + scrollutil::adaptWheelEventHandling + command then the latter sets this option to the path name of the + containing toplevel window.

+
+
+ +
COLUMN CONFIGURATION OPTIONS
+ +
The following options are currently supported by the columncget, columnconfigure, configcolumnlist, and configcolumns commands:
+ +
+
+
-align + alignment
+ +
Specifies how to align the body and header elements of the + column.  It must be one of left, + right, or center.  This + option also refers to the column's title if the -labelalign option hasn't been + specified for the given column, or if its value is an empty + string.  The -align option is tied to the + alignment element corresponding to this column in + the list specifying the value of the -columns option for the tablelist widget; + changes in either will automatically be reflected in the other.
+ +
-background + color or -bg color
+ +
Specifies the normal background color to use when displaying the + content of the column in both the body and the header.
+ +
-changesnipside + boolean
+ +
Specifies whether to override the alignment-specific default + position of the snip indicator when + displaying the body and header elements of the column (excluding its + title).  The default value is 0, meaning that the + snip string will be appended to the elements if the column's alignment + is left or center and prepended + to them in case the alignment is right.
+ +
+ -changetitlesnipside boolean
+ +
Specifies whether to override the alignment-specific default + position of the snip indicator when + displaying the column's title.  The default value is + 0, meaning that the snip string will be appended to the + title if the column's alignment is left or + center and prepended to it in case the alignment is + right.
+ +
-editable + boolean
+ +
Specifies whether the elements of the column in the tablelist's + body can be edited interactively.  The default value is + 0.  The value of this option can be overridden for + individual cells by using the cell + configuration option of the same name.
+ +
REMARK:  The support for interactive editing + is restricted to the widget's body component
+ +
-editwindow + name
+ +
Specifies the type of the temporary embedded widget to be used for + interactive editing of the contents of the given column's body + cells.  name may be one of + entry (which is the default), + text, spinbox (the latter for + Tk versions 8.4 or higher), checkbutton, + menubutton, ttk::entry, + ttk::spinbox, ttk::combobox, + ttk::checkbutton, or + ttk::menubutton (the latter five only in the + presence of the tile widget engine), or the value returned by one of + the registration commands for widgets from the packages BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry (or Mentry_tile).  For example, + you can use  -editwindow ComboBox  + after registering the ComboBox widget for interactive cell + editing with the aid of the tablelist::addBWidgetComboBox + command.  Similarly, you can use  -editwindow + combobox  after registering Bryan Oakley's + combobox widget for interactive cell editing by invoking the + tablelist::addOakleyCombobox + command.  The value of this option can be overridden for + individual cells by using the cell + configuration option of the same name.
+ +
-font font
+ +
Specifies the font to use when displaying the content of the column + in both the body and the header.
+ +
-foreground + color or -fg color
+ +
Specifies the normal foreground color to use when displaying the + content of the column in both the body and the header.
+ +
-formatcommand + command
+ +
Specifies a Tcl command to be invoked when displaying the content + of a body or header cell within this column or adding a body cell's + content to the selection when the latter is being exported.  If + command is a nonempty string then it is + automatically concatenated with the cell's text, the resulting script + is evaluated in the global scope, and the return value is displayed in + the cell or added to the selection instead of the original data.
+ +
For example, if a time value in seconds is being + inserted into the cell and command is the procedure + formatDate defined as
+ +
+
+
+proc formatDate clockVal {
+    return [clock format $clockVal -format "%Y-%m-%d"]
+}
+
+
+
+ +
then the text displayed in the cell will be the date in the + specified format, not the time value in seconds.
+ +
This option is also used by Tablelist when building the + return values of the getformatted, getformattedcolumns, and + getformattedcells + subcommands, as well as their header-related counterparts, or searching + for a text pattern passed to the searchcolumn subcommand with the + -formatted option.  All the other subcommands, + notably get, getcolumns, getcells, rowcget, along with their counterparts for + the header, columncget, + cellcget, along with the + latter's header-related counterpart, sort, sortbycolumn, sortbycolumnlist, and + refreshsorting + operate on the original cell text, which is contained in the widget's + internal list.  In the case of the above example, this will make + it possible to sort the items quite easily by time, with a second's + precision, even if their visual representation only contains the year, + month, and day.
+ +
The -formatcommand option comes in + handy if only images or embedded windows are to be displayed in a + column but the texts associated with the cells may not simply be empty + strings because they are needed for other purposes (like sorting or + editing).  In such cases, a procedure returning an empty string + can be used as the option's value, thus making sure that the textual + information contained in that column remains hidden:
+ +
+
+
+proc emptyStr val { return "" }
+
+
+
+ +
Another important use case is related to tablelist columns whose + -sortmode option was + set to integer or real.  + If some of the cells of such a column are empty then an attempt to sort + the items by that column via sortbycolumn or sortbycolumnlist would generate an + error, because the  lsort -integer  + or  lsort -real  invocation made by + Tablelist would complain about getting an unexpected empty string + instead of an integer or floating-point number.  To avoid this, + make sure that the cells intended to display an empty string have as + internal value a number that is either strictly less or strictly + greater than all the other integer or real numbers contained in the + column in question, and use the -formatcommand + option to control what will be displayed in the column's cells.  + For example, if all the elements of the column are non-negative values + then you can use the number -1 as internal value for the + cells that should display an empty string, and set the value of the + -formatcommand option to formatNumber, + where formatNumber is the procedure implemented as + follows:
+ +
+
+
+proc formatNumber val { return [expr {$val == -1 ? "" : $val}] }
+
+
+
+ +
This will make the cells displaying an empty string appear before + all the others when sorting the column in increasing order.  To + achieve the opposite effect, you will have to replace the + -1 with an application-specific value that is strictly + greater than all the other numbers contained in the column in + question.
+ +
The demo scripts included in the Tablelist distribution + contain further examples demonstrating the use of this option.  + The most interesting ones are also described in Tablelist Programmer's Guide.
+ +
In the more sophisticated case that the result of the + formatting should also depend on the cell's row, you will have to + invoke the formatinfo + subcommand, which provides the necessary information about the cell + whose content is being formatted.
+ +
Due to the + -formatcommand column configuration option, we will + distinguish between the internal value of a tablelist element and its + formatted version.  The latter is the result of the + invocation of the script corresponding to the + -formatcommand option of the element's column, or + the element itself if this option was not set for that column.  + Consequently, the formatted version of a tablelist item is a list + comprised of the formatted elements of the original item.
+ +
-hide + boolean
+ +
Specifies whether to hide the column when displaying the widget or + exporting its selection.  The default value is + 0.  After toggling the hidden state of a column, the + <<TablelistColHiddenStateChanged>> + virtual event is generated, with its -data option + set to the numerical column index for Tk versions 8.5 and higher.
+ +
-labelalign + alignment
+ +
Specifies how to align the column's title.  It must be one of + left, right, or + center, or an empty string.  If this option + hasn't been specified for the given column, or if its value is an empty + string, then the header title will have the same alignment as the + elements of the column, as given by the -align column configuration option or by + the alignment element corresponding to this column + in the list specifying the value of the -columns global option.
+ +
-labelbackground + color or -labelbg color
+ -labelborderwidth screenDistance or + -labelbd screenDistance
+ -labelcommand command
+ -labelcommand2 command
+ -labelfont fontName
+ -labelforeground color or + -labelfg color
+ -labelheight lines
+ -labelpady screenDistance
+ -labelrelief relief
+ -selectfiltercommand command
+ +
The value of each of these options may also be an empty + string.  These options are the column-specific equivalents of the + global ones having the same names, described in the WIDGET-SPECIFIC OPTIONS section.  They + override the options of the same names set at widget level if the + specified value is not empty.  If one of these options hasn't been + specified for the given column, or if its value is an empty string, + then that option will not be used at column level; the global option of + the same name will be used instead.  The -labelactivebackground, + -labelactiveforeground, and + -labeldisabledforeground + options are only defined at widget level; there are no column + configuration options with these names.  The + -labelbackground and + -labelheight options are only supported by the + Tablelist package, but not by Tablelist_tile.
+ +
-labelimage + image
+ +
Specifies the name of the Tk image to be displayed in the header + label.  image must be the result of an + invocation of the  image create  command, + or an empty string, specifying that no image is to be displayed.  + If the label's text is right-aligned then the image will be displayed + to the right of the text, otherwise to its left.  The text and the + image are separated from each other by a gap corresponding to the width + of a space character in the given label's font.
+ +
-labelvalign + verticalAlignment
+ +
Specifies the vertical alignment of the Tk image (if any) displayed + in the header label.  The verticalAlignment + must be one of center (which is the default), + top, or bottom.  + Especially if the label contains a multi-line text, the image is often + not as tall as the text; in such cases, this option enables you to + control the column-dependent vertical alignment of the image.
+ +
-maxwidth + width
+ +
width must be a number.  A positive value + specifies the column's maximum width in average-size characters of the + widget's font.  If width is negative, its + absolute value is interpreted as a maximum column width in + pixels.  Finally, a value of zero (which is the default) specifies + that the column's maximum width is to be made just large enough to hold + all the elements in the column, including its header.  This option + is only relevant if the given column has dynamic width, i.e., if its + width was set to 0.
+ +
-name name
+ +
Specifies a name associated with the column.  While the + numerical index of a column might change by inserting, deleting, or + moving columns, its name remains constant and can be used as a safe + alternative column index (see the COLUMN + INDICES section for details).  Similarly, it can also be used + as the second component of a body cell index of the form + row,col or a header cell index of the + form headerRow,col, as described in + the CELL INDICES and HEADER CELL INDICES sections.  To avoid + ambiguities, column names should be different from any other forms of + column indices (like numbers, active, + anchor, end, + last, left, + right, or any of their abbreviations).  They + should also be different from (any abbreviations of) the string + all, which may be specified as the value of the + -stretch configuration + option.  The default value is an empty string.
+ +
-resizable + boolean
+ +
Specifies whether the column can be resized interactively.  + See the DEFAULT AND INDIVIDUAL BINDINGS FOR + THE HEADER LABELS section for information on interactive column + resizing.  The default value is 1.  This option + is only relevant if the value of the -resizablecolumns widget + configuration option is true.
+ +
-selectbackground + color
+ +
Specifies the background color to use when displaying the content + of a body cell in the given column while the cell is selected.
+ +
-selectforeground + color
+ +
Specifies the foreground color to use when displaying the content + of a body cell in the given column while the cell is selected.
+ +
-showarrow + boolean
+ +
Specifies whether the sortbycolumn command with the given + column index as first argument and the sortbycolumnlist command having the + given column index as element of its first argument should place an + arrow indicating the sort order into the column's label.  The + default value is 1.  This option is only relevant if + the value of the -showarrow widget configuration option is + true.
+ +
-showlinenumbers + boolean
+ +
Specifies whether the body part of the given column should display + the line numbers (starting with 1 and ending with the number of the + non-hidden rows).  The default value is 0.
+ +
The following details assume that the given column's + -showlinenumbers option was set to true:  + Associating the line numbers with the non-hidden rows takes place + automatically whenever body items are inserted, deleted, updated, + moved, or sorted, or their -hide option is toggled.  For increased + efficiency, this is done at idle time.  For example, if several + items are inserted into or deleted from the body of a tablelist widget, + then the necessary renumbering of the non-hidden rows will be performed + as an idle callback, the next time the event loop is entered and there + are no events to process.  The line numbers will override any + previous contents of the column's cells.  They are, per default, + displayed without leading zeros, but this (and the display format in + general) can be changed with the aid of the -formatcommand column configuration + option.
+ +
The sortbycolumn and sortbycolumnlist subcommands as well + as the tablelist::sortByColumn + and tablelist::addToSortColumns + commands check the column indices passed to them as arguments and don't + perform any sorting by those columns that have been configured to + display the line numbers (see the corresponding descriptions for + details).
+ +
REMARK:  Please note that the line numbers + refer to the non-hidden rows, which in case of a tablelist used + as a tree widget might be different from the viewable ones.  Consequently, collapsing a row + will, in general, not lead to renumbering the lines (instead, it will + just elide the corresponding range of line numbers).
+ +
-sortcommand + command
+ +
This option is only relevant if the value of the -sortmode option for the given column is + command.  It specifies a command to be used + for the comparison of the column's elements when invoking the + sortbycolumn command + with the given column index as first argument or the sortbycolumnlist command having the + given column index as element of its first argument.  To compare + two elements during the sortbycolumn or + sortbycolumnlist operation, + command is automatically concatenated with the two + elements and the resulting script is evaluated.  The script should + return an integer less than, equal to, or greater than zero if the + first element is to be considered less than, equal to, or greater than + the second, respectively.
+ +
-sortmode + mode
+ +
Specifies how to compare the column's elements when invoking the + sortbycolumn command + with the given column index as first argument or the sortbycolumnlist command having the + given column index as element of its first argument.  + mode may have any of the following values:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
asciiUse string comparison with Unicode code-point collation order + (the name is for backward-compatibility reasons).  This is + the default.
asciinocase  This is the same as ascii, except that + comparisons are handled in a case-insensitive manner.
commandUse the command specified by the -sortcommand column + configuration option to compare the column's elements.
dictionaryUse dictionary-style comparison.  This is the same as + ascii, except: (a) case is ignored except as + a tie-breaker; (b) if two strings contain embedded numbers, the + numbers compare as integers, not characters.  For example, + bigBoy sorts between bigbang and + bigboy, and x10y sorts between + x9y and x11y.
integerConvert the elements to integers and use integer + comparison.  If any of the elements cannot be converted to + an integer (e.g., because it is an empty string) then a sort + attempt will generate an error.  See the description of the + -formatcommand option for the + recommended way to avoid this problem.
realConvert the elements to floating-point values and use + floating-point comparison.  If any of the elements cannot be + converted to a floating-point value (e.g., because it is an empty + string) then a sort attempt will generate an error.  See the + description of the -formatcommand option for the + recommended way to avoid this problem.
+
+ +
-stretchable + boolean
+ +
Specifies whether the column is to be stretched in order to fill + the tablelist window if necessary.  The value of this option is + tied to that of the -stretch + option for the tablelist widget; changes in either will automatically + be reflected in the other.
+ +
-stripebackground + color
+ +
Specifies the background color to use when displaying the content + of a body cell in the given column if the cell's row belongs to a + stripe.
+ +
-stripeforeground + color
+ +
Specifies the foreground color to use when displaying the content + of a body cell in the given column if the cell's row belongs to a + stripe.
+ +
-text list
+ +
Specifies a list of strings to be displayed in the body cells of + the given column, i.e., updates the elements contained in the column's + body part.  If the tablelist's state is disabled then this + option will be ignored.
+ +
-title + title
+ +
Specifies the text to be displayed in the column's header + label.  This option is tied to the title + element corresponding to the given column in the list specifying the + value of the -columns option + for the tablelist widget; changes in either will automatically be + reflected in the other.
+ +
-valign + verticalAlignment
+ +
Specifies the vertical alignment of embedded images and windows + displayed in the given column.  The + verticalAlignment must be one of + center (which is the default), + top, or bottom.  + Especially in rows containing multi-line elements, embedded images or + windows are often not as tall as the rows themselves; in such cases, + this option enables you to control the column-dependent vertical + alignment of these embedded objects.  The value of this option can + be overridden for individual cells by using the cell configuration option of the same name.
+ +
-width + width
+ +
width must be a number.  A positive value + specifies the column's width in average-size characters of the widget's + font.  If width is negative, its absolute + value is interpreted as a column width in pixels.  Finally, a + value of zero specifies that the column's width is to be made just + large enough to hold all the elements in the column, including its + header (but no larger than the maximum width indicated by the + -maxwidth column + configuration option).  This option is tied to the + width element corresponding to the given column in + the list specifying the value of the -columns option for the tablelist widget; + changes in either will automatically be reflected in the other.
+ +
-wrap + boolean
+ +
Specifies whether to display those body and header elements of the + given column that don't fit into their cells in word-wrapped multi-line + rather than snipped form.  The default value is + 0.  If the specified column has static width or a + nonzero -maxwidth value + and the value of this option is true, then elements of the column that + are too long to be displayed in a single line will be broken up into + several lines.  The same applies to the individual lines of the + multi-line elements (i.e., elements containing newline characters): + they will also be wrapped if necessary, thus giving rise to additional + line breaks.  In both cases, the line breaks are chosen at word + boundaries wherever possible, and they are only used for the external + representation of the strings contained in the given column, without + affecting the internal contents of the cells.
+
+
+ +
The -background, + -font, -foreground, + -selectbackground, + -selectforeground, + -stripebackground, and + -stripeforeground column configuration options override + the options of the same names set at widget level (but not the ones set at + cell or row level) if the specified value is not an empty string.  See + the COLORS AND FONTS section for further + details on these options.
+ +
ROW CONFIGURATION OPTIONS IN THE + TABLELIST BODY
+ +
The following options are currently supported by the rowcget, rowconfigure, configrowlist, and configrows commands:
+ +
+
+
-background + color or -bg color
+ +
Specifies the normal background color to use when displaying the + content of the row.
+ +
-font font
+ +
Specifies the font to use when displaying the content of the + row.
+ +
-foreground + color or -fg color
+ +
Specifies the normal foreground color to use when displaying the + content of the row.
+ +
-hide + boolean
+ +
Specifies whether to hide the row when displaying the widget or + exporting its selection.  The default value is + 0.  After toggling the hidden state of a row, the + <<TablelistRowHiddenStateChanged>> + virtual event is generated, with its -data option + set to the numerical row index for Tk versions 8.5 and higher.
+ +
For technical reasons (the use of the + -elide option for a text widget tag), this option + is not supported for Tk versions earlier than 8.3.
+ +
CAUTION:  Tk versions 8.3 - 8.4.12 had a bug + that caused a segmentation fault if the whole content of a text widget + was elided.  This bug was also present in Tk 8.5.a1 - + 8.5.a3.  When using one of these earlier Tk versions, this bug + will produce a crash if all the rows of a tablelist widget are + hidden.  It is your responsibility to avoid such situations when + using a Tk version having this bug!
+ +
-name name
+ +
Specifies a name associated with the row.  While the numerical + index of a row might change by inserting, deleting, or moving rows, or + by sorting the items, its name remains constant and can be used as a + safe alternative row index (see the ROW + INDICES section for details).  Similarly, it can also be used + as the first component of a cell index of the form + row,col, as described in the CELL INDICES section.  To avoid ambiguities, + row names should be different from any other forms of row indices (like + numbers, full keys, active, + anchor, end, + last, top, + bottom, or any of their abbreviations).  The + default value is an empty string.
+ +
-selectable + boolean
+ +
Specifies whether the elements displayed in the given row can be + selected.  The default value is 1.  If the value + 0 was given then any attempt to select the item contained + in this row with the aid of the  selection set  widget command or any + of its elements by using the  cellselection set  command will be + silently ignored; moreover, an existing old (cell) selection is removed + from the row.
+ +
-selectbackground + color
+ +
Specifies the background color to use when displaying the content + of a cell in the given row while the cell is selected.
+ +
-selectforeground + color
+ +
Specifies the foreground color to use when displaying the content + of a cell in the given row while the cell is selected.
+ +
-text list
+ +
Specifies a list of strings to be displayed in the cells of the + given row, i.e., updates the item contained in the row.  If the + tablelist's state is + disabled then this option will be ignored.
+
+
+ +
The -background, + -font, -foreground, + -selectbackground, and + -selectforeground row configuration options override + the options of the same names set at column or widget level (but not the + ones set at cell level) if the specified value is not an empty + string.  See the COLORS AND FONTS + section for further details on these options.
+ +
ROW CONFIGURATION OPTIONS IN THE + TABLELIST HEADER
+ +
The following options are currently supported by the  + header rowcget,  + header + rowconfigureheader configrowlist,  and  + header configrows  + commands:
+ +
+
+
-background + color or -bg color
+ +
Specifies the background color to use when displaying the content + of the header row.
+ +
-font + font
+ +
Specifies the font to use when displaying the content of the header + row.
+ +
-foreground + color or -fg color
+ +
Specifies the foreground color to use when displaying the content + of the header row.
+ +
-name + name
+ +
Specifies a name associated with the header row.  While the + numerical index of a header row might change by inserting or deleting + header rows, its name remains constant and can be used as a safe + alternative header row index (see the HEADER + ROW INDICES section for details).  Similarly, it can also be + used as the first component of a header cell index of the form + headerRow,col, as described in the + HEADER CELL INDICES section.  To + avoid ambiguities, header row names should be different from any other + forms of header row indices (like numbers, full keys, + end, last, or any of their + abbreviations).  The default value is an empty string.
+ +
-text + list
+ +
Specifies a list of strings to be displayed in the cells of the + given header row, i.e., updates the item contained in the header + row.  If the tablelist's state is disabled then this + option will be ignored.
+
+
+ +
The -background, + -font, and -foreground header row + configuration options override the options of the same names set at column + or widget level (but not the ones set at header cell level) if the + specified value is not an empty string.  See the COLORS AND FONTS section for further details on + these options.
+ +
CELL CONFIGURATION OPTIONS IN THE + TABLELIST BODY
+ +
The following options are currently supported by the cellcget, cellconfigure, configcelllist, and configcells commands:
+ +
+
+
-background + color or -bg color
+ +
Specifies the normal background color to use when displaying the + content of the cell.
+ +
-editable + boolean
+ +
Specifies whether the content of the cell can be edited + interactively.  The default value is 0.  This + option overrides the one of the same name + for the column containing the given cell.
+ +
-editwindow + name
+ +
Specifies the type of the temporary embedded widget to be used for + interactive editing of the cell's content.  The default value is + entry.  This option overrides the one of the same name for the column + containing the given cell, and may have the same values as its + column-related counterpart.
+ +
-font + font
+ +
Specifies the font to use when displaying the content of the + cell.
+ +
-foreground + color or -fg color
+ +
Specifies the normal foreground color to use when displaying the + content of the cell.
+ +
-image + image
+ +
Specifies the name of the Tk image to be displayed in the + cell.  image must be the result of an + invocation of the  image create  command, + or an empty string, specifying that no image is to be displayed.  + If the column containing the cell is right-aligned then the image will + be displayed to the right of the cell's text, otherwise to its + left.  The text and the image are separated from each other by a + gap of 4 pixels.  If for the same cell the -window option was specified with a + nonempty value then it overrides the -image + option.  If the tablelist's state is disabled then this + option will be ignored.
+ +
To display an image in a cell, Tablelist makes use of an + embedded label widget (which is created on demand).  This has the + main advantage of making it possible to adjust the width of the label + containing the image to fit into its column.  This has the visual + effect of cutting off part of the image from its right side.  The + above-mentioned gap to the left or right of the image is also part of + this label.  To make sure that an image with fully or partially + transparent background will be displayed correctly, the background + color of the label widget containing the embedded image is + automatically synchronized with the cell's background color whenever + necessary (e.g., when selecting or deselecting the cell's content, or + changing its background color), provided that the -imagebackground option was not + set or its value is an empty string.  This automatic color + synchronization makes also sure that the gap between the text and the + image is displayed in the right color.
+ +
-imagebackground + color
+ +
Specifies the background color of the label widget containing the + embedded image (if any).  If the value of this option is a valid + nonempty color specification then the fully transparent pixels of the + embedded image will appear in the specified color, and the partially + transparent ones will be shown modified according to their alpha + value and the image background color.  The default value is an + empty string, meaning that the background color of the label widget + containing the embedded image will be automatically updated whenever + necessary.
+ +
REMARK:  This option works fine if the + cell's text (or at least the latter's formatted version) is an empty string.  + Otherwise there will be a gap between the text and the image, and this + gap will appear in the specified image background color if the latter + is a nonempty string.
+ +
+ -selectbackground color
+ +
Specifies the background color to use when displaying the content + of the cell while it is selected.
+ +
+ -selectforeground color
+ +
Specifies the foreground color to use when displaying the content + of the cell while it is selected.
+ +
-stretchwindow + boolean
+ +
Specifies whether the width of the window embedded into the cell + shall be adapted dynamically to the width of the cell's column if the + latter is non-zero (i.e., static).  The default value is + 0.  If the value of this option is true and the + column was specified with a non-zero width or was resized + interactively, then the width of the embedded window (if any) will be + adjusted automatically so the window fills the whole horizontal space + belonging to that column (except the left and right margins).  + Please note that in this case the cell's text will remain hidden.  + On the other hand, if the column is of dynamic width then this option + will be ignored and both the cell's text and its embedded window (if + any) will be displayed as usual.  The easiest way to avoid this + discrepancy is to set the cell's text to an empty string or make sure + that the column's elements are always displayed as empty strings, by + using the -formatcommand column configuration + option.
+ +
-text + text
+ +
Specifies the string to be displayed in the given cell, i.e., + updates the element contained in the cell.  If the tablelist's + state is + disabled then this option will be ignored.
+ +
-valign + verticalAlignment
+ +
Specifies the vertical alignment of the embedded image or window + displayed in the cell (if any).  The default value is + center.  This option overrides the one of the same name for the column containing + the given cell, and may have the same values as its column-related + counterpart.
+ +
-window + command
+ +
Specifies a Tcl command creating the window to be embedded into the + cell.  The command is automatically concatenated with the path + name of the tablelist widget, the cell's row and column indices, as + well as the path name of the embedded window to be created, and the + resulting script is evaluated in the global scope.  + command may also be an empty string, specifying + that no embedded window is to be displayed.  If the column + containing the cell is right-aligned then the window will be displayed + to the right of the cell's text, otherwise to its left.  The text + and the window are separated from each other by a gap of 4 + pixels.  If this option was specified with a nonempty value then + it overrides the -image + cell configuration option.  If the tablelist's state is disabled then this + option will be ignored.
+ +
REMARK:  There are several situations where + the embedded window will be destroyed and later recreated by invoking + the script mentioned above.  For example, when changing the value + of some of the tablelist widget or column configuration options, + sorting the items, or moving a row or a column, the widget's content + will be redisplayed, which makes it necessary to recreate the embedded + windows.  This operation won't preserve the changes made on the + embedded windows after their creation.  For this reason, you + should avoid any changes on embedded windows outside their creation + scripts.
+ +
-windowdestroy + command
+ +
Specifies a Tcl command to be invoked when a window embedded into + the cell is destroyed.  The command is automatically concatenated + with the path name of the tablelist widget, the cell's row and column + indices, as well as the path name of the embedded window, and the + resulting script is evaluated in the global scope.  This option + provides an easy-to-use alternative to binding a script to the embedded + window's <Destroy> event from within its + creation script, specified as the value of the -window cell configuration option.
+ +
-windowupdate + command
+ +
Specifies a Tcl command responsible for adapting the background and + foreground colors of a window embedded into the cell to the current + background and foreground colors of the cell itself.  The current + cell colors depend on whether the tablelist widget's state is normal or + disabled, whether the cell is selected, and whether + its row is displayed with the colors specified by the -stripebackground and + -stripeforeground + widget or column configuration options.  The command is + automatically concatenated with the path name of the tablelist widget, + the cell's row and column indices, the path name of the embedded + window, the option name -background and the cell's + current background color, as well as the option name + -foreground and the cell's current foreground + color.  The resulting script is then evaluated in the global + scope.  The specified command can use the colors passed to it as + arguments to set the corresponding colors of the embedded window to the + same values.
+ +
For example, if the embedded window is a text or ctext + widget and you want for its background and foreground colors to be + automatically adapted to the cell's current background and foreground + colors, then you can achieve this by setting the + -windowupdate cell configuration option to + updateWindow, where the latter is the procedure + implemented as follows:
+ +
+
+
+proc updateWindow {tbl row col w args} {
+    eval [list $w configure] $args
+}
+
+
+
+ +
With Tcl/Tk 8.5 or above, you can use the more compact form
+ +
+
+
+proc updateWindow {tbl row col w args} {
+    $w configure {*}$args
+}
+
+
+
+ +
In this example, args is a list of the form
+ +
+
+
+-background backgroundColor -foreground foregroundColor
+
+
+
+
+
+ +
The -background, -font, + -foreground, -selectbackground, and + -selectforeground cell configuration options override + the options of the same names set at row, column, or widget level if the + specified value is not an empty string.  See the COLORS AND FONTS section for further details on + these options.
+ +
CELL CONFIGURATION OPTIONS IN THE + TABLELIST HEADER
+ +
The following options are currently supported by the  + header cellcget,  + header + cellconfigureheader configcelllist,  and  + header configcells  + commands:
+ +
+
+
-background + color or -bg color
+ +
Specifies the normal background color to use when displaying the + content of the header cell.
+ +
-font + font
+ +
Specifies the font to use when displaying the content of the header + cell.
+ +
-foreground + color or -fg color
+ +
Specifies the foreground color to use when displaying the content + of the header cell.
+ +
-image + image
+ +
Specifies the name of the Tk image to be displayed in the header + cell.  The details are the same as for a + cell in the tablelist body.
+ +
+ -imagebackground color
+ +
Specifies the background color of the label widget containing the + embedded image (if any).  The details are the same as for a cell in the tablelist body.
+ +
-stretchwindow + boolean
+ +
Specifies whether the width of the window embedded into the header + cell shall be adapted dynamically to the width of the cell's column if + the latter is non-zero (i.e., static).  The details are the same + as for a cell in the tablelist + body.
+ +
-text + text
+ +
Specifies the string to be displayed in the given header cell, + i.e., updates the element contained in the cell.  If the + tablelist's state is + disabled then this option will be ignored.
+ +
-valign + verticalAlignment
+ +
Specifies the vertical alignment of the embedded image or window + displayed in the header cell (if any).  The default value is + center.  This option overrides the one of the same name for the column containing + the given cell, and may have the same values as its column-related + counterpart.
+ +
-window + command
+ +
Specifies a Tcl command creating the window to be embedded into the + header cell.  The details are similar to those for a cell in the tablelist body.
+ +
-windowdestroy + command
+ +
Specifies a Tcl command to be invoked when a window embedded into + the header cell is destroyed.  The details are the same as + for a cell in the tablelist + body.
+ +
-windowupdate + command
+ +
Specifies a Tcl command responsible for adapting the background and + foreground colors of a window embedded into the header cell to the + current background and foreground colors of the cell itself.  The + current header cell colors depend on whether the tablelist widget's + state is + normal or disabled.  The + other details are the same as for a cell + in the tablelist body.
+
+
+ +
The -background, + -font, and -foreground header cell + configuration options override the options of the same names set at header + row, column, or widget level if the specified value is not an empty + string.  See the COLORS AND FONTS + section for further details on these options.
+ +
COLORS AND FONTS
+ +
The -background, -font, + -foreground, -selectbackground, and + -selectforeground options can also be specified at + column, row, and cell level, by using the columnconfigure (or configcolumnlist, or configcolumns), rowconfigure (or configrowlist, or configrows), and cellconfigure (or configcelllist, or configcells) subcommands of the Tcl command + associated with the tablelist widget.  Similarly, the first three of + these options can also be specified for the widget's header at row and cell + level, with the aid of the  header rowconfigure  (or  + header + configrowlist , or  header configrows)  and  + header + cellconfigure  (or  header configcelllist, or  + header + configcells)  subcommands.  Likewise, the + -stripebackground and + -stripeforeground options can also be specified at + column level.  For this reason, a particular cell can have up to four + values for one and the same color or font option.  If these values + conflict, then the option specified at the highest priority level is + used.  The decreasing priority order is cell, row, column, + widget.
+ +
If one of these options hasn't been specified at cell, row, + or column level, or if its value for that level is an empty string (this is + explicitly allowed), then that option will not be used at that particular + level.
+ +
USING A TABLELIST AS MULTI-COLUMN TREE + WIDGET
+ +
When using a tablelist widget to display a tree hierarchy, there are a + few rules to follow:
+ +
+
    +
  1. Do not use the the widget's -listvariable option, or at least do not + add new items to the variable specified as its value, because adding + new items to that list will result in inserting those list elements + into the widget without respecting the tree's internal structure.
  2. + +
  3. Make sure that the column specified by the + -treecolumn option is + left-aligned so the tree structure can be displayed as expected.
  4. + +
  5. Use the insertchild(ren) or insertchildlist subcommand rather + than insert or + insertlist for inserting + new items into the widget's body.
  6. +
+
+ +
INTERACTIVE CELL EDITING
+ +
Whether or not the content of a cell of a tablelist widget's body can + be edited interactively, depends on the -editable + option at both cell and column level.  If the cell-level option was set + explicitly then its value determines the editability of the cell's + content.  Otherwise the value of the column-level option is used to + decide whether the cell can be edited interactively.  From this rule + it follows that you can enable interactive cell editing for a whole column + by setting its -editable option to true.  To + exclude some of the column's cells from interactive editing, just set their + -editable option to false.
+ +
The interactive cell editing is started by the + editcell subcommand, which is + invoked implicitly by clicking with the left mouse button into an editable + cell (see the -editselectedonly option for details) or + using keyboard navigation to move from one editable cell into + another.  If the selection type is cell and the + location cursor is in an editable cell, then the interactive editing of the + active element can also be started by pressing Return or + KP_Enter.  Per default, the editcell + subcommand creates a temporary entry widget and embeds it into the cell + whose index was passed to it as argument.  You can, however, use the + -editwindow column or + cell configuration option to specify another + widget instead of an entry, like a Tk core text, spinbox, checkbutton, or + menubutton widget, or a tile entry, spinbox, combobox, checkbutton, or + menubutton, or one of the 19 currently supported widgets from the packages + BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry + (or Mentry_tile).  Before specifying a widget from one of these + library packages as the value of the -editwindow column + or cell configuration option, you must register it for interactive cell + editing by invoking the corresponding tablelist::add* + command.  The above-mentioned Tk core and tile widgets are + automatically registered for cell editing.
+ +
In the simplest case, the text automatically inserted into + the temporary embedded widget is the same as the text displayed in the + cell, which in turn can be the cell's content or the string obtained from + the latter by using the -formatcommand option of the cell's + column.  However, if the value of the -editstartcommand configuration option + is a nonempty string, then the text displayed in the cell is passed to that + command as its last argument (following the tablelist's path name as well + as the cell's row and column indices), the resulting script is evaluated in + the global scope, and the return value becomes the edit window's + content.  From within this script you can invoke the cancelediting subcommand, which destroys + the temporary embedded widget and cancels the editing of its content.  + The main goal of this script is, however, to enable you to define + validations for the editing process.  This can be done either with the + aid of the options for entry validation, supported by Tk versions 8.3 and + higher (see the entry reference page), or by using the widget + callback package Wcb, available for Tk + versions 8.0 and higher.  The Iwidgets package (available for Tk + versions 8.0 or higher) provides its own validation facilities, which can + equally be used if the edit window is a widget belonging to that + extension.  In either case, you will need the path name of the + temporary embedded widget or that of its entry or entry-like component; use + the editwinpath and + entrypath subcommands to get + these path names.  Another purpose of the command indicated by the + -editstartcommand option is to enable you to prepare + the edit window in various other ways.  For example, if the latter is + a combobox widget then you can set its -editable option + to false or (for a tile combobox) set its state to + readonly, and you will have to populate its listbox + component.  In the same script, you can change some of the embedded + widget's visual attributes (like its background, selection background, or + selection foreground color).  (Notice that this can also be done with + the aid of the Tk option database.)
+ +
The editing of the text inserted into the edit window uses + the widget-specific bindings for mouse and keyboard events, with a few + extensions and changes, as described in the DEFAULT BINDINGS FOR INTERACTIVE CELL EDITING + section.  For example, in entry or entry-like components of the edit + window, Control-i inserts a tab, Control-j + inserts a newline, and if the edit window is a text or ctext widget then + Return and KP_Enter insert a newline character, + too.  Tab and Shift-Tab are used for + navigation between the editable cells, just like Alt-Left, + Alt-Right, Alt-Up, Alt-Down, + Alt-Prior, Alt-Next, Alt-Home, and + Alt-End (as well as Control-Home and + Control-End, except in the case of a text or ctext + widget).  On Mac OS Classic and Mac OS X Aqua the Command + key is used instead of Alt.  The editing can be aborted + with the Escape key (or by invoking the cancelediting subcommand) and terminated + normally with Return or KP_Enter (together with + Control for a text or ctext widget).  The bindings for + the keys used for normal termination of the editing just invoke the + finishediting subcommand; + the latter can also be called explicitly to terminate the editing + programmatically.  Normal termination is also triggered by clicking + with the left mouse button anywhere in the tablelist's body, outside the + cell just being edited, or moving into another editable cell by using + keyboard navigation.  If the editing was started with the left mouse + button, the edit window is a Tk or tile checkbutton, and the value of the + -instanttoggle option is + true, then the normal termination of the editing will take place + automatically, without any user interaction.  Similarly, if the edit + window is one of the four combobox widgets supported by Tablelist or a + menubutton widget, and the value of the -autofinishediting option is true, then + selecting a combobox or menu entry will auomatically terminate the editing + session.
+ +
When normal termination of the editing process occurs, the + Tcl command associated with the tablelist widget compares the edit window's + final content with its original one.  If they are equal then the + embedded widget is destroyed and the cell's original value is + restored.  If the two strings are different and the value of the + -editendcommand + configuration option is a nonempty string, then the edit window's final + text is passed to that command as its last argument (following the + tablelist's path name as well as the cell's row and column indices), the + resulting script is evaluated in the global scope, and the return value + becomes the cell's new internal content after destroying the temporary + embedded widget.  The main goal of this script is to enable you to do + a final validation of the edit window's content.  From within this + script you can invoke the rejectinput subcommand, which prevents the + script's return value from becoming the cell's new content; this subcommand + also prevents the destruction of the temporary embedded widget.  + Another purpose of the command indicated by the + -editendcommand option is to convert the edit window's + text to the cell's new internal content, which is necessary if, due + to the -formatcommand + column configuration option, the cell's internal value is different from + its external representation.  See the description of the + -forceeditendcommand + option for more about the invocation of the command mentioned above.
+ +
DRAG & DROP SUPPORT
+ +
As described in detail in the + DEFAULT AND INDIVIDUAL BINDINGS FOR THE TABLELIST + BODY section, the default binding scripts perform an automatic + drag-friendly handling of the selection and of pointer movements with mouse + button 1 down if the tablelist widget's -customdragsource opton was set to true + or its body component was registered as a drag source for mouse button 1 + via the  tkdnd::drag_source register  or the + BWidget DragSite::register command.
+ +
On the other hand, you can also register a tablelist widget + as a TkDND drop target, by invoking the  tkdnd::drop_target + register  command.  Similarly, you can register the + body component of a tablelist widget as a drop target for the drag & drop + framework included in BWidget, with the aid of the + DropSite::register command.  (Notice that for + BWidget it is necessary to register the tablelist's body rather than + the widget itself.)
+ +
The action to be triggered by a drop event over a tablelist + widget might depend on the row under the mouse and the vertical position of + the mouse pointer within the containing row (if any).  For example, + your application might insert one or more new siblings before or after the + row in question, or a child item having that row as parent, depending on + the vertical position of the mouse pointer within the containing row.  + Alternatively, the drop event might update the item under the mouse, using + the data associated with the drag source, or perform some other, + application-specific action.  In any case, you can significantly + increase the user-friendliness of your application by displaying a target + indicator (a horizontal gap or vertical bar) before or inside the row that + will be affected by the drop.  The examples below demonstrate how to + achieve this for a tablelist widget $tbl with the aid of the + showtargetmark, + hidetargetmark, + targetmarkpos, and + targetmarkpath + subcommands.
+ +
+ TkDND EXAMPLE:  For an introduction to TkDND see the online + TkDND Tutorial by Georgios + Petasis.  For the following example it is strongly recommended to + use TkDND version 2.7 or later, which can be downloaded from the location + +
+
+ https://sourceforge.net/projects/tkdnd/files/ +
+
+ +
+
+package require tkdnd 2.7
+
+tkdnd::drop_target register $tbl DND_Text
+
+bind $tbl <<DropEnter>>    { onTblDropEnterOrPos %W %X %Y %a %b }
+bind $tbl <<DropPosition>> { onTblDropEnterOrPos %W %X %Y %a %b }
+bind $tbl <<DropLeave>>    { %W hidetargetmark }
+bind $tbl <<Drop>>         { onTblDrop %W %A %D }
+
+proc onTblDropEnterOrPos {tbl rootX rootY actions buttons} {
+    global place row
+    set y [expr {$rootY - [winfo rooty $tbl]}]
+    foreach {place row} [$tbl targetmarkpos $y] {}
+
+    if {some_optional_excluding_condition} {
+        $tbl hidetargetmark
+        return refuse_drop
+    } else {
+        $tbl showtargetmark $place $row
+        return copy ;# for example
+    }
+}
+
+proc onTblDrop {tbl action data} {
+    handleTblDrop $tbl $data
+    return $action
+}
+
+
+
+ +
+ BWidget EXAMPLE:  For an introduction to drag & drop with + BWidget see the online tutorial BWidget example: Drag and Drop Demo by + Kevin Walzer.  The DropSite::* commands used in + the following example are described in the "DropSite" reference page + included in the BWidget distribution.  When using this drag & drop + framework, you will have to register not only the tablelist's body, but + also its target indicator as drop sites, to make sure that the target + mark won't get hidden by moving the mouse cursor over it with mouse + button 1 down: + +
+
+package require BWidget
+
+foreach w [list [$tbl bodypath] [$tbl targetmarkpath]] {
+    DropSite::register $w -dropovercmd tblDropOverCmd -dropcmd tblDropCmd \
+        -droptypes ...
+}
+
+proc tblDropOverCmd {dropTarget dragSrc event rootX rootY op dataType data} {
+    # $event may be "enter", "motion", or "leave"
+    set tbl [tablelist::getTablelistPath $dropTarget]
+    if {[string equal $event "leave"]} {
+        set newWidget [winfo containing -displayof $dropTarget $rootX $rootY]
+        if {![string equal $newWidget [$tbl targetmarkpath]] &&
+            ![string equal $newWidget [$tbl bodypath]]} {
+            $tbl hidetargetmark
+            return 2 ;# refuse the drop and re-invoke the callback on motion events
+        }
+    }
+
+    global place row
+    set y [expr {$rootY - [winfo rooty $tbl]}]
+    foreach {place row} [$tbl targetmarkpos $y] {}
+
+    if {some_optional_excluding_condition} {
+        $tbl hidetargetmark
+        DropSite::setcursor dot
+        return 2 ;# refuse the drop and re-invoke the callback on motion events
+    } else {
+        $tbl showtargetmark $place $row
+        DropSite::setcursor based_arrow_down
+        return 3 ;# accept the drop and re-invoke the callback on motion events
+    }
+}
+
+proc tblDropCmd {dropTarget dragSrc rootX rootY op dataType data} {
+    set tbl [tablelist::getTablelistPath $dropTarget]
+    handleTblDrop $tbl $data
+    return 1 ;# accept the drop
+}
+
+
+
+ +
+ In both examples above, you can restrict the type of the supported drop + target indicator by appending the argument + -horizontal or -vertical to the + targetmarkpos + invocation.  When passing the -vertical option, + you will have to extend the if statement following + that subcommand invocation as follows: + +
+
+    if {$row < 0 || some_optional_excluding_condition} {
+
+
+
+ +
+ Both examples above invoke the handleTblDrop procedure, + implemented as follows: + +
+
+proc handleTblDrop {tbl data} {
+    $tbl hidetargetmark
+    global place row
+
+    if {[string equal $place "before"]}
+        if {$row < [$tbl size]} {
+            # Insert a sibling of the item indicated by $row, built from $data
+            # (For a flat tablelist replace the following 2 lines with
+            # "set key [$tbl insert $row ...]")
+            set key [$tbl insertchild [$tbl parentkey $row] \
+                     [$tbl childindex $row] ...]
+        } else {
+            # Append a top-level item built from $data
+            # (For a flat tablelist replace the following line with
+            # "set key [$tbl insert end ...]")
+            set key [$tbl insertchild root end ...]
+        }
+    } else { ;# "inside"
+        # Insert a child of the item indicated by $row, built from $data
+        # Alternatively, update the item indicated by $row, using $data
+        set key [$tbl insertchild $row end ...]
+        $tbl expand $row -partly
+    }
+
+    . . .
+}
+
+
+
+ +
VIRTUAL EVENTS
+ +
Tablelist defines a few virtual events for the purposes of + notification, and makes use of the  event + generate  command to send them to the tablelist widget in + question (whose path name will be the value of the %W + substitution in event scripts).  When using Tk 8.5 or above, most of + these virtual events are generated with their -data + option set to an appropriate event-specific value.  Binding scripts + can access this user data as the value of the %d + substitution.  Unfortunately, the -data option + to  event generate  was not supported by Tk + versions earlier than 8.5.  For these Tk versions, the  + event generate  command will be invoked without + the -data option.
+ +
The virtual events generated by Tablelist are as + follows:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Virtual EventDescriptionUser Data (for Tk 8.5 or Later)
<<TablelistCellRestored>>Generated by the cancelediting subcommand.A list consisting of the numerical row and column indices of the + cell whose content is being edited.
<<TablelistCellUpdated>>Generated by the finishediting subcommand.A list consisting of the numerical row and column indices of the + cell whose content is being edited.
+ <<TablelistColHiddenStateChanged>>Generated whenever the hidden state of one or more columns is + toggled by using the columnconfigure, configcolumnlist, + configcolumns, or + togglecolumnhide + subcommand.A list consisting of the numerical indices of the columns whose + hidden state changed.
<<TablelistColumnMoved>>Generated by the default bindings whenever a column is moved + interactively to a new position.A list of length 4, whose first two elements are identical to the + two arguments passed to the movecolumn subcommand invoked for moving + the source column to the target position, and the last two elements + are the corresponding column names, retrieved with the aid of + the  columncget ... + -name  subcommand.
<<TablelistColumnResized>>Generated by the default bindings whenever a column is resized + interactively.The numerical index of the column that was resized.
<<TablelistColumnSorted>>Generated by the tablelist::sortByColumn + command.A list consisting of the numerical column index and the sort + order (decreasing or + increasing).
<<TablelistColumnsSorted>>Generated by the tablelist::addToSortColumns + command.A list consisting of the two lists passed to the + sortbycolumnlist + subcommand, invoked to perform the multi-column sorting.
+ <<TablelistHeaderHeightChanged>>Generated whenever the (requested) height of the tablelist's + header changes.  Used by the scrollarea + widget of the Scrollutil package.The (requested) height of the tablelist's header.
+ <<TablelistRowHiddenStateChanged>>Generated whenever the hidden state of one or more rows is + toggled by using the rowconfigure, configrowlist, configrows, or togglerowhide subcommand.A list consisting of the numerical indices of the rows whose + hidden state changed.
<<TablelistRowMoved>>Generated by the default bindings whenever a row is moved + interactively to a new position.A list of length 3, whose elements are derived from the arguments + passed to the second form of the move subcommand invoked for moving the source + row to the target position.  The first list element will be the + full key corresponding to the first argument, the second one will be + root or the full key corresponding to the second + argument, and the third list element will be identical to the third + argument passed to the move subcommand.
<<TablelistSelect>>, + <<ListboxSelect>>Generated by the default bindings whenever the selection changes + in the tablelist widget due to user interaction.Not used.
<<TablelistSelectionLost>>Sent to the tablelist widget whenever it loses ownership of the + PRIMARY selection.Not used.
<<TablelistTitleColsWidthChanged>>Generated whenever the total width of the non-hidden title + columns changes.  Used by the scrollarea + widget of the Scrollutil package.The total width of the non-hidden title columns.
<<TablelistViewUpdated>>Generated whenever the tablelist widget has finished updating its + view (which, for performance reasons, is performed at idle + time).Not used.
+
+ +
ROW INDICES
+ +
Many of the widget commands for tablelist widgets take one or more row + indices as arguments.  A row index specifies a particular item of the + tablelist's body component, in any of the following ways:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
numberSpecifies the item as a numerical index, where 0 + corresponds to the first item in the tablelist's body.
knumberSpecifies the item by its full key, composed of the prefix + k and the sequence number associated with the + item.  You can use the getkeys widget command to get this sequence + number, or the getfullkeys widget command to retrieve + the full key.  In addition, the insert, insertlist, insertchildren, and + insertchildlist + subcommands return the list of full keys associated with the items + just inserted.
active   Indicates the item containing the element that has the location + cursor.  Depending on the selection type, this item as a whole + or just its element having the location cursor will be displayed + according to the value of the -activestyle configuration option when + the tablelist has the keyboard focus.  This item is specified + with the activate widget + command or as the row containing the element specified with the + activatecell widget + command.
anchorIndicates the anchor point for the row selection, which is set + with the  selection + anchor  widget command, or the row containing the + anchor point for the cell selection, which is set with the  + cellselection + anchor  widget command.
endIndicates the end of the tablelist.  For most commands this + refers to the last item in the tablelist, but for a few commands such + as index, insert, insertlist, and  showtargetmark before,  as well + as for the target of the move + command it refers to the item just after the last one.
lastIndicates the last item of the tablelist.
topIndicates the topmost body item visible in the tablelist + window.
bottomIndicates the bottommost body item visible in the tablelist + window.
@x,yIndicates the body item that covers the point in the tablelist + window specified by x and y + (in pixel coordinates).  If no item covers that point, then the + closest item to that point is used.  The coordinates + x and y are expected to be + relative to the tablelist window itself (not its body + component).
nameSpecifies the row by the value of its -name configuration option.  + name must be different from all the above row + indices, and should be unique (if several rows have the same name + then this value is considered to indicate the first matching + row).
+
+ +
In the widget command descriptions below, arguments named + index, firstIndex, + lastIndex, sourceIndex, and + targetIndex always contain row indices in one of the + above forms.
+ +
NODE INDICES
+ +
Many of the widget commands for tablelist widgets take a node index as + argument.  A node index is either the word root, + denoting the invisible root node of a tablelist used as a tree widget, or a + regular row index in one of the above forms, specifying a particular item + of the tablelist.
+ +
In the widget command descriptions below, arguments named + nodeIndex, parentNodeIndex, and + targetParentNodeIndex always contain node indices.
+ +
COLUMN INDICES
+ +
Many of the widget commands for tablelist widgets take one or more + column indices as arguments.  A column index specifies a particular + column of the tablelist, in any of the following ways:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
numberSpecifies the column as a numerical index, where 0 + corresponds to the first column in the tablelist.
active   Indicates the column containing the element that has the location + cursor.  If the selection type is cell then + this element will be displayed according to the value of the + -activestyle + configuration option when the tablelist has the keyboard focus.  + This element is specified with the activatecell widget command.
anchorIndicates the column containing the anchor point for the cell + selection, which is set with the  cellselection anchor  widget + command.
endIndicates the last column of the tablelist, except for the + commands insertcolumns and insertcolumnlist, as well as for + the target of the movecolumn command, in which cases it + refers to the column just after the last one.
lastIndicates the last column of the tablelist.
leftIndicates the leftmost column visible in the tablelist + window.
rightIndicates the rightmost column visible in the tablelist + window.
@x,yIndicates the column that covers the point in the tablelist + window specified by x and y + (in pixel coordinates).  If no column covers that point, then + the closest column to that point is used.  The coordinates + x and y are expected to be + relative to the tablelist window itself (not its body + component).
nameSpecifies the column by the value of its -name configuration option.  + name must be different from all the above column + indices, and should be unique (if several columns have the same name + then this value is considered to indicate the first matching + column).
+
+ +
In the widget command descriptions below, arguments named + columnIndex, firstColumn, + lastColumn, sourceColumn, and + targetColumn always contain column indices in one of + the above forms.
+ +
CELL INDICES
+ +
Many of the widget commands for tablelist widgets take one or more cell + indices as arguments.  A cell index specifies a particular cell of the + tablelist's body component, in any of the following ways:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
row,colIndicates the cell having the row index row + and column index col.  + row may be a number, a full key (of the form + knumber), active, + anchor, end (where the latter + indicates the last row in the tablelist), last, + top, bottom, or a row + name.  col may be a number, + active, anchor, + end, last, + left, right, or a column + name.
active   Indicates the element that has the location cursor.  If the + selection type is cell then this element will be + displayed according to the value of the -activestyle configuration option when + the tablelist has the keyboard focus.  This element is specified + with the activatecell + widget command.
anchorIndicates the anchor point for the cell selection, which is set + with the  cellselection + anchor  widget command.
endIndicates the last cell in the last row of the tablelist.
lastIndicates the last cell in the last row of the tablelist (same as + end).
@x,yIndicates the body cell that covers the point in the tablelist + window specified by x and y + (in pixel coordinates).  If no body cell covers that point, then + the closest body cell to that point is used.  The coordinates + x and y are expected to be + relative to the tablelist window itself (not its body + component).
+
+ +
In the widget command descriptions below, arguments named + cellIndex, firstCell, and + lastCell always contain cell indices in one of the + above forms.
+ +
HEADER ROW INDICES
+ +
Many of the subcommands of the header tablelist widget command take one or more + header row indices as arguments.  A header row index specifies a + particular item of the tablelist's header component, in any of the + following ways:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
numberSpecifies the header item as a numerical index, where + 0 corresponds to the first item in the tablelist's + header.
hknumberSpecifies the header item by its full key, composed of the prefix + hk and the sequence number associated with the + item.  You can use the  header getkeys  widget command to + get this sequence number, or the  header getfullkeys  widget + command to retrieve the full key.  In addition, the  + header insert  + and  header + insertlist  subcommands return the list of full + keys associated with the header items just inserted.
endIndicates the end of the tablelist's header.  For most + commands this refers to the last item in the header component, but + for a few commands such as  header + indexheader + insert,  and  header insertlist  it refers to + the header item just after the last one.
lastIndicates the last header item of the tablelist.
@x,yIndicates the header item that covers the point in the tablelist + window specified by x and y + (in pixel coordinates).  If no header item covers that point, + then the closest header item to that point is used.  The + coordinates x and y are + expected to be relative to the tablelist window itself (not its + header component).
nameSpecifies the header row by the value of its -name configuration option.  + name must be different from all the above header + row indices, and should be unique (if several header rows have the + same name then this value is considered to indicate the first + matching header row).
+
+ +
In the widget command descriptions below, arguments named + headerIndex, firstHeaderIndex, and + lastHeaderIndex always contain header row indices in + one of the above forms.
+ +
HEADER CELL INDICES
+ +
Many of the subcommands of the header tablelist widget command take one or more + header cell indices as arguments.  A header cell index specifies a + particular cell of the tablelist's header component, in any of the + following ways:
+ +
+ + + + + + + + + + + + + + + + + + + + +
headerRow,colIndicates the cell having the header row index + headerRow and column index + colheaderRow may be a + number, a full key (of the form hknumber), + end (where the latter indicates the last header + row in the tablelist), last, or a header row + name.  col may be a number, + active, anchor, + end, last, + left, right, or a column + name.
endIndicates the last cell in the last row of the tablelist's + header.
lastIndicates the last cell in the last row of the tablelist's header + (same as end).
@x,yIndicates the header cell that covers the point in the tablelist + window specified by x and y + (in pixel coordinates).  If no header cell covers that point, + then the closest header cell to that point is used.  The + coordinates x and y are + expected to be relative to the tablelist window itself (not its body + component).
+
+ +
In the widget command descriptions below, arguments named + headerCellIndex, firstHeaderCell, + and lastHeaderCell always contain header cell indices + in one of the above forms.
+ +
WIDGET COMMAND
+ +
+ The tablelist::tablelist command creates a new Tcl + command whose name is pathName.  This command + may be used to invoke various operations on the widget.  It has the + following general form: + +
+
+pathName option ?arg arg ...?
+
+
+
+ +
option and the args determine + the exact behavior of the command.  The following commands are + possible for tablelist widgets:
+ +
+
+
pathName activate + index
+ +
Sets the active item to the one indicated by + index if the tablelist's state is not + disabled.  If index is + outside the range of items in the tablelist or it refers to a + non-viewable item then the closest viewable + item is activated.  The active item is drawn as specified by the + -activestyle + configuration option when the widget has the input focus and the + selection type is row.  Its index may be + retrieved with the index active.  Returns an + empty string.
+ +
pathName + activatecell cellIndex
+ +
Sets the active element to the one indicated by + cellIndex if the tablelist's state is not + disabled.  If cellIndex is + outside the range of elements in the tablelist or it refers to a + non-viewable element, then the closest + viewable element is activated.  The active element is drawn as + specified by the -activestyle configuration option when + the widget has the input focus and the selection type is + cell.  Its index may be retrieved with the + cell index active.  Returns an empty + string.
+ +
pathName + applysorting itemList
+ +
Sorts the elements of itemList according to the + parameters of the most recent sort, sortbycolumn, or sortbycolumnlist invocation and + returns a new list in sorted order.  The + itemList argument is supposed to be a well-formed + list of lists, where the length of each sublist is expected to be no + less than the number of columns of the tablelist widget.  If the + items haven't been sorted at all, or the sort information was reset by + invoking resetsortinfo, then no sorting takes + place and the return value will be identical to + itemList.
+ +
REMARK:  This subcommand is usually invoked + from within the command specified as the value of the -expandcommand configuration option, + for a tablelist row whose children have not yet been inserted into the + widget.  The most efficient way to insert the child items in the + correct order is to add them to a list, sort this list via + applysorting, and then insert the items of the + sorted list by invoking the insertchildlist subcommand.
+ +
pathName attrib + ?name? ?value name value ...?
+ +
Queries or modifies the attributes of the widget.  If no + name is specified, the command returns a list of + pairs, each of which contains the name and the value of an attribute + for pathName.  If name is + specified with no value, then the command returns + the value of the one named attribute, or an empty string if no + corresponding value exists (you can use the hasattrib subcommand to distinguish this + case from the one that the value of an existing attribute is an + empty string).  If one or more + name-value pairs are specified, + then the command sets the given widget attribute(s) to the given + value(s); in this case the return value is an empty string.  + name may be an arbitrary string.
+ +
pathName bbox + index
+ +
Returns a list of four numbers describing the bounding box of the + row given by index.  The first two elements of + the list give the x and y coordinates of the upper-left corner of the + screen area covered by the row (specified in pixels relative to the + widget) and the last two elements give the width and height of the + area, in pixels.  If no part of the row given by + index is visible on the screen, or if + index refers to a non-existent row, then the result + is an empty string; if the row is partially visible, the result gives + the full area of the row, including any parts that are not + visible.
+ +
pathName + bodypath
+ +
Returns the path name of the body component of the widget.
+ +
pathName + bodytag
+ +
Returns the name of a binding tag whose name depends on the path + name of the tablelist widget and which is associated with the + tablelist's body, the separators, as well as the message and label + widgets used for displaying multi-line elements and images, + respectively.  This binding tag precedes the tag TablelistBody in the list of binding + tags of the tablelist descendants mentioned above, and is designed to + be used when defining individual binding scripts for tablelist + widgets.  The main advantage of using this tag instead of the path + name of the tablelist's body is that it enables you to write event + handling scripts that are valid not only for the tablelist's body but + also for the separators, multi-line cells, and embedded images.
+ +
For example, to register the body of a tablelist widget + $tbl as a drag source for mouse button 1 in such a way + that the drag works also for the separators, multi-line cells, and + embedded images, you can proceed like in the following code + samples:
+ +
+ TkDND EXAMPLE: + +
+
+package require tkdnd 2.7
+
+bind [$tbl bodytag] <Button-1> { registerDragSrc %W }
+
+proc registerDragSrc w {
+    # $w can be the tablelist's body, a separator, a message widget
+    # displaying a multi-line element, or a label widget displaying an
+    # image.  Register this widget as a drag source for mouse button 1
+    tkdnd::drag_source register $w DND_Text 1
+    bind $w <<DragInitCmd>> { onTblDragInit %W }
+    bind $w <<DragEndCmd>>  { onTblDragEnd %W %A }
+}
+
+proc onTblDragInit w {
+    set tbl [tablelist::getTablelistPath $w]
+    . . .
+}
+
+proc onTblDragEnd {w action} {
+    if {![string equal $action "refuse_drop"]} {        ;# drop accepted
+        set tbl [tablelist::getTablelistPath $w]
+        . . .
+    }
+}
+
+# Make sure to register the tablelist's body explicitly as a drag source:
+registerDragSrc [$tbl bodypath]
+
+
+
+ +
+ BWidget EXAMPLE: + +
+
+package require BWidget
+
+bind [$tbl bodytag] <Button-1> { registerDragSrc %W }
+
+proc registerDragSrc w {
+    # $w can be the tablelist's body, a separator, a message widget
+    # displaying a multi-line element, or a label widget displaying an
+    # image.  Register this widget as a drag source for mouse button 1
+    DragSite::register $w -dragevent 1 \
+        -draginitcmd tblDragInitCmd -dragendcmd tblDragEndCmd
+}
+
+proc tblDragInitCmd {dragSrc rootX rootY top} {
+    set tbl [tablelist::getTablelistPath $dragSrc]
+    . . .
+}
+
+proc tblDragEndCmd {dragSrc dropTarget op dataType data result} {
+    if {$result != 0} {                                 ;# drop accepted
+        set tbl [tablelist::getTablelistPath $dragSrc]
+        . . .
+    }
+}
+
+# Make sure to register the tablelist's body explicitly as a drag source:
+registerDragSrc [$tbl bodypath]
+
+
+
+ +
In both examples above we also invoke the procedure + registerDragSrc explicitly for the tablelist's body, + because the widget registered as a drag source by its invocation on a + <Button-1> event can be different from the body + component, and the default bindings need the information whether + the tablelist's body was registered as a drag source.
+ +
pathName + canceledediting
+ +
Returns the value 1 if the most recent interactive + cell editing was canceled (by the user or programmatically, with the + aid of the cancelediting subcommand) and + 0 otherwise.
+ +
REMARK:  By invoking this subcommand from + within the Tcl command specified by the -editendcommand configuration option, + you can find out whether the editing session was canceled or terminated + normally.  Remember that this Tcl command will be invoked in both + cases mentioned above if the -forceeditendcommand option was + set to true.
+ +
pathName + cancelediting
+ +
This subcommand cancels the interactive editing of the content of + the cell whose index was passed to the editcell subcommand, destroys the temporary + widget embedded into the cell, and restores the original cell + content.  This command enables you to cancel the interactive cell + editing from within the Tcl command specified by the -editstartcommand configuration + option if that pre-edit callback encounters an error when preparing the + text to be inserted into the edit window.  The command is also + invoked implicitly by pressing the Escape key when a cell + is being edited.  The return value is an empty string.  + Immediately before returning this value, the command generates the + virtual event + <<TablelistCellRestored>>.  For Tk + versions 8.5 and higher, this virtual event is generated with its + -data option set to a list consisting of the + numerical row and column indices of the cell whose content is being + edited.  If no cell was being edited when the command was invoked + then an empty string is returned without generating a virtual + event.
+ +
pathName cellattrib + cellIndex ?name? ?value name value + ...?
+ +
Queries or modifies the attributes of the cell given by + cellIndex.  If no name is + specified, the command returns a list of pairs, each of which contains + the name and the value of an attribute for the cell.  If + name is specified with no + value, then the command returns the value of the + one named cell attribute, or an empty string if no corresponding value + exists (you can use the hascellattrib subcommand to distinguish + this case from the one that the value of an existing cell + attribute is an empty string).  If one or more + name-value pairs are specified, + then the command sets the given cell attribute(s) to the given + value(s); in this case the return value is an empty string.  + name may be an arbitrary string.
+ +
pathName cellbbox + cellIndex
+ +
Returns a list of four numbers describing the bounding box of the + cell given by cellIndex.  The first two + elements of the list give the x and y coordinates of the upper-left + corner of the screen area covered by the cell (specified in pixels + relative to the widget) and the last two elements give the width and + height of the area, in pixels.  If no part of the cell given by + cellIndex is visible on the screen, or if + cellIndex refers to a non-existent cell, then the + result is an empty string; if the cell is partially visible, the result + gives the full area of the cell, including any parts that are not + visible.
+ +
pathName cellcget + cellIndex option
+ +
Returns the current value of the cell configuration option given by + option for the cell specified by + cellIndexoption may + have any of the values accepted by the cellconfigure command.
+ +
pathName + cellconfigure cellIndex ?option? value + option value ...?
+ +
Queries or modifies the configuration options of the cell given by + cellIndex.  If no option + is specified, the command returns a list describing all of the + available options for the cell (see + Tk_ConfigureInfo for information on the format of + this list).  If option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given cell option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + described in the CELL CONFIGURATION OPTIONS IN + THE TABLELIST BODY section.
+ +
pathName cellindex + cellIndex
+ +
Returns the canonical cell index value that corresponds to + cellIndex, in the form + row,col, where + row and col are integers.
+ +
pathName + cellselection option args
+ +
This command is used to adjust the cell selection within the body + of a tablelist widget.  It has several forms, depending on + option:
+ +
+
+
pathName cellselection anchor + cellIndex
+ +
Sets the cell selection anchor to the element given by + cellIndex.  If + cellIndex refers to a nonexistent or + non-viewable element, then the closest + viewable element is used.  The cell selection anchor is the + end of the cell selection that is fixed while dragging out a cell + selection with the mouse if the selection type is + cell.  The cell index + anchor may be used to refer to the anchor + element.
+ +
pathName cellselection clear + firstCell lastCell
+ pathName cellselection clear + cellIndexList
+ +
If any of the elements between firstCell + and lastCell (inclusive) or corresponding to + the cell indices specified by the list + cellIndexList are selected, they are + deselected.  The selection state is not changed for elements + outside the range given in the first form of the command or + different from those specified by the cell index list given in its + second form.
+ +
pathName cellselection includes + cellIndex
+ +
Returns 1 if the element indicated by + cellIndex is currently selected, 0 + if it isn't.
+ +
pathName cellselection set + firstCell lastCell
+ pathName cellselection set + cellIndexList
+ +
Selects all of the selectable elements in the range + between firstCell and + lastCell, inclusive, or corresponding to the + indices specified by the list cellIndexList, + without affecting the selection state of any other elements.  + An element is viewed as selectable if and only if the value of the + -selectable option of + the row containing it is true.
+
+
+ +
If the tablelist's state is disabled and + option is different from + includes then the command just returns an empty + string, without performing any of the above actions.
+ +
pathName cget + option
+ +
Returns the current value of the configuration option given by + option, which may have any of the values accepted + by the tablelist::tablelist command.
+ +
pathName childcount + nodeIndex
+ +
Returns the number of children of the tree node indicated by + nodeIndex.  If this argument is specified as + root then the return value will be the number of + top-level items of the tablelist widget.
+ +
pathName childindex + index
+ +
Returns the numerical index of the row given by + index in the list of children of its parent + node.
+ +
pathName childkeys + nodeIndex
+ +
Returns the list of full keys of the children of the tree node + indicated by nodeIndex.  If this argument is + specified as root then the return value will be the + list of full keys of the top-level items contained in the tablelist + widget.
+ +
pathName collapse + indexList ?-fully|-partly?
+ +
This subcommand collapses the specified rows of a tablelist used as + a tree widget, i.e., elides all their descendants.  The optional + argument -fully (which is the default) indicates + that the command will be performed recursively, i.e., all of the + descendants of the nodes specified by indexList + will be collapsed, so that a subsequent invocation of the non-recursive + version of the expand(all) + subcommand will only display their children but no further descendants + of them.  The -partly option (which is used by + the default bindings) restricts the operation to just one hierarchy + level, implying that by a subsequent invocation of the non-recursive + version of the expand(all) subcommand exactly the + same descendants will be displayed again that were visible prior to + collapsing the rows.
+ +
Before hiding the descendants of a row, the command + specified as the value of the -collapsecommand option (if any) is + automatically concatenated with the path name of the tablelist widget + and the row index, and the resulting script is evaluated in the global + scope.
+ +
For technical reasons (the use of the + -elide text widget tag option for collapsing a + row), this subcommand is not supported for Tk versions earlier than + 8.3.
+ +
REMARK:  If you want to collapse several + rows, it is much more efficient to do it by invoking this subcommand + for the list of their indices than by invoking it in a loop, for the + individual rows.
+ +
pathName + collapseall ?-fully|-partly?
+ +
This subcommand collapses all top-level rows of a tablelist used as + a tree widget, i.e., elides all their descendants.  The optional + argument -fully (which is the default) indicates + that the command will be performed recursively, i.e., all of the + descendants of the top-level nodes will be collapsed, so that a + subsequent invocation of the non-recursive version of the + expandall subcommand will + only display their children but no further descendants of them.  + The -partly option restricts the operation to just + one hierarchy level, implying that by a subsequent invocation of the + non-recursive version of the expandall subcommand + exactly the same items will be displayed again that were visible prior + to collapsing the top-level ones.
+ +
Before hiding the descendants of a row, the command + specified as the value of the -collapsecommand option (if any) is + automatically concatenated with the path name of the tablelist widget + and the row index, and the resulting script is evaluated in the global + scope.
+ +
For technical reasons (the use of the + -elide text widget tag option for collapsing a + row), this subcommand is not supported for Tk versions earlier than + 8.3.
+ +
pathName + columnattrib columnIndex ?name? ?value + name value ...?
+ +
Queries or modifies the attributes of the column given by + columnIndex.  If no name + is specified, the command returns a list of pairs, each of which + contains the name and the value of an attribute for the column.  + If name is specified with no + value, then the command returns the value of the + one named column attribute, or an empty string if no corresponding + value exists (you can use the hascolumnattrib subcommand to + distinguish this case from the one that the value of an existing + column attribute is an empty string).  If one or more + name-value pairs are specified, + then the command sets the given column attribute(s) to the given + value(s); in this case the return value is an empty string.  + name may be an arbitrary string.
+ +
pathName columncget + columnIndex option
+ +
Returns the current value of the column configuration option given + by option for the column specified by + columnIndexoption may + have any of the values accepted by the columnconfigure command.
+ +
pathName + columnconfigure columnIndex ?option? ?value + option value ...?
+ +
Queries or modifies the configuration options of the column given + by columnIndex.  If no + option is specified, the command returns a list + describing all of the available options for the column (see + Tk_ConfigureInfo for information on the format of + this list).  If option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given column option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + described in the COLUMN CONFIGURATION + OPTIONS section.
+ +
pathName + columncount
+ +
Returns the number of columns in the tablelist widget.
+ +
pathName + columnindex columnIndex
+ +
Returns the integer column index value that corresponds to + columnIndex.
+ +
pathName + columnwidth columnIndex + ?-requested|-stretched|-total?
+ +
Returns the current width in pixels of the column specified by + columnIndex.  If the optional argument is + -requested (which is the default) then the return + value is the number of pixels corresponding to the column width + specified by the -columns + widget or -width column + configuration option (possibly overridden by interactive column + resizing); if the column width was specified as 0 (and was + not changed by interactive column resizing) then the return value is + the actual number of pixels corresponding to the widest viewable element of the column, including its + header.  With the -stretched option, the + command returns the column width obtained by increasing the value + described above by the number of additional pixels that might have been + added to the requested column width by a stretch operation (see the + -stretch widget and + -stretchable column + configuration options).  Finally, if the optional argument is + -total then the return value is the stretched + column width increased by the number of pixels corresponding to the + left and right margins within the column; this value equals the width + of the header label if the tablelist widget is mapped.
+ +
pathName + configcelllist cellConfigSpecList
+ +
+ For each cell index, option, and value specified by the list + cellConfigSpecList, the command modifies the + given option of the given cell to have the given value.  The + argument cellConfigSpecList must be a list of the + form + +
+
+cellIndex option value cellIndex option value ...
+
+
+
+ +
where each option may have any of the values + described in the CELL CONFIGURATION OPTIONS IN + THE TABLELIST BODY section.  The return value is an empty + string.
+ +
+ This command has the same effect as + +
+
+eval [list pathName configcells] cellConfigSpecList
+
+
+
+ +
but it is more efficient and easier to use.
+ +
pathName + configcells ?cellIndex option value + cellIndex option value ...?
+ +
For each cellIndex, option, + and value, the command modifies the given option of + the given cell to have the given value.  Each + option may have any of the values described in the + CELL CONFIGURATION OPTIONS IN THE TABLELIST + BODY section.  The return value is an empty string.
+ +
pathName + configcolumnlist columnConfigSpecList
+ +
+ For each column index, option, and value specified by the list + columnConfigSpecList, the command modifies the + given option of the given column to have the given value.  The + argument columnConfigSpecList must be a list of + the form + +
+
+columnIndex option value columnIndex option value ...
+
+
+
+ +
where each option may have any of the values + described in the COLUMN CONFIGURATION + OPTIONS section.  The return value is an empty string.
+ +
+ This command has the same effect as + +
+
+eval [list pathName configcolumns] columnConfigSpecList
+
+
+
+ +
but it is more efficient and easier to use.
+ +
pathName + configcolumns ?columnIndex option value + columnIndex option value ...?
+ +
For each columnIndex, + option, and value, the command + modifies the given option of the given column to have the given + value.  Each option may have any of the values + described in the COLUMN CONFIGURATION + OPTIONS section.  The return value is an empty string.
+ +
pathName + configrowlist rowConfigSpecList
+ +
+ For each row index, option, and value specified by the list + rowConfigSpecList, the command modifies the given + option of the given row to have the given value.  The argument + rowConfigSpecList must be a list of the form + +
+
+index option value index option value ...
+
+
+
+ +
where each option may have any of the values + described in the ROW CONFIGURATION OPTIONS IN + THE TABLELIST BODY section.  The return value is an empty + string.
+ +
+ This command has the same effect as + +
+
+eval [list pathName configrows] rowConfigSpecList
+
+
+
+ +
but it is more efficient and easier to use.
+ +
pathName configrows + ?index option value index option + value ...?
+ +
For each index, option, and + value, the command modifies the given option of the + given row to have the given value.  Each + option may have any of the values described in the + ROW CONFIGURATION OPTIONS IN THE TABLELIST + BODY section.  The return value is an empty string.
+ +
pathName configure + ?option? ?value option value + ...?
+ +
Queries or modifies the configuration options of the widget.  + If no option is specified, the command returns a + list describing all of the available options for + pathName (see Tk_ConfigureInfo + for information on the format of this list).  If + option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given widget option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + accepted by the tablelist::tablelist command.
+ +
pathName containing + y
+ +
Given a y-coordinate within the tablelist window, this command + returns the index of the tablelist body item containing that + y-coordinate.  If no corresponding item is found then the return + value is -1.  The coordinate y is + expected to be relative to the tablelist window itself (not its body + component).
+ +
pathName + containingcell x y
+ +
Given an x- and a y-coordinate within the tablelist window, this + command returns the index of the tablelist body cell containing the + point having these coordinates.  If no corresponding cell is found + then the row or column component (or both) of the return value is + -1.  The coordinates x and + y are expected to be relative to the tablelist + window itself (not its body component).
+ +
pathName + containingcolumn x
+ +
Given an x-coordinate within the tablelist window, this command + returns the index of the tablelist column containing that + x-coordinate.  If no corresponding column is found then the return + value is -1.  The coordinate x is + expected to be relative to the tablelist window itself (not its body + component).
+ +
pathName + cornerlabelpath
+ +
Returns the path name of the label widget contained in the + north-east corner frame (see the cornerpath subcommand.  When using + Tablelist_tile, the return value will be a ttk::label widget of the + same style as the header labels.  The global visual options set + for the header labels are automatically applied to this (ttk::)label + widget, too.
+ +
pathName + cornerpath ?-ne|-sw?
+ +
Returns the path name of one out of two frame widgets that are + siblings of the tablelist and are automatically created and destroyed + together with the latter.  One of the two frames corresponds to + the tablelist's north-east corner and the other one to its south-west + corner.  The corner is specified by means of the optional + argument: -ne (which is the default) stands for + north-east and -sw stands for south-west.
+ +
If the corner specification has the value + -ne then the command returns the path name of the + north-east corner frame, which is designed to be shown to the + right of the tablelist widget's top-right corner when managing the + vertical scrollbar on Mac OS X Aqua or X11 (see Remark 1 below).  + This corner frame contains a label or ttk::label widget, depending on + whether the package Tablelist or Tablelist_tile is being used (see the + cornerlabelpath + subcommand).  The height of this corner frame is automatically + kept in sync with that of the tablelist's header component, and the + height of the above-mentioned (ttk::)label widget is automatically kept + in sync with that of the header labels.  Whenever the (requested) + height of the tablelist's header (and thus that of the north-east + corner frame) changes, the + <<TablelistHeaderHeightChanged>> + virtual event is generated, with its -data option + set to the (requested) height of the header for Tk versions 8.5 and + higher.
+ +
If the corner was specified as -sw + then the return value is the path name of the south-west corner + frame, which is designed to be shown just below the tablelist's + lower-left corner when managing the horizontal scrollbar if the value + of the -titlecolumns + option is positive (see Remark 2 below).  The width of this corner + frame is automatically kept in sync with the total width of the + non-hidden title columns.  When using Tablelist_tile, the + south-west corner frame will be a ttk::frame widget.labels.  + Whenever the total width of the non-hidden title columns (and thus the + requested width of the south-west corner frame) changes, the + <<TablelistTitleColsWidthChanged>> + virtual event is generated, with its -data option + set to the total width of the non-hidden title columns for Tk versions + 8.5 and higher.
+ +
+ REMARK 1:  This subcommand enables you to manage the + vertical scrollbar (if any) to appear below the tablelist widget's + header, thus respecting the native look & feel on Mac OS X Aqua and + on many modern Linux systems.  As shown in the following + example, it is recommended to always create a scrolled tablelist + along with the scrollbar(s) as children of a (ttk::)frame widget: + +
+
+# Add some entries to the Tk option database
+option add *ScrollArea.borderWidth                      1
+option add *ScrollArea.relief                           sunken
+option add *ScrollArea.Tablelist.borderWidth            0
+option add *ScrollArea.Tablelist.highlightThickness     0
+
+. . .
+
+# Create the tablelist and the scrollbars as
+# children of a frame of the class ScrollArea
+set frm [(ttk::)frame ... -class ScrollArea]
+set tbl $frm.tbl
+set vsb $frm.vsb
+set hsb $frm.hsb
+tablelist::tablelist $tbl ... \
+    -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
+(ttk::)scrollbar $vsb -orient vertical   -command [list $tbl yview]
+(ttk::)scrollbar $hsb -orient horizontal -command [list $tbl xview]
+
+. . .
+
+# Manage the widgets within the frame
+grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
+if {[string compare [tk windowingsystem] "win32"] == 0} {
+    grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
+} else {
+    grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
+    grid $vsb              -row 1 -column 1 -sticky ns
+}
+grid $hsb -row 2 -column 0 -sticky ew
+grid rowconfigure    $frm 1 -weight 1
+grid columnconfigure $frm 0 -weight 1
+
+# Manage the frame
+pack $frm -expand yes -fill both -padx 10 -pady 10
+
+
+
+ +
+ REMARK 2:  This subcommand also enables you to manage the + horizontal scrollbar (if any) to start to the right of the tablelist + widget's non-scrollable title column area if the value of the + -titlecolumns option + is positive.  In the above example, this can be achieved by + modifying its second half as follows: + +
+
+. . .
+
+# Manage the widgets within the frame
+grid $tbl -row 0 -rowspan 2 -column 0 -columnspan 2 -sticky news
+if {[string compare [tk windowingsystem] "win32"] == 0} {
+    grid $vsb -row 0 -rowspan 2 -column 2 -sticky ns
+} else {
+    grid [$tbl cornerpath] -row 0 -column 2 -sticky ew
+    grid $vsb              -row 1 -column 2 -sticky ns
+}
+grid [$tbl cornerpath -sw] -row 2 -column 0 -sticky ns
+grid $hsb                  -row 2 -column 1 -sticky ew
+grid rowconfigure    $frm 1 -weight 1
+grid columnconfigure $frm 1 -weight 1
+
+# Manage the frame
+pack $frm -expand yes -fill both -padx 10 -pady 10
+
+ +

For a tablelist widget having two header rows and one title + column, the scrollbars of the modified example will appear like in + the screenshot below (on Windows this is only valid for the + horizontal scrollbar):

+ +

Scrollbars

+
+
+ +
+ REMARK 3:  You can greatly simplify the creation of + scrolled tablelists (and other scrolled widgets) by using a scrollarea + widget, which is part of the Scrollutil package.  It + supports both static and dynamic scrollbars and respects the header + component and title columns of tablelist widgets.  With the aid + of the scrollarea widget, the rather technical code in the above + example can be replaced with just a few lines: + +
+
+package require scrollutil(_tile)
+
+. . .
+
+# Create the tablelist within a scrollarea
+set sa [scrollutil::scrollarea ...]
+set tbl $sa.tbl
+tablelist::tablelist $tbl ...
+$sa setwidget $tbl
+
+. . .
+
+# Manage the scrollarea
+pack $sa -expand yes -fill both -padx 10 -pady 10
+
+
+
+ +
pathName curcellselection + ?-all|-nonhidden|-viewable?
+ +
Returns a list containing the canonical indices (of the form + row,col, where row and + col are numbers) of all of the elements in the + tablelist that are currently selected.  If there are no such + elements in the tablelist then an empty string is returned.
+ +
The optional argument can be used to restrict the set of + currently selected elements when building the result list.  The + default value -all means: no restriction.  The + value -nonhidden filters out the elements whose row + or column has its -hide option set to true.  + Finally, the value -viewable restricts the set of + currently selected elements to the viewable + ones.
+ +
pathName + curselection + ?-all|-nonhidden|-viewable?
+ +
Returns a list containing the numerical indices of all of the items + in the tablelist that contain at least one selected element.  If + there are no such items in the tablelist then an empty string is + returned.
+ +
The optional argument can be used to restrict the set of + currently (partly) selected items when building the result list.  + The default value -all means: no restriction.  + The value -nonhidden filters out the items whose + row has its -hide option + set to true.  Finally, the value -viewable + restricts the set of currently (partly) selected items to the viewable ones.
+ +
pathName delete + firstIndex lastIndex
+ pathName delete indexList
+ +
Deletes one or more items of the tablelist if its state is not + disabled.  In the first form of the command, + firstIndex and lastIndex are + indices specifying the first and last items in the range to + delete.  The command's second form accepts a list + indexList of indices specifying the items to be + deleted.  In both cases, all descendants of the specified items + will be deleted, too.  The return value is an empty string.
+ +
pathName + deletecolumns firstColumn lastColumn
+ pathName deletecolumns + columnIndexList
+ +
Deletes one or more columns of the tablelist if its + state is not + disabled.  In the first form of the command, + firstColumn and lastColumn are + indices specifying the first and last columns in the range to + delete.  The command's second form accepts a list + columnIndexList of indices specifying the columns + to be deleted.  Returns an empty string.
+ +
pathName depth + nodeIndex
+ +
Returns the number of steps from the tree node indicated by + nodeIndex to the root + node.  The latter's depth is 0, that of the top-level rows is 1, + and so on.
+ +
pathName + descendantcount nodeIndex
+ +
Returns the number of descendants of the tree node indicated by + nodeIndex.  If this argument is specified as + root then the return value will be the number of + items of the tablelist widget.
+ +
pathName dicttoitem + dictionary
+ +
Returns a tablelist item corresponding to the dictionary indicated + by dictionary.  Each key in the specified + dictionary is expected to be a valid column index, in any of the forms + described in the COLUMN INDICES section + (e.g., a number or a column name).  The values corresponding to + the keys will be interpreted as the elements of the resulting tablelist + item.  If the number of distinct numerical equivalents of the keys + (see the columnindex + subcommand) is less than the number of columns then the elements + corresponding to the missing column indices will be set to empty + strings.
+ +
For example, if your tablelist widget has 3 columns, of + which the first two were configured with  -name forename  and  -name surname,  respectively, and you pass + the dictionary  {forename Joe  surname + Black}  to the dicttoitem subcommand, + then the return value will be the list  {Joe Black + {}}.  If the user swaps the first two columns, then, for + the same dictionary, the subcommand will return the list  + {Black Joe {}}.
+ +
This subcommand is only available in the presence of the + dict command, which is the case when using Tcl + version 8.5 or later, or one of the alternative, Tcl-only dict + implementations.
+ +
pathName editcell + cellIndex
+ +
Starts the interactive editing of the cell's content if the + tablelist's state is not + disabled and the cell is viewable and editable.  Returns an empty + string.  See the INTERACTIVE CELL + EDITING section for details on editablity and on the editing + process.
+ +
pathName + editinfo
+ +
Returns a three-element list containing information about the + tablelist cell whose content is being edited.  The first element + of the list is the full key (of the form + knumber) associated with the item containing + the tablelist element that is being edited.  The second and third + elements are the cell's row and column indices.  If currently no + cell is being edited then the return value is the list  {"" + -1 -1}.
+ +
pathName + editwinpath
+ +
Returns the path name of the temporary embedded widget used for + interactive cell editing, created by the editcell subcommand.  If no cell is + currently being edited then the return value is an empty string.  + This subcommand enables you to access the edit window from within the + commands specified by the -editstartcommand and + -editendcommand + configuration options.
+ +
pathName + editwintag
+ +
Returns the name of a binding tag whose name depends on the path + name of the tablelist widget and which is associated with some of the + components of the temporary embedded widget used for interactive cell + editing.  These components depend on the edit window: the widget + itself in case of a Tk or tile checkbutton or menubutton; the edit + window's entry children in case of a mentry widget; the only entry or + entry-like component of the edit window in all other cases (see also + the entrypath + subcommand).  This binding tag precedes the tag TablelistEdit in the list of binding + tags of the edit window components mentioned above, and is designed to + be used when defining individual binding scripts for controlling the + interactive cell editing.
+ +
+ For example, the following command will replace the standard behavior + of the Return key during cell editing in the tablelist + widget .tbl with that of the Tab key: + +
+
+bind [.tbl editwintag] <Return> "[bind TablelistEdit <Tab>]; break"
+
+
+
+ +
pathName embedcheckbutton + cellIndex ?command?
+ +
Sets the -window + option of the cell indicated by cellIndex to a + procedure that creates a frame with a checkbutton child having its + -variable option set to a global variable whose + name is private to Tablelist and is initialized with the cell's + internal value (which should be the boolean 0 or + 1).  Any change in the checkbutton's check state will + automatically set the cell's internal value to the corresponding + boolean value 0 or 1.  If the optional + command argument is a nonempty string then the + checkbutton's -command option will be set to a + script that concatenates this argument with the path name of the + tablelist widget and the cell's row and column indices and then invokes + the resulting script at idle time, thus making sure that at the time of + its invocation the cell's internal value will already be updated to + reflect the checkbutton's check state.
+ +
REMARK 1:  Remember that the + windowpath subcommand + will return the path name of the embedded window, which is a frame; to + get the checkbutton's path name, append .ckbtn to + the frame's one.
+ +
REMARK 2:  As described above, the + checkbutton's initial check state will reflect the cell's + internal value, and any change in the checkbutton's check state will + automatically update the cell.  On the other hand, if you change + the cell's internal value programmatically then it is your + responsibility to synchronize the checkbutton's check state.  To + this end you will have to retrieve the checkbutton's path name as + described above, get the name of its associated variable via  + cget -variable,  and set this variable to the + cell's internal value.
+ +
pathName + embedcheckbuttons columnIndex + ?command?
+ +
This command is logically equivalent to invoking embedcheckbutton for all body cells + of the column specified by columnIndex.
+ +
pathName + embedttkcheckbutton cellIndex + ?command?
+ +
Similar to embedcheckbutton, with the only + difference that the frame embedded into the cell will contain a + ttk::checkbutton child.
+ +
pathName + embedttkcheckbuttons columnIndex + ?command?
+ +
This command is logically equivalent to invoking embedttkcheckbutton for all body + cells of the column specified by columnIndex.
+ +
pathName + entrypath
+ +
Returns the path name of the entry or entry-like component of the + temporary embedded widget used for interactive cell editing, created by + the editcell + subcommand.  If no cell is currently being edited or the editing + is taking place with the aid of a Tk or tile checkbutton, Tk or tile + menubutton, or mentry widget, then the return value is an empty string; + otherwise it is the path name of a Tk or tile entry, text or ctext, Tk + or tile spinbox, or BWidget Entry widget, which can be the edit window + itself or one of its descendants.  This subcommand enables you to + access the entry or entry-like component of the temporary embedded + widget from within the commands specified by the -editstartcommand and + -editendcommand + configuration options.
+ +
pathName expand + indexList ?-fully|-partly?
+ +
This subcommand expands the specified rows of a tablelist used as a + tree widget, i.e., makes all their children visible.  The optional + argument -fully (which is the default) indicates + that the command will be performed recursively, i.e., all of the + descendants of the nodes specified by indexList + will be displayed.  The -partly option (which + is used by the default bindings) restricts the operation to just one + hierarchy level, indicating that only the children of the specified + nodes will be displayed, without changing the expanded/collapsed state + of the child nodes.
+ +
Before displaying the children of a row, the command + specified as the value of the -expandcommand option (if any) is + automatically concatenated with the path name of the tablelist widget + and the row index, and the resulting script is evaluated in the global + scope.  This enables you to insert a tree node's children on + demand, just before expanding it.
+ +
For technical reasons (the use of the + -elide text widget tag option for collapsing a + row), this subcommand is not supported for Tk versions earlier than + 8.3.
+ +
REMARK:  If you want to expand several rows, + it is much more efficient to do it by invoking this subcommand for the + list of their indices than by invoking it in a loop, for the individual + rows.
+ +
pathName expandall + ?-fully|-partly?
+ +
This subcommand expands all top-level rows of a tablelist used as a + tree widget, i.e., makes all their children visible.  The optional + argument -fully (which is the default) indicates + that the command will be performed recursively, i.e., all of the + descendants of the top-level nodes will be displayed.  The + -partly option restricts the operation to just one + hierarchy level, indicating that only the children of the top-level + nodes will be displayed, without changing the expanded/collapsed state + of the child nodes.
+ +
Before displaying the children of a row, the command + specified as the value of the -expandcommand option (if any) is + automatically concatenated with the path name of the tablelist widget + and the row index, and the resulting script is evaluated in the global + scope.  This enables you to insert a tree node's children on + demand, just before expanding it.
+ +
For technical reasons (the use of the + -elide text widget tag option for collapsing a + row), this subcommand is not supported for Tk versions earlier than + 8.3.
+ +
pathName + expandedkeys
+ +
Returns the list of full keys of the expanded items.
+ +
pathName fillcolumn + columnIndex text
+ +
Sets all the elements of the specified column in the tablelist body + to the value text.
+ +
pathName + findcolumnname name
+ +
Returns the index of the first column whose name (given by the + -name column configuration + option) equals name.  If no column has the + specified name then the return value is -1.
+ +
pathName + findrowname name ?-descend? ?-parent + nodeIndex?
+ +
Returns the row index of the first child of the tree node indicated + by nodeIndex whose name (given by the + -name row configuration + option) equals name.  The + -descend option extends the search to all + descendants of the tree node given by the -parent + option.  The default is to restrict the search to the parent + node's children only.  The default parent is + root.  When searching for the given name, the + items will be visited in the order of their row indices.  If none + of the relevant rows has the specified name then the return value is + -1.
+ +
pathName + finishediting
+ +
This subcommand attempts to terminate the interactive editing of + the content of the cell whose index was passed to the editcell subcommand by destroying the + temporary widget embedded into the cell and updating the cell's + content.  The exact steps involved are as follows:  First, + the widget's final text is compared to its original one.  If they + are equal then the edit window is destroyed and the cell's original + content is restored.  If the two strings are different and the + value of the -editendcommand configuration option + is a nonempty string, then the widget's final text is passed to that + command as its last argument (following the tablelist's path name as + well as the cell's row and column indices), the resulting script is + evaluated in the global scope, and the return value becomes the cell's + new content after destroying the edit window.  However, if from + within this script the rejectinput subcommand was invoked then + the cell's value is not changed and the embedded widget remains + displayed in the cell; in this case the command returns the boolean + value 0.  In all the other cases, the return value is + 1.  Immediately before returning the value + 1, the command generates the virtual event + <<TablelistCellUpdated>>.  For Tk + versions 8.5 and higher, this virtual event is generated with its + -data option set to a list consisting of the + numerical row and column indices of the cell whose content is being + edited.  If no cell was being edited when the command was invoked + then the same value 1 is returned but no virtual event is + generated.
+ +
This subcommand is called implicitly by pressing + Return or KP_Enter (together with + Control if the edit window is a text or ctext widget) when + editing a cell, or by clicking with the left mouse button anywhere in + the tablelist's body, outside the cell just being edited, or moving + into another editable cell by using keyboard navigation.  If the + editing was started with the left mouse button, the edit window is a Tk + or tile checkbutton, and the value of the -instanttoggle option is true, then + this subcommand will be invoked automatically, without any user + interaction.  Similarly, if the edit window is one of the four + combobox widgets supported by Tablelist or a menubutton widget, and the + value of the -autofinishediting option is true, + then selecting a combobox or menu entry will auomatically invoke this + subcommand and thus termate the editing session.
+ +
REMARK:  There are also situations where an + explicit invocation of this subcommand is needed, in order to + make sure that the cell just being edited gets updated with the text + entered by the user.  For example, if a tablelist widget is part + of a dialog used for editing some data, then the command associated + with the button designed to accept the data should call this + subcommand, because otherwise, if the button is pressed during + interactive cell editing then the text entered into the edit window + will get lost.
+ +
pathName + formatinfo
+ +
This command is designed to be invoked from within a Tcl command + specified as the value of the -formatcommand column configuration + option.  It returns a three-element list containing information + about the body or header cell whose content is being formatted with the + aid of that command.  The first element of the list is the full + key (of the form knumber or + hknumber) associated with the body or header + item containing the tablelist element that is being formatted.  + The second and third list elements are the cell's row (or header row) + and column indices.
+ +
+ REMARK:  This subcommand is needed in cases where the + result of the formatting should depend on the cell's row.  To be + able to use it, specify the value of the + -formatcommand column configuration option + as  [list formatCommand + pathName],  like in the following example: + +
+
+.tbl columnconfigure 1 -formatcommand [list formatValue .tbl]
+
+proc formatValue {tbl val} {
+    # Get information about the cell whose content is being formatted
+    foreach {key row col} [$tbl formatinfo] {}
+
+    # Return a string depending on $val and $row (or $key)
+    . . .
+}
+
+
+
+ +
pathName get firstIndex + lastIndex
+ pathName get indexList
+ +
The first form of the command returns a list whose elements are all + of the tablelist items (i.e., row contents) between + firstIndex and lastIndex, + inclusive.  The value returned by the second form depends on the + number of elements in the list indexList: if the + latter contains exactly one index then the return value is the + tablelist item indicated by that index (or an empty string if the index + refers to a non-existent item); otherwise the command returns the list + of all of the tablelist items corresponding to the indices specified by + indexList.
+ +
pathName getcells + firstCell lastCell
+ pathName getcells cellIndexList
+ +
The first form of the command returns a list whose elements are all + of the tablelist elements (i.e., cell contents) between + firstCell and lastCell, + inclusive.  The value returned by the second form depends on the + number of elements in the list cellIndexList: if + the latter contains exactly one cell index then the return value is the + tablelist element indicated by that cell index; otherwise the command + returns the list of all of the tablelist elements corresponding to the + cell indices specified by cellIndexList.
+ +
pathName getcolumns + firstColumn lastColumn
+ pathName getcolumns + columnIndexList
+ +
The first form of the command returns a list whose elements are + lists themselves, where each of the sublists corresponds to exactly one + column between firstColumn and + lastColumn, inclusive, and consists of all of the + tablelist body elements contained in that column.  The value + returned by the second form depends on the number of elements in the + list columnIndexList: if the latter contains + exactly one column index then the return value is a list consisting of + all of the tablelist body elements contained in the column indicated by + that column index; otherwise the command returns a list whose elements + are lists themselves, where each of the sublists corresponds to exactly + one column index in columnIndexList and consists of + all of the tablelist body elements contained in that column.
+ +
pathName + getformatted firstIndex lastIndex
+ pathName getformatted indexList
+ +
The first form of the command returns a list whose elements are all + of the formatted tablelist items (i.e., + formatted row contents) between firstIndex and + lastIndex, inclusive.  The value returned by + the second form depends on the number of elements in the list + indexList: if the latter contains exactly one index + then the return value is the formatted tablelist item indicated by that + index (or an empty string if the index refers to a non-existent item); + otherwise the command returns the list of all of the formatted + tablelist items corresponding to the indices specified by + indexList.
+ +
pathName + getformattedcells firstCell lastCell
+ pathName getformattedcells + cellIndexList
+ +
The first form of the command returns a list whose elements are all + of the formatted tablelist elements (i.e., + formatted cell contents) between firstCell and + lastCell, inclusive.  The value returned by + the second form depends on the number of elements in the list + cellIndexList: if the latter contains exactly one + cell index then the return value is the formatted tablelist element + indicated by that cell index; otherwise the command returns the list of + all of the formatted tablelist elements corresponding to the cell + indices specified by cellIndexList.
+ +
pathName + getformattedcolumns firstColumn + lastColumn
+ pathName getformattedcolumns + columnIndexList
+ +
The first form of the command returns a list whose elements are + lists themselves, where each of the sublists corresponds to exactly one + column between firstColumn and + lastColumn, inclusive, and consists of all of the + formatted tablelist body elements + contained in that column.  The value returned by the second form + depends on the number of elements in the list + columnIndexList: if the latter contains exactly one + column index then the return value is a list consisting of all of the + formatted tablelist body elements contained in the column indicated by + that column index; otherwise the command returns a list whose elements + are lists themselves, where each of the sublists corresponds to exactly + one column index in columnIndexList and consists of + all of the formatted tablelist body elements contained in that + column.
+ +
pathName + getfullkeys firstIndex lastIndex
+ pathName getfullkeys indexList
+ +
The first form of the command returns a list whose elements are all + of the full keys associated with the tablelist items between + firstIndex and lastIndex, + inclusive.  The value returned by the second form depends on the + number of elements in the list indexList: if the + latter contains exactly one index then the return value is the full key + associated with the tablelist item indicated by that index (or an empty + string if the index refers to a non-existent item); otherwise the + command returns the list of all of the full keys associated with the + tablelist items corresponding to the indices specified by + indexList.
+ +
Each item of a tablelist widget has a unique sequence + number that remains unchanged until the item is deleted, thus acting as + a key that uniquely identifies the item even if the latter's position + (i.e., numerical row index) changes.  This command provides + read-only access to the full keys obtained by prepending the letter + k to these internal item IDs.
+ +
pathName getkeys + firstIndex lastIndex
+ pathName getkeys indexList
+ +
The first form of the command returns a list whose elements are all + of the sequence numbers associated with the tablelist items between + firstIndex and lastIndex, + inclusive.  The value returned by the second form depends on the + number of elements in the list indexList: if the + latter contains exactly one index then the return value is the sequence + number associated with the tablelist item indicated by that index (or + an empty string if the index refers to a non-existent item); otherwise + the command returns the list of all of the sequence numbers associated + with the tablelist items corresponding to the indices specified by + indexList.
+ +
Each item of a tablelist widget has a unique sequence + number that remains unchanged until the item is deleted, thus acting as + a key that uniquely identifies the item even if the latter's position + (i.e., numerical row index) changes.  This command provides + read-only access to these internal item IDs.
+ +
pathName hasattrib + name
+ +
Returns 1 if the attribute name + exists and 0 otherwise.
+ +
pathName + hascellattrib cellIndex name
+ +
Returns 1 if the attribute name + for the cell given by cellIndex exists and + 0 otherwise.
+ +
pathName + hascolumnattrib columnIndex name
+ +
Returns 1 if the attribute name + for the column given by columnIndex exists and + 0 otherwise.
+ +
pathName + hasrowattrib index name
+ +
Returns 1 if the attribute name + for the row given by index exists and + 0 otherwise.
+ + + +
This command is only supported for Tk versions 8.5 and later.  + It is used to invoke various operations on the items in the widget's + header component.  The supported subcommnds are described in the + HEADER-RELATED SUBCOMMANDS section.
+ +
pathName + headerpath
+ +
This command is only supported for Tk versions 8.5 and later.  + It returns the path name of the text widget containing the header + items.
+ +
pathName + headertag
+ +
This command is only supported for Tk versions 8.5 and later.  + It returns the name of a binding tag whose name depends on the path + name of the tablelist widget and which is associated with the text + widget containing the header items, as well as the message and label + widgets used for displaying multi-line elements and images, + respectively in the header cells.  This binding tag precedes the + tag TablelistHeader + in the list of binding tags of the tablelist descendants mentioned + above, and is designed to be used when defining individual binding + scripts for tablelist widgets.  The main advantage of using this + tag instead of the path name of the text widget containing the header + items is that it enables you to write event handling scripts that are + valid not only for the above-mentioned text widget but also for the + multi-line cells and embedded images contained in it.
+ +
pathName + hidetargetmark
+ +
Hides the horizontal gap or vertical bar displayed by the + showtargetmark + command.  No error is generated if the target indicator is not + visible at the time the command is invoked.
+ +
This command is designed to be used during a drag & drop + operation for which the tablelist widget (or its body component) was + registered as a drop target.  See the DRAG & DROP SUPPORT section for details + and examples.
+ +
pathName + imagelabelpath cellIndex
+ +
Returns the path name of the label widget containing the image + embedded into the cell given by cellIndex, as + specified with the -image + option of the cellconfigure subcommand.  If no + image is currently embedded into the cell then the return value is an + empty string.
+ +
+ REMARK:  Recall that the label widgets containing + embedded images are created on demand.  Due to this fact, the + path name returned by this subcommand will only be a nonempty string + if the row containing the specified cell with an embedded image is + currently visible in the tablelist window.  Keep this in mind + whenever you need access to the label widgets containing embedded + images.  For example, to handle mouse clicks on embedded images, + you should proceed as shown in the code sample below: + +
+
+bind [.tbl bodytag] <Button-1> {printClickedImage %W %x %y}
+proc printClickedImage {w x y} { + foreach {tbl x y} [tablelist::convEventFields $w $x $y] {} + set cellIdx [$tbl containingcell $x $y] + scan $cellIdx "%d,%d" row col + if {$row >= 0 && $col >= 0 && + [string compare $w [$tbl imagelabelpath $cellIdx]] == 0} { + puts "clicked the image of cell $cellIdx" + } +} +
+
+
+ +
pathName index + index
+ +
Returns the integer row index value that corresponds to + index.  For compatibility with the Tk core + listbox, if index is end then + the return value is the number of items in the tablelist (not the index + of the last item).  To get the numerical index of the last item, + you can pass the word last as + index argument.
+ +
pathName insert + index ?item item ...?
+ +
Inserts zero or more new items in the widget's internal list just + before the item given by index if the tablelist's + state is not + disabled.  If index equals + the number of items or is specified as end then the + new items are added to the end of the widget's list.  Tabulator + characters are displayed as \t (i.e., a backslash followed + by a t) but are inserted unchanged into the internal + list.  Newline characters will force line breaks, i.e., will give + rise to multi-line elements (which are displayed in embedded message + widgets, created on demand).  The return value is the list of full + keys associated with the items just inserted.
+ +
REMARK:  This subcommand is not suitable for + inserting items into a tablelist designed for displaying a tree + hierarchy.  For such tablelist widgets use the insertchildren or insertchildlist subcommand.
+ +
pathName + insertchildlist parentNodeIndex childIndex + itemList
+ +
Inserts the items of the list itemList in the + widget's internal list of children of the node specified by + parentNodeIndex just before the item given by + childIndex if the tablelist's state is not + disabledchildIndex must + be a number, last (specifying the parent's last + child), or end; if it equals the number of children + of the node given by parentNodeIndex or is + specified as end then the new items are added to + the end of the parent's list of children.  Tabulator characters + are displayed as \t (i.e., a backslash followed by a + t) but are inserted unchanged into the internal + list.  Newline characters will force line breaks, i.e., will give + rise to multi-line elements (which are displayed in embedded message + widgets, created on demand).  The return value is the list of full + keys associated with the items just inserted.
+ +
+ This command has the same effect as + +
+
+eval [list pathName insertchildren parentNodeIndex childIndex] itemList
+
+
+
+ +
but it is more efficient and easier to use.
+ +
For technical reasons (the use of the + -elide text widget tag option for collapsing a + row), this subcommand is not supported for Tk versions earlier than + 8.3.
+ +
REMARK:  You can achieve a quite significant + speadup by using this subcommand to insert a whole list of items rather + than using multiple invocations of insertchildren.
+ +
pathName + insertchildren parentNodeIndex childIndex + ?item item ...?
+ +
Inserts zero or more new items in the widget's internal list of + children of the node specified by parentNodeIndex + just before the item given by childIndex if the + tablelist's state is not + disabledchildIndex must + be a number, last (specifying the parent's last + child), or end; if it equals the number of children + of the node given by parentNodeIndex or is + specified as end then the new items are added to + the end of the parent's list of children.  Tabulator characters + are displayed as \t (i.e., a backslash followed by a + t) but are inserted unchanged into the internal + list.  Newline characters will force line breaks, i.e., will give + rise to multi-line elements (which are displayed in embedded message + widgets, created on demand).  The return value is the list of full + keys associated with the items just inserted.
+ +
For technical reasons (the use of the + -elide text widget tag option for collapsing a + row), this subcommand is not supported for Tk versions earlier than + 8.3.
+ +
REMARK:  It is explicitly allowed to + abbreviate the name insertchildren as + insertchild.  This comes in handy when using + this subcommand to insert just one child item.
+ +
pathName + insertcolumnlist columnIndex + columnList
+ +
Inserts the columns specified by the list + columnList just before the column given by + columnIndex if the tablelist's state is not + disabled.  If columnIndex + equals the number of columns or is specified as end + then the new columns are added to the end of the column list.  The + argument columnList must be a list containing the + width, title, and optional alignment specifications for the new + columns, in the same form as in the case of the -columns configuration option.  The + return value is an empty string.  The elements of the new columns + are initially empty strings; the easiest way to change these values is + to use the fillcolumn + subcommand or the -text + column configuration option.
+ +
+ This command has the same effect as + +
+
+eval [list pathName insertcolumns columnIndex] columnList
+
+
+
+ +
but it is more efficient and easier to use.
+ +
pathName + insertcolumns columnIndex ?width title + ?alignment? width title ?alignment? + ...?
+ +
Inserts zero or more new columns just before the column given by + columnIndex if the tablelist's state is not + disabled.  If columnIndex + equals the number of columns or is specified as end + then the new columns are added to the end of the column list.  The + arguments following the column index have the same meanings as in the + case of the -columns + configuration option.  The return value is an empty string.  + The elements of the new columns are initially empty strings; the + easiest way to change these values is to use the fillcolumn subcommand or the + -text column configuration + option.
+ +
pathName insertlist + index itemList
+ +
Inserts the items of the list itemList in the + widget's internal list just before the item given by + index if the tablelist's state is not + disabled.  If index equals + the number of items or is specified as end then the + new items are added to the end of the widget's list.  Tabulator + characters are displayed as \t (i.e., a backslash followed + by a t) but are inserted unchanged into the internal + list.  Newline characters will force line breaks, i.e., will give + rise to multi-line elements (which are displayed in embedded message + widgets, created on demand).  The return value is the list of full + keys associated with the items just inserted.
+ +
+ This command has the same effect as + +
+
+eval [list pathName insert index] itemList
+
+
+
+ +
but it is more efficient and easier to use.
+ +
REMARK 1:  You can achieve a quite + significant speadup by using this subcommand to insert a whole list of + items rather than using multiple invocations of insert.
+ +
REMARK 2:  This subcommand is not suitable + for inserting items into a tablelist designed for displaying a tree + hierarchy.  For such tablelist widgets use the insertchildlist or insertchildren subcommand.
+ +
pathName + iselemsnipped cellIndex fullTextName
+ +
Returns the value 1 if the text displayed in the cell + specified by cellIndex is snipped and + 0 otherwise.  In both cases, the full (unsnipped) + cell text is stored in the variable having the name given by + fullTextName; this full text can be the cell's + content or the string obtained from the latter by using the + -formatcommand + option of the cell's column.  The most common invocation of this + command occurs within the procedure specified as the value of the + -tooltipaddcommand + configuration option.
+ +
pathName isexpanded + index
+ +
Returns the value 1 if the row indicated by + index is expanded and 0 + otherwise.
+ +
pathName + istitlesnipped columnIndex + fullTextName
+ +
Returns the value 1 if the text displayed in the + header label specified by columnIndex is snipped + and 0 otherwise.  In both cases, the full (unsnipped) + label text is stored in the variable having the name given by + fullTextName.  The most common invocation of + this command occurs within the procedure specified as the value of the + -tooltipaddcommand + configuration option.
+ +
pathName isviewable + index
+ +
Returns the value 1 if the row indicated by + index is viewable and 0 + otherwise.  A tablelist row is called viewable if the value of its + -hide option is false and + all its ancestors are (partly) expanded.   Likewise, a tablelist + cell is called viewable if its row is viewable and the value of its + column's -hide option is + false.
+ +
pathName + itemlistvar
+ +
+ Returns the name of a variable used by Tablelist to hold the internal + list associated with the widget's body.  The recommended way to + use this variable is to create a link to it with the aid of the + upvar command, like in the following example: + +
+
+upvar #0 [.tbl itemlistvar] itemList
+
+
+
+ +
In this example, the value of the variable itemList + will be the internal list associated with the body of the tablelist + widget .tbl.  Each element of the list corresponds to + one item, and it is in turn a list whose elements correspond to the + elements of that item, except that it has one additional element, + holding the item's full key.
+ +
REMARK:  The itemlistvar + command provides an efficient way for accessing this internal list, + instead of retrieving the items with the get subcommand or using the -listvariable option (these methods + consume significantly more memory).  It can be useful in + situations where the elements of a tablelist widget are to be accessed + for creating text files, HTML output, XML data, database commands, + etc.  This should, however, be a strictly readonly access; + otherwise the results will be unpredictable!
+ +
pathName itemtodict + item
+ +
Returns a dictionary built from the tablelist item indicated by + item.  The dictionary's keys will be column + numbers or names, and the values will be the corresponding elements of + the given item.  For each column number col, + if the corresponding column name (returned by  + pathName columncget + col -name)  is a nonempty string then this name will + be used as dictionary key, otherwise the numerical column index + col.
+ +
+ For example, if your tablelist widget has 3 columns, of which the + first two were configured with  -name forename  and  -name surname,  respectively, and you + pass the item + +
+
+{Joe Black "Young Man in Coffee Shop"}
+
+
+
+ +
+ to the itemtodict subcommand, then the return + value will be the dictionary + +
+
+{forename Joe  surname Black  2 {Young Man in Coffee Shop}}
+
+
+
+ +
This subcommand is only available in the presence of the + dict command, which is the case when using Tcl + version 8.5 or later, or one of the alternative, Tcl-only dict + implementations.
+ +
pathName labelpath + columnIndex
+ +
Returns the path name of the header label corresponding to the + column indicated by columnIndex.
+ +
pathName + labels
+ +
Returns a list containing the path names of all header labels of + the widget.
+ +
pathName + labeltag
+ +
Returns the name of a binding tag whose name depends on the path + name of the tablelist widget and which is associated with the header + labels as well as with the additional widgets placed by Tablelist into + the latters for displaying header images and sort arrows.  This + binding tag is designed to be used when defining non-default binding + scripts for the header labels.  From within such event handling + scripts you can retrieve the column number and the tablelist widget's + path name with the aid of the helper commands tablelist::getTablelistColumn + and tablelist::getTablelistPath.
+ +
pathName move + sourceIndex targetIndex
+ pathName move sourceIndex + targetParentNodeIndex targetChildIndex
+ +
The first form of the command moves the item indicated by + sourceIndex just before the one given by + targetIndex if the tablelist's state is not + disabled.  If targetIndex + equals the number of items or is specified as end + then the source item is moved after the last one.  The item + specified by targetIndex must have the same parent + as the one given by sourceIndex, or else it must be + the item just below the last descendant of the source node's + parent.
+ +
The command's second form moves the item indicated by + sourceIndex just before the node having the parent + indicated by targetParentNodeIndex and the index + targetChildIndex in the parent's list of children + if the tablelist's state is + not disabled.  + targetChildIndex must be a number, + last (specifying the target parent's last child), + or end; if it equals the number of children of the + target parent node or is specified as end then the + source item is moved after the target parent node's last child.
+ +
Both forms of the command preserve the node hierarchy + under the source item, by moving its descendants accordingly.  The + return value is an empty string.
+ +
pathName movecolumn + sourceColumn targetColumn
+ +
Moves the column indicated by sourceColumn just + before the one given by targetColumn if the + tablelist's state is not + disabled.  If targetColumn + equals the number of columns or is specified as end + then the source column is moved after the last one.  Returns an + empty string.
+ +
pathName nearest + y
+ +
Given a y-coordinate within the tablelist window, this command + returns the index of the viewable tablelist + body item nearest to that y-coordinate.  The coordinate + y is expected to be relative to the tablelist + window itself (not its body component).
+ +
pathName + nearestcell x y
+ +
Given an x- and a y-coordinate within the tablelist window, this + command returns the index of the viewable + tablelist body cell nearest to the point having these + coordinates.  The coordinates x and + y are expected to be relative to the tablelist + window itself (not its body component).
+ +
pathName + nearestcolumn x
+ +
Given an x-coordinate within the tablelist window, this command + returns the index of the non-hidden tablelist column nearest to that + x-coordinate.  The coordinate x is expected to + be relative to the tablelist window itself (not its body + component).
+ +
pathName noderow + parentNodeIndex childIndex
+ +
Returns the numerical row index of the node having the parent + indicated by parentNodeIndex and the index + childIndex in the parent's list of children.  + childIndex must be a number, + last (specifying the parent's last child), or + end; if it equals the number of children of the + parent node or is specified as end then the return + value will be the row index of the item following the parent node's + last descendant.
+ +
pathName parentkey + nodeIndex
+ +
Returns the full key of the parent of the tree node indicated by + nodeIndex.  If this argument is specified as + root then the return value will be an empty + string.  If nodeIndex identifies a top-level + item then the subcommand will return root.  + For all other items the return value will be a full key of the form + knumber.
+ +
pathName + refreshsorting ?parentNodeIndex?
+ +
Sorts the children of the tablelist node specified by + parentNodeIndex according to the parameters of the + most recent sort, + sortbycolumn, or + sortbycolumnlist + invocation.  If the items haven't been sorted at all, or the sort + information was reset by invoking resetsortinfo, then no sorting takes + place.  The optional argument parentNodeIndex + defaults to root, meaning that all the items are to + be sorted per default.  The return value is an empty string.
+ +
pathName + rejectinput
+ +
If invoked from within the Tcl command specified by the + -editendcommand + configuration option, then this subcommand prevents the termination of + the interactive editing of the content of the cell whose index was + passed to the editcell + subcommand.  It invokes the seecell subcommand to make sure the + respective cell becomes visible (in case it was scrolled out of view), + and sets the focus to the temporary widget embedded into the + cell.  This command enables you to reject the widget's text during + the final validation of the string intended to become the new cell + content.  The return value is an empty string.
+ +
pathName + resetsortinfo
+ +
Resets the information about the sorting of the items.  + Subsequent invocations of sortcolumn and sortorder will return -1 and + an empty string, respectively.  Similarly, subsequent invocations + of sortcolumnlist and + sortorderlist will + return an empty string.  This command also removes any existing + up- or down-arrows displayed by an earlier invocation of + sortbycolumn or + sortbycolumnlist.  The return + value is an empty string.
+ +
pathName + restorecursor
+ +
Sets the -cursor configuration option to the + value that it had before invoking the setbusycursor subcommand and returns + the boolean value 1.  If there was no previous + setbusycursor invocation or this is not the first + restorecursor invocation since the most recent call + to setbusycursor, then the command returns the + value 0, without attempting to restore the cursor.
+ +
pathName rowattrib + index ?name? ?value name value + ...?
+ +
Queries or modifies the attributes of the row given by + index.  If no name is + specified, the command returns a list of pairs, each of which contains + the name and the value of an attribute for the row.  If + name is specified with no + value, then the command returns the value of the + one named row attribute, or an empty string if no corresponding value + exists (you can use the hasrowattrib subcommand to distinguish + this case from the one that the value of an existing row + attribute is an empty string).  If one or more + name-value pairs are specified, + then the command sets the given row attribute(s) to the given value(s); + in this case the return value is an empty string.  + name may be an arbitrary string.
+ +
pathName rowcget + index option
+ +
Returns the current value of the row configuration option given by + option for the row specified by + indexoption may have + any of the values accepted by the rowconfigure command.
+ +
pathName + rowconfigure index ?option? ?value + option value ...?
+ +
Queries or modifies the configuration options of the row given by + index.  If no option is + specified, the command returns a list describing all of the available + options for the row (see Tk_ConfigureInfo for + information on the format of this list).  If + option is specified with no + value, then the command returns a list describing + the one named option (this list will be identical to the corresponding + sublist of the value returned if no option is + specified).  If one or more + option-value pairs are + specified, then the command modifies the given row option(s) to have + the given value(s); in this case the return value is an empty + string.  option may have any of the values + described in the ROW CONFIGURATION OPTIONS IN + THE TABLELIST BODY section.
+ +
pathName scan + option args
+ +
This command is used to implement scanning on tablelist + widgets.  It has two forms, depending on + option:
+ +
+
+
pathName scan mark x + y
+ +
Records x and y and the + current view in the tablelist window; used in conjunction with + later  scan dragto  + commands.  Typically this command is associated with a mouse + button press in the body component of the widget.  It returns + an empty string.  The coordinates x and + y are expected to be relative to the tablelist + window itself (not its body component).
+ +
pathName scan dragto x + y
+ +
This command computes the difference between its + x and y arguments to the + last  scan mark  command for + the widget.  It then adjusts the view (the vertical one only + in the body component) by 10 times the difference in + coordinates.  This command is typically associated with mouse + motion events in the body component of the widget, to produce the + effect of dragging the table at high speed through the + window.  The return value is an empty string.  The + coordinates x and y are + expected to be relative to the tablelist window itself (not its + body component).
+
+
+ +
pathName + searchcolumn columnIndex pattern + ?options?
+ +
This subcommand searches the body elements of the column given by + columnIndex to see if one of them matches + pattern.  If a match is found, the row index + of the first matching element is returned as result (unless the option + -all is specified).  If not, the return value + is -1.  One or more of the following options may be + specified to control the search:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-allChanges the result to be the list of all matching row + indices, which will be in numeric order (or in reverse numeric + order when used with the -backwards + option).
-backwardsThe search will proceed backward through the given column's + elements in the tablelist's body.
-check commandSpecifies an additional condition to be fulfilled by the + matching elements.  If an element of the specified column + matches the given pattern and command is a nonempty + string, then the latter is automatically concatenated with the + path name of the tablelist widget, the element's row index, the + numerical equivalent of columnIndex, as well + as the element itself or its formatted version (depending on the presence + of the -formatted option), the resulting + script is evaluated in the global scope, and the return value + (which must be a boolean) will determine whether the element in + question will still be viewed as matching or not.  The + default command is an empty string.  This option + enables you to pass arbitrary additional matching criteria to the + searching process.
-descendSearch the elements of the specified column in all + descendants of the tree node given by the + -parent option.  The elements will be + visited in the order of their row indices (or in reverse order of + their row indices when used with the + -backwards option).  The default is to + restrict the search to the parent node's children only.
-exactThe matching element(s) must be identical to the literal + string pattern.
-formattedExamine the formatted versions + of the elements rather than the internal cell values.
-globTreat pattern as a glob-style pattern and + match it against the elements using the same rules as the  + string match  command.
-nocaseCauses comparisons to be handled in a case-insensitive + manner.  Has no effect if combined with the + -numeric option.
-notThis option negates the sense of the match, returning the row + index of the first non-matching element (or, in the presence of + the -all option, the list of row indices of + all non-matching elements) of the given column.
-numericThe elements are to be compared to + pattern as integer or floating-point values, + using the == comparison operator.  This + option is only meaningful when used with + -exact.
-parent + nodeIndex  This option restricts the search to the children (or + descendants, when used with -descend) of the + tree node given by nodeIndex.  The + default parent is root.
-regexpTreat pattern as a regular expression and + match it against the elements using the rules described in the + re_syntax reference page.
-start indexThe elements of the specified column are to be searched + (forwards or backwards) starting at the row given by + index.  This option makes it easy to + provide incremental search.
+
+ +
If all matching style options + -exact, -glob, and + -regexp are omitted then the matching style + defaults to -glob.  If more than one of them + is specified, the last matching style given takes precedence.
+ +
Before examining the children (or descendants, when used + with the -descend option) of a row whose children + have not been inserted yet, the command specified as the value of the + -populatecommand + option (if any) is automatically concatenated with the path name of the + tablelist widget and the row index, and the resulting script is + evaluated in the global scope.  This enables you to insert the + children on demand, just before searching them for the specified + pattern.
+ +
pathName see + index
+ +
Adjusts the view in the tablelist body so that the item given by + index is visible.  If the item is already + visible then the command has no effect; if the item is near one edge of + the window then the tablelist scrolls to bring the item into view at + the edge; otherwise the tablelist scrolls to center the item.
+ +
pathName seecell + cellIndex
+ +
Adjusts the view in the tablelist body so that the cell given by + cellIndex is visible.  If the cell is already + visible then the command has no effect; if the cell is near one edge of + the window then the tablelist scrolls to bring the cell into view at + the edge; otherwise the tablelist scrolls to center the cell.  If + the value of the -titlecolumns option is positive then + the centering of the cell is only done vertically; the horizontal + scrolling (which in this case is performed column-wise) will just bring + the cell into view next to the title columns or at the right edge of + the window.
+ +
pathName seecolumn + columnIndex
+ +
Adjusts the view in the tablelist so that the column given by + columnIndex is visible.  If the column is + already visible then the command has no effect; if the column is near + one edge of the window then the tablelist scrolls horizontally to bring + the column into view at the edge; otherwise the tablelist scrolls + horizontally to center the column.  If the value of the + -titlecolumns option is + positive then the horizontal scrolling (which in this case is performed + column-wise) will just bring the column into view next to the title + columns or at the right edge of the window.
+ +
pathName selection + option args
+ +
This command is used to adjust the selection within the body of a + tablelist widget.  It has several forms, depending on + option:
+ +
+
+
pathName selection anchor + index
+ +
Sets the selection anchor to the item given by + index.  If index + refers to a nonexistent or non-viewable + item, then the closest viewable item is used.  The selection + anchor is the end of the selection that is fixed while dragging out + a selection with the mouse if the selection type is + row.  The index anchor + may be used to refer to the anchor item.
+ +
pathName selection clear + firstIndex lastIndex
+ pathName selection clear + indexList
+ +
If any of the items between firstIndex and + lastIndex (inclusive) or corresponding to the + indices specified by the list indexList contain + at least one selected cell, they are deselected.  The + selection state is not changed for items outside the range given in + the first form of the command or different from those specified by + the index list given in its second form.
+ +
pathName selection includes + index
+ +
Returns 1 if the item indicated by + index contains at least one selected cell, + 0 if it doesn't.
+ +
pathName selection set + firstIndex lastIndex
+ pathName selection set + indexList
+ +
Selects all of the selectable items in the range between + firstIndex and lastIndex, + inclusive, or corresponding to the indices specified by the list + indexList, without affecting the selection + state of any other items.
+
+
+ +
If the tablelist's state is disabled and + option is different from + includes then the command just returns an empty + string, without performing any of the above actions.
+ +
pathName + separatorpath ?columnIndex?
+ +
If the optional argument is not specified, then this command + returns the path name of the special separator displayed to mark the + end of the title columns if the value of the -titlecolumns option is positive and an + empty string otherwise.  If the optional argument is present, then + the command returns the path name of the separator attached to the + right edge of the header label indicated by + columnIndex if the value of the -showseparators configuration option + is true and an empty string otherwise.
+ +
pathName + separators
+ +
Returns a list containing the path names of all column + separators.  If the value of the -titlecolumns option is positive then + the first element of the list will be the path name of the special + separator displayed to mark the end of the title columns.  Whether + the path names of the other separators are included in the list, + depends on the value of the -showseparators configuration + option.
+ +
pathName + setbusycursor
+ +
Saves the current value of the -cursor + configuration option and then sets this option to the name of a + windowing system-specific busy cursor (watch or + wait).  Since this subcommand is designed to + be invoked just before starting an operation that can take a long time + to complete, it also makes sure that the new cursor will immediately + get visible, by calling  update + idletasks.  In the rare but possible case that, as a + side effect of this invocation, the tablelist widget gets destroyed by + some application-specific action scheduled for execution at idle time, + the command returns the boolean value 0, otherwise the + value 1.
+ +
pathName + showtargetmark before|inside + index
+ +
Displays a drop target indicator having the form of a horizontal + gap or vertical bar before or inside the row specified by + index.  If the subcommand's name is followed + by before and index equals the + number of items or is specified as end then the + horizontal gap will be shown just after the tablelist's last + row.  If the subcommand is used with the + inside option then the index + end is interpreted as indicating the widget's last + item.
+ +
This command is designed to be used during a drag & drop + operation for which the tablelist widget (or its body component) was + registered as a drop target.  See the DRAG & DROP SUPPORT section for details + and examples.
+ +
pathName size
+ +
Returns the total number of items in the tablelist body.
+ +
pathName sort + ?-increasing|-decreasing?
+ +
Sorts the body items in increasing or decreasing order, as + specified by the optional argument.  The default is + -increasing.  Uses the value of the + -sortcommand widget + configuration option as comparison command.  + sort also removes any existing up- or down-arrows + displayed by an earlier invocation of sortbycolumn or sortbycolumnlist.  After + sorting the items, the command conditionally adjusts the vertical view + as follows: (a) if interactive cell editing is in progress then the + cell being edited is brought into view; (b) else, if exactly one item + is selected then the view is shifted to bring that item into view; (c) + else, if the tablelist's body is the most recent window to have the + input focus among all the windows in the same toplevel as the widget + itself then the currently active item is brought into view.
+ +
pathName + sortbycolumn columnIndex + ?-increasing|-decreasing?
+ +
Sorts the body items based on the elements of the column given by + columnIndex, in increasing or decreasing order, as + specified by the optional argument.  The default is + -increasing.  The sorting process is + controlled by the values of the -sortmode and -sortcommand options for the given + column.  If both the value of the -showarrow configuration option and that of + the -showarrow option + for the specified column are true then an up- or down-arrow indicating + the sort order will be placed into the column's label.  The shape + of the arrow depends on the command's optional argument and on the + value of the -incrarrowtype configuration + option.  If the label's text is right-aligned then the arrow will + be displayed on the left side of the label, otherwise on its right + side, with the exception of Windows Vista, 7, 8, and 10, where the + arrow will be shown horizontally centered in the header label and + attached to its top edge.  After sorting the items, the vertical + view is adjusted in the same way as in the case of the + sort subcommand.
+ +
The actions described above are only performed if the + specified column's -showlinenumbers option hasn't + been set to true.
+ +
pathName + sortbycolumnlist columnIndexList + ?sortOrderList?
+ +
Sorts the body items based on the elements of the columns given by + the columnIndexList argument, which must be a list + of distinct column indices.  Only those elements of this list are + considered significant that identify columns whose -showlinenumbers option hasn't + been set to true.
+ +
The items are first sorted based on the column specified + by the last significant element of columnIndexList, + then based on the one given by the last but one significant element, + and so on.  The order of each sort operation is taken from the + optional argument sortOrderList, whose elements + must be (abbreviations of) increasing or + decreasing.  If this argument was not + specified or contains less elements than + columnIndexList then the missing sort orders are + assumed to be increasing.  Each sorting + process is controlled by the values of the -sortmode and -sortcommand options for the + respective column.  If the column's index was specified among the + first 9 significant elements of columnIndexList and + both the value of the -showarrow configuration option and that of + the -showarrow option + for that column are true then an up- or down-arrow indicating the sort + order will be placed into the column's label.  The shape of the + arrow depends on the respective sort order and on the value of the + -incrarrowtype + configuration option.  If the label's text is right-aligned then + the arrow will be displayed on the left side of the label, otherwise on + its right side, with the exception of Windows Vista, 7, 8, and 10, + where the arrow will be shown horizontally centered in the header label + and attached to its top edge.  If more than one sort arrows are to + be displayed then the first 9 sort ranks (1 for the first + significant element of columnIndexList, + 2 for the second one, and so on) will also be shown to the + right of the arrows.  After sorting the items, the vertical view + is adjusted in the same way as in the case of the sort subcommand.
+ +
pathName + sortcolumn
+ +
Returns the numerical index of the column by which the items were + last sorted with the aid of the sortbycolumn or sortbycolumnlist command, or + -1 if they were last sorted with the sort command or haven't been sorted at all, or + the sort information was reset by invoking resetsortinfo.  If called from + within the command specified as the value of the + -sortcommand widget or + column configuration option, then the + return value of this subcommand refers to the sorting in progress + rather than the most recent one.
+ +
pathName + sortcolumnlist
+ +
Returns a list consisting of the numerical indices of the columns + by which the items were last sorted with the aid of the + sortbycolumnlist or + sortbycolumn command + (in the second case the list will contain exactly one element), or an + empty string if they were last sorted with the sort command or haven't been sorted at all, or + the sort information was reset by invoking resetsortinfo.  If called from + within the command specified as the value of the + -sortcommand widget or + column configuration option, then the + return value of this subcommand refers to the sorting in progress + rather than the most recent one.
+ +
pathName + sortorder
+ +
Returns the sort order (as increasing or + decreasing) from the last sorting performed by the + sort, sortbycolumn, or sortbycolumnlist command, or an + empty string if the items haven't been sorted at all, or the sort + information was reset by invoking resetsortinfo.  If called from + within the command specified as the value of the + -sortcommand widget or + column configuration option, then the + return value of this subcommand refers to the sorting in progress + rather than the most recent one.
+ +
pathName + sortorderlist
+ +
Returns a list consisting of the sort orders (as + increasing or decreasing) from + the last invocation of the sortbycolumnlist or + sortbycolumn command + (in the second case the list will contain exactly one element), or an + empty string if the items were last sorted with the sort command or haven't been sorted at all, or + the sort information was reset by invoking resetsortinfo.  If called from + within the command specified as the value of the + -sortcommand widget or + column configuration option, then the + return value of this subcommand refers to the sorting in progress + rather than the most recent one.
+ +
pathName + targetmarkpath
+ +
Returns the path name of the drop target indicator (displayed as a + horizontal gap or vertical bar) belonging to the tablelist's body.
+ +
pathName + targetmarkpos y + ?-any|-horizontal|-vertical?
+ +
Given a y-coordinate within the tablelist window, this command + returns a two-element list containing the arguments to be passed to the + showtargetmark + subcommand in order to display the drop target indicator corresponding + to that y-coordinate.  The first list element will be the string + before or inside, and the + second one a numerical row index.  These list elements depend on + the relative position of y within the containing + row (if any), as well as on the optional second argument:  The + default option -any allows both + before and inside as first + element of the result list, while the options + -horizontal and -vertical + restrict the value of the first list element to + before and inside, + respectively.  If the option -vertical was + specified and no item of the tablelist's body contains the given + y-position, then the return value is the list  + {inside -1}.  The coordinate + y is expected to be relative to the tablelist + window itself (not its body component).
+ +
This command is designed to be used during a drag & drop + operation for which the tablelist widget (or its body component) was + registered as a drop target.  See the DRAG & DROP SUPPORT section for details + and examples.
+ +
pathName + togglecolumnhide firstColumn lastColumn
+ pathName togglecolumnhide + columnIndexList
+ +
Toggles the value of the -hide option for one or more columns of the + tablelist widget.  In the first form of the command, + firstColumn and lastColumn are + indices specifying the first and last columns in the range whose + visibility is to be toggled.  The command's second form accepts a + list columnIndexList of indices specifying the + columns whose visibility is to be toggled.  Returns an empty + string.  After toggling the hidden state of the specified columns, + the <<TablelistColHiddenStateChanged>> + virtual event is generated.  For Tk versions 8.5 and higher, this + virtual event is generated with its -data option + set to a list consisting of the numerical column indices of the columns + whose -hide option was toggled.  The main + advantage of using this command instead of invoking columnconfigure for each of the + specified columns is that it causes only one redisplay of the widget's + content, thus being significantly faster.
+ +
pathName + togglerowhide firstIndex lastIndex
+ pathName togglerowhide indexList
+ +
Toggles the value of the -hide option for one or more rows of the + tablelist widget's body.  In the first form of the command, + firstIndex and lastIndex are + indices specifying the first and last rows in the range whose + visibility is to be toggled.  The command's second form accepts a + list indexList of indices specifying the rows whose + visibility is to be toggled.  Returns an empty string.  After + toggling the hidden state of the specified rows, the + <<TablelistRowHiddenStateChanged>> + virtual event is generated.  For Tk versions 8.5 and higher, this + virtual event is generated with its -data option + set to a list consisting of the numerical row indices of the rows whose + -hide option was toggled.  Just like the + -hide row configuration option, this subcommand is + not supported for Tk versions earlier than 8.3.
+ +
CAUTION:  Tk versions 8.3 - 8.4.12 had a bug + that caused a segmentation fault if the whole content of a text widget + was elided.  This bug was also present in Tk 8.5.a1 - + 8.5.a3.  When using one of these earlier Tk versions, this bug + will produce a crash if all the rows of a tablelist widget are + hidden.  It is your responsibility to avoid such situations when + using a Tk version having this bug!
+ +
pathName + toplevelkey index
+ +
If the item identified by index is a top-level + one then the subcommand returns the full key of that item.  + Otherwise the return value is the full key of the unique top-level item + having the given item among its descendants.
+ +
pathName + unsetattrib name
+ +
Unsets the attribute name.  Returns an + empty string.
+ +
pathName + unsetcellattrib cellIndex name
+ +
Unsets the attribute name for the cell given by + cellIndex.  Returns an empty string.
+ +
pathName + unsetcolumnattrib columnIndex name
+ +
Unsets the attribute name for the column given + by columnIndex.  Returns an empty string.
+ +
pathName + unsetrowattrib index name
+ +
Unsets the attribute name for the row given by + index.  Returns an empty string.
+ +
pathName + viewablerowcount ?firstIndex + lastIndex?
+ +
Returns the number of viewable rows in + the index range given by firstIndex and + lastIndex.  If these optional indices are not + specified then firstIndex defaults to + 0 and lastIndex defaults to one less + the total number of body items, i.e., the index range comprises all + rows of the tablelist's body.
+ +
pathName windowpath + cellIndex
+ +
Returns the path name of the window contained in the cell given by + cellIndex, created with the -window option of the cellconfigure subcommand.  If no + window is currently embedded into the cell then the return value is an + empty string.
+ +
pathName xview + ?args?
+ +
This command is used to query and change the horizontal position of + the information in the widget's window.  It can take any of the + following forms:
+ +
+
+
pathName xview
+ +
Returns a list containing two elements.  Each element is a + real fraction between 0 and 1; together + they describe the horizontal span that is visible in the + window.  For example, if the first element is 0.2 + and the second element is 0.6, 20% of the tablelist's + scrollable text is off-screen to the left, the middle 40% is + visible in the window, and 40% of the scrollable text is off-screen + to the right.  These are the same values passed to scrollbars + via the -xscrollcommand option.
+ +
pathName xview + units
+ +
If the value of the -titlecolumns option is positive + then this command adjusts the view in the window so that the column + whose offset from the end of the title column area equals + units non-hidden columns is displayed next to + the title columns.  Otherwise the command adjusts the view in + the window so that the character position given by + units is displayed at the left edge of the + window.  Character positions are defined by the width of the + character 0.
+ +
pathName xview moveto + fraction
+ +
Adjusts the view in the window so that + fraction of the total width of the scrollable + tablelist text is off-screen to the left.  + fraction must be a fraction between + 0 and 1.
+ +
pathName xview scroll number + what
+ +
This command shifts the view in the window left or right + according to number and + whatnumber must be + an integer.  what must be either + units or pages or an + abbreviation of one of these.  If what is + units, the view adjusts left or right by + number non-hidden columns or character units + (the width of the 0 character) on the display, + depending on the value of the -titlecolumns option; if + what is pages then the view + adjusts by number screenfuls.  If + number is negative then columns or characters + farther to the left become visible; if it is positive then columns + or characters farther to the right become visible.
+
+
+ +
pathName yview + ?args?
+ +
This command is used to query and change the vertical position of + the text in the window of the widget's body component.  It can + take any of the following forms:
+ +
+
+
pathName yview
+ +
Returns a list containing two elements, both of which are real + fractions between 0 and 1.  The + first element gives the position of the viewable tablelist item at the top of the window, + relative to the tablelist as a whole (0.5 means it is + halfway through the tablelist, for example).  The second + element gives the position of the viewable tablelist item just + after the last one in the window, relative to the tablelist as a + whole.  These are the same values passed to scrollbars via the + -yscrollcommand option.
+ +
pathName yview + units
+ +
Adjusts the view in the window so that the item whose offset + equals units viewable + rows is displayed at the top of the window.
+ +
pathName yview moveto + fraction
+ +
Adjusts the view in the window so that the viewable item given by + fraction appears at the top of the + window.  fraction is a fraction between + 0 and 1; 0 indicates the + first viewable item in the tablelist, 0.33 indicates + the viewable item one-third the way through the tablelist, and so + on.
+ +
pathName yview scroll number + what
+ +
This command shifts the view in the window up or down according + to number and what.  + number must be an integer.  + what must be either units + or pages or an abbreviation of one of + these.  If what is + units, the view adjusts up or down by + number viewable rows; + if it is pages then the view adjusts by + number screenfuls.  If + number is negative then earlier items become + visible; if it is positive then later items become visible.
+
+
+
+
+ +
HEADER-RELATED SUBCOMMANDS
+ +
+ The header tablelist command, + used to invoke various operations on the header items, has the following + general form: + +
+
+pathName header option ?arg arg ...?
+
+
+
+ +
option and the args determine + the exact behavior of the command.  The following subcommands are + supported for the tablelist header:
+ +
+
+
pathName header bbox + headerIndex
+ +
Similar to the bbox command + for the tablelist body.
+ +
pathName header + cellattrib headerCellIndex ?name? ?value + name value ...?
+ +
Similar to the cellattrib command for the tablelist + body.
+ +
pathName header + cellbbox headerCellIndex
+ +
Similar to the cellbbox + command for the tablelist body.
+ +
pathName header + cellcget headerCellIndex option
+ +
Similar to the cellcget + command for the tablelist body.  option may + have any of the values accepted by the  header cellconfigure  + subcommand.
+ +
pathName header + cellconfigure headerCellIndex ?option? value + option value ...?
+ +
Similar to the cellconfigure command for the tablelist + body.  Each option may have any of the values + described in the CELL CONFIGURATION OPTIONS + IN THE TABLELIST HEADER section.
+ +
pathName header + cellindex headerCellIndex
+ +
Similar to the cellindex command for the tablelist + body.
+ +
pathName header + configcelllist headerCellConfigSpecList
+ +
+ Similar to the configcelllist command for the + tablelist body.  The argument + headerCellConfigSpecList must be a list of the + form + +
+
+headerCellIndex option value headerCellIndex option value ...
+
+
+
+ +
where each option may have any of the values + described in the CELL CONFIGURATION OPTIONS + IN THE TABLELIST HEADER section.
+ +
pathName header + configcells ?headerCellIndex option value + headerCellIndex option value ...?
+ +
Similar to the configcells command for the tablelist + body.  Each option may have any of the values + described in the CELL CONFIGURATION OPTIONS + IN THE TABLELIST HEADER section.
+ +
pathName header + configrowlist headerRowConfigSpecList
+ +
+ Similar to the configrowlist command for the + tablelist body.  The argument + headerRowConfigSpecList must be a list of the + form + +
+
+headerIndex option value headerIndex option value ...
+
+
+
+ +
where each option may have any of the values + described in the ROW CONFIGURATION OPTIONS + IN THE TABLELIST HEADER section.
+ +
pathName header + configrows ?headerIndex option value + headerIndex option value ...?
+ +
Similar to the configrows command for the tablelist + body.  Each option may have any of the values + described in the ROW CONFIGURATION OPTIONS + IN THE TABLELIST HEADER section.
+ +
pathName header + containing y
+ +
Similar to the containing command for the tablelist + body.
+ +
pathName header + containingcell x y
+ +
Similar to the containingcell command for the + tablelist body.
+ +
pathName header + delete firstHeaderIndex lastHeaderIndex
+ pathName header delete + headerIndexList
+ +
Similar to the delete + command for the tablelist body.
+ +
pathName + header embedcheckbutton headerCellIndex + ?command?
+ +
Similar to the embedcheckbutton command for the + tablelist body.
+ +
pathName + header embedcheckbuttons columnIndex + ?command?
+ +
Similar to the embedcheckbuttons command for the + tablelist body.  Logically equivalent to invoking  + header + embedcheckbutton  for all header cells of the + column specified by columnIndex.
+ +
pathName + header embedttkcheckbutton headerCellIndex + ?command?
+ +
Similar to the embedttkcheckbutton command for + the tablelist body.
+ +
pathName + header embedttkcheckbuttons columnIndex + ?command?
+ +
Similar to the embedttkcheckbutton command for + the tablelist body.  Logically equivalent to invoking  + header + embedttkcheckbutton  for all header cells of the + column specified by columnIndex.
+ +
pathName header + fillcolumn columnIndex text
+ +
Similar to the fillcolumn command for the tablelist + body.
+ +
pathName header + findrowname name
+ +
Similar to the findrowname command for the tablelist + body.  Returns the header row index of the first header item whose + name equals name.
+ +
pathName header get + firstHeaderIndex lastHeaderIndex
+ pathName header get + headerIndexList
+ +
Similar to the get command + for the tablelist body.
+ +
pathName header + getcells firstHeaderCell lastHeaderCell
+ pathName header getcells + headerCellIndexList
+ +
Similar to the getcells + command for the tablelist body.
+ +
pathName header + getcolumns firstColumn lastColumn
+ pathName header getcolumns + columnIndexList
+ +
Similar to the getcolumns command for the tablelist + body.
+ +
pathName header + getformatted firstHeaderIndex + lastHeaderIndex
+ pathName header getformatted + headerIndexList
+ +
Similar to the getformatted command for the tablelist + body.
+ +
pathName + header getformattedcells firstHeaderCell + lastHeaderCell
+ pathName header getformattedcells + headerCellIndexList
+ +
Similar to the getformattedcells command for the + tablelist body.
+ +
pathName + header getformattedcolumns firstColumn + lastColumn
+ pathName header getformattedcolumns + columnIndexList
+ +
Similar to the getformattedcolumns command for + the tablelist body.
+ +
pathName header + getfullkeys firstHeaderIndex + lastHeaderIndex
+ pathName header getfullkeys + headerIndexList
+ +
Similar to the getfullkeys command for the tablelist + body.  Remember that the full keys of the header items start with + hk.
+ +
pathName header + getkeys firstHeaderIndex lastHeaderIndex
+ pathName header getkeys + headerIndexList
+ +
Similar to the getkeys + command for the tablelist body.
+ +
pathName header + hascellattrib headerCellIndex name
+ +
Similar to the hascellattrib command for the tablelist + body.
+ +
pathName header + hasrowattrib headerIndex name
+ +
Similar to the hasrowattrib command for the tablelist + body.
+ +
pathName header + imagelabelpath headerCellIndex
+ +
Similar to the imagelabelpath command for the + tablelist body.
+ +
pathName header index + headerIndex
+ +
Similar to the index + command for the tablelist body.
+ +
pathName header + insert headerIndex ?item item ...?
+ +
Similar to the insert + command for the tablelist body.
+ +
pathName header + insertlist headerIndex itemList
+ +
Similar to the insertlist command for the tablelist + body.
+ +
pathName header + iselemsnipped headerCellIndex + fullTextName
+ +
Similar to the iselemsnipped command for the tablelist + body.
+ +
pathName header + itemlistvar
+ +
Similar to the itemlistvar command for the tablelist + body.
+ +
pathName header + nearest y
+ +
Similar to the nearest + command for the tablelist body.
+ +
pathName header + nearestcell x y
+ +
Similar to the nearestcell command for the tablelist + body.
+ +
pathName header + rowattrib headerIndex ?name? ?value + name value ...?
+ +
Similar to the rowattrib command for the tablelist + body.
+ +
pathName header + rowcget index option
+ +
Similar to the rowcget + command for the tablelist body.  option may + have any of the values accepted by the  header rowconfigure  + subcommand.
+ +
pathName header + rowconfigure headerIndex ?option? ?value + option value ...?
+ +
Similar to the rowconfigure command for the tablelist + body.  Each option may have any of the values + described in the ROW CONFIGURATION OPTIONS + IN THE TABLELIST HEADER section.
+ +
pathName header + size
+ +
Similar to the size command + for the tablelist body.
+ +
pathName header + unsetcellattrib headerCellIndex name
+ +
Similar to the unsetcellattrib command for the + tablelist body.
+ +
pathName header + unsetrowattrib headerIndex name
+ +
Similar to the unsetrowattrib command for the + tablelist body.
+ +
pathName header + windowpath headerCellIndex
+ +
Similar to the windowpath command for the tablelist + body.
+
+
+ +
DEFAULT AND INDIVIDUAL BINDINGS FOR + THE TABLELIST BODY
+ +
+ The body component of a tablelist is implemented as a text widget whose + binding tag Text is replaced with a new binding tag + called TablelistBody.  The latter has all the + events of the Listbox widget class, and several of + its binding scripts are obtained from those of + Listbox by replacing the event fields + %W, %x, and + %y with the path name of the tablelist widget and the + x and y coordinates relative to the latter.  These values are + assigned to the help variables tablelist::W, + tablelist::x, and tablelist::y by + invoking the helper command tablelist::convEventFields + as follows: + +
+
+foreach {tablelist::W tablelist::x tablelist::y} \
+    [tablelist::convEventFields %W %x %y] {}
+
+
+
+ +
This conversion of the event fields is necessary because the Tcl + command associated with a tablelist expects any coordinates relative to the + widget itself, not its body component.  It makes use of help variables + from the tablelist namespace in order to avoid any + conflicts with global variables.
+ +
+ Several of the events have no %x and + %y fields; in this case another helper command + tablelist::getTablelistPath + is used to set the help variable tablelist::W to the + path name of the tablelist widget: + +
+
+set tablelist::W [tablelist::getTablelistPath %W]
+
+
+
+ +
The binding tag TablelistBody replaces the class + name (Frame or TSeparator) of the + separator widgets, too.  It also replaces the binding tag + Message of the message widgets used to display + multi-line elements, as well as the binding tag Label + of the label widgets used to display embedded images.  This makes sure + that the default handling of the mouse events on the column separators, + multi-line cells, and embedded images is the same as in the rest of the + tablelist's body.
+ +
+ When defining individual bindings for tablelist widgets, the same + conversion of the event fields is needed as for the default + bindings.  For example, the binding script below for the tablelist + widget .tbl prints the index of the cell where mouse button + 1 was clicked: + +
+
+bind [.tbl bodytag] <Button-1> {printClickedCell %W %x %y}
+proc printClickedCell {w x y} { + foreach {tbl x y} [tablelist::convEventFields $w $x $y] {} + puts "clicked on cell [$tbl containingcell $x $y]" +
+
+
+ +
By associating the script with the binding tag returned by the + bodytag subcommand instead of + just with the path name of the tablelist's body we make sure to have the + same event handling for the separators, multi-line cells, and embedded + images as for the rest of the tablelist's body.
+ +
COMPATIBILITY WITH THE listbox WIDGET:  The + default bindings associated with the binding tag + TablelistBody ensure that the body component of a + tablelist has the same behavior as a Tk core listbox widget.  Whether + this is strictly valid, is controlled by the boolean variable + tablelist::strictTk.  For improved + user-friendliness and compatibility with other frameworks, this variable + has the default value 0, which enables a few + Tablelist-specific extensions and changes:
+ +
+
    +
  • If tablelist::strictTk is true then + all default bindings associated with the binding tag + TablelistBody give rise to exactly the same + behavior as the default bindings associated with the binding tag + Listbox.
  • + +
  • If tablelist::strictTk is false + then, in all selection modes, the selection state of individual + tablelist items or elements (depending on the selection type) can be + toggled with the aid of Control-Button-1, + Control-space, and Control-Select (see + below).
  • +
+
+ +
BINDINGS FOR THE SELECTION TYPE + row:  If the selection type is + row (which is the default) then everything described in + the "DEFAULT BINDINGS" section of the listbox manual entry applies + to the body component of a tablelist, too.  The only difference is + that the word "element" in that manual page has to be replaced with "item" + when applying the description to the body of a tablelist widget.  In + addition:
+ +
+
    +
  1. If tablelist::strictTk is false + (which is the default) then pressing button 1 with the + Control key down toggles the selection state of the item + under the mouse.  If the selection mode is + extended then additional actions apply, as + described in the listbox manual entry.  If the selection + mode is single or browse and + the selection state of the item changes from unselected to selected + then any other selected items will be deselected, just as if button 1 + had been pressed without the Control key down.
  2. + +
  3. Again, if tablelist::strictTk is + false, then Control-space and Control-Select + toggle the selection state of the active item just as if button 1 had + been pressed over this item with the Control key + down.
  4. +
+
+ +
BINDINGS FOR THE SELECTION TYPE + cell:  If the selection type is + cell then everything described in the "DEFAULT + BINDINGS" section of the listbox manual entry applies to the body + component of a tablelist, too, with the following extensions and + changes:
+ +
+
    +
  1. + If Tab or Shift-Tab is pressed, the + location cursor (active element) moves to the next/previous + element.  If the selection mode is browse or + extended then the new active element is also + selected and all other elements are deselected.  In + extended mode the new active element becomes the + selection anchor. + +

    Notice that these bindings replace the common inter-widget + navigation via Tab and Shift-Tab with + inter-cell navigation.  Just like in the case of the text + widget, Control-Tab and Control-Shift-Tab + are intended to be used for widget-to-widget keyboard + navigation.  Unfortunately, this won't always work because some + window managers intercept the latter key sequences and use them for + their own purposes (like inter-workplace navigation).  For this + reason, Tablelist supports the additional key sequences + Meta-Tab and Meta-Shift-Tab as replacements + for Control-Tab and Control-Shift-Tab, + respectively.

    +
  2. + +
  3. If the Left or Right key is + pressed, the location cursor (active element) moves to the + previous/next element of the active row.  If the selection mode is + browse or extended then the new + active element is also selected and all other elements are + deselected.  In extended mode the new active + element becomes the selection anchor.
  4. + +
  5. In extended mode, + Shift-Left and Shift-Right move the location + cursor (active element) to the previous/next element of the active row + and also extend the selection to that element in a fashion similar to + dragging with mouse button 1.
  6. + +
  7. If the Home or End key is + pressed, the location cursor (active element) moves to the first/last + element of the active row, the new active element is selected, and all + other elements are deselected.
  8. + +
  9. In extended mode, + Shift-Home and Shift-End extend the selection + to the first/last element of the active row.  In + multiple mode, Shift-Home and + Shift-End move the location cursor to the first/last + element of the active row.
  10. + +
  11. If the location cursor is in an editable cell then + Return and KP_Enter start the interactive + editing of the active element.
  12. + +
  13. If tablelist::strictTk is false + (which is the default) then pressing button 1 with the + Control key down toggles the selection state of the + element under the mouse.  If the selection mode is + extended then additional actions apply, as + described in the listbox manual entry.  If the selection + mode is single or browse and + the selection state of the element changes from unselected to selected + then any other selected elements will be deselected, just as if button + 1 had been pressed without the Control key down.
  14. + +
  15. Again, if tablelist::strictTk is + false, then Control-space and Control-Select + toggle the selection state of the active element just as if button 1 + had been pressed over this element with the Control key + down.
  16. +
+
+ +
BINDINGS FOR SELECT ALL AND DESELECT ALL:  The + following additional bindings associated with the binding tag + TablelistBody are valid on the windowing systems + x11 and win32:
+ +
+
    +
  1. + Control-a behaves the same as + Control-slash, i.e., it selects everything in the + widget's body, except in single and + browse modes, in which case it selects the active + item or element (depending on the selection type) and deselects + everything else. + +

    REMARK 1:  The default widget bindings in current Tk + versions on Windows already support Control-a as an + alternative to Control-slash.  In Tablelist this is + now valid on X11, too.

    + +

    REMARK 2:  On Mac OS X Aqua, the default widget + bindings in current Tk versions use the key sequence + Command-a instead of + Control-slash.

    +
  2. + +
  3. + Shift-Control-A behaves the same as + Control-backslash, i.e., it deselects everything in the + widget, except in browse mode where it has no + effect. + +

    REMARK 1:  This shortcut comes in handy on Windows + when using, e.g., a French or German keyboard, because in this case + Tk fails to recognize the Control-backslash key sequence + (for which one has to press Control, AltGr, + and a third key: _ on a French and ß + on a German keyboard).  Moreover, on many keyboards it is quite + difficult (if not even impossible) to generate the + Control-backslash key sequence, fact which makes the + support for this alternative shortcut even more useful on both X11 + and Windows.

    + +

    REMARK 2:  On Mac OS X Aqua, the default widget + bindings in current Tk versions use the key sequence + Option-Command-a instead of + Control-backslash.

    +
  4. +
+
+ +
Just like in the case of the listbox widget, any changes to + the selection will automatically generate the virtual event + <<ListboxSelect>>.  Instead of this + event (which is supported for compatibility reasons), the virtual event + <<TablelistSelect>> can be used to be made + aware of any changes to tablelist selection.  Both events will be + generated independently of the selection type.
+ +
+ LOCAL DRAG & DROP:  The following binding associated with the + binding tag TablelistBody is only valid if the + selection mode is single or + multiple: + +
+

If mouse button 1 is clicked on an item and then dragged outside + that item, and the value of the -movablerows configuration option is + true, then the mouse cursor takes on the shape specified by the + -movecursor option, + indicating that the item in question is being moved to another + position.  The new item position (if any) is visualized with the + aid of a gap placed before the target row or a bar placed inside the + latter (depending on the current mouse position), indicating whether + the source item would be moved before this row or become a child of + it.  This local drag & drop operation ends when mouse + button 1 is released, and can be canceled by pressing the + Escape key.  In both cases, the mouse cursor is reset + to its original value, specified by the -cursor + configuration option.  After releasing mouse button 1 in the + presence of a valid target, the source item is moved before the target + row or just before the latter's first child, and the virtual event + <<TablelistRowMoved>> is + generated.  For Tk versions 8.5 and higher, this virtual event is + generated with its -data option set to a list of + length 3, whose elements are derived from the arguments passed to the + second form of the move + subcommand invoked for moving the source row to its new position.  + The first list element will be the full key corresponding to the first + argument, the second one will be root or the full + key corresponding to the second argument, and the third list element + will be identical to the third argument passed to the + move subcommand.

+ +

Notice that, depending on the current mouse position during the + local drag & drop, there can be a corresponding potential target row or + not.  For instance, a tree item cannot become a sibling of one of + its descendants, and not all items might be allowed to have children or + to become top-level ones (example: in a file manager, regular file + items cannot be parents of other items and should not be allowed to + become top-level ones).  To decide whether the row corresponding + to the y-coordinate of the current mouse position represents a valid + potential target, the Tablelist code first checks whether moving the + source item before that row or making it a child of the latter is + allowed from the point of view of the general tree structure.  If + this is the case and the move operation would change the source item's + parent (and the Tk version is at least 8.3), and the command specified + as the value of the -acceptchildcommand configuration + option is a nonempty string, then this command is concatenated with the + path name of the tablelist widget, the node index of the would-be new + parent node, and the row index of the dragged item, the resulting + script is evaluated in the global scope, and if the return value (which + must be a boolean) is false, then the source item will not be allowed + to be moved to the current mouse position.  Likewise, if the + command specified as the value of the -acceptdropcommand configuration + option is a nonempty string, then this command is concatenated with the + path name of the tablelist widget, the row index of the would-be new + target row, and the row index of the dragged item, the resulting script + is evaluated in the global scope, and if the return value (which must + be a boolean) is false, then the source item will not be allowed to be + moved to the current mouse position.

+ +

Recall that if the selection mode is multiple + then pressing mouse button 1 on a selected item or element + normally deselects that item or element (depending on the selection + type).  However, if in addition the value of the -movablerows configuration option is true + then the clicked row is a potential drag source for the local drag & + drop operation described above, and for this reason the clicked item or + element will only be deselected when releasing mouse button 1 + over the same item or element.

+
+
+ +
DRAG SOURCE SUPPORT FOR GLOBAL + DRAG & DROP:  Besides the local drag & drop, the default bindings + also support the TkDND compiled extension and the drag & drop framework + included in BWidget, as well as custom drag & drop implementations.  A + tablelist widget is viewed as a drag source for mouse button 1 if + its body component was registered as such via the  + tkdnd::drag_source register  or the BWidget + DragSite::register command, or the tablelist's + -customdragsource + option was set to true.  The default bindings provide drag source + support as described below:
+ +
+
    +
  1. If the selection mode is extended + then pressing mouse button 1 on a selected item or element + normally deselects all the other items or elements (depending on the + selection type).  However, if the tablelist is a drag source for + mouse button 1, then the other items or elements will only be + deselected when releasing mouse button 1 over the clicked item + or element.  This is because the mouse click might be followed by + a drag, intended for all currently selected items or elements.
  2. + +
  3. Similarly, if the selection mode is + multiple then pressing mouse button 1 on a + selected item or element normally deselects that item or element + (depending on the selection type).  However, if the tablelist is a + drag source for mouse button 1, then the clicked item or element will + only be deselected when releasing mouse button 1 over the same + item or element.  Again, this is because the mouse click might be + followed by a drag, intended for all currently selected items or + elements.
  4. + +
  5. Whenever the mouse leaves the tablelist window with + button 1 down. the default bindings normally perform an automatic + scrolling, just like in the case of the Tk listbox widget.  + However, if the tablelist is a drag source for mouse button 1, then the + automatic scrolling will be suppressed, in order to avoid any conflicts + with the drag operation.
  6. +
+
+ +
TREE WIDGET BINDINGS:  The following bindings + associated with the binding tag TablelistBody apply to + tablelists used as tree widgets:
+ +
+
    +
  1. Pressing mouse button 1 over an expand/collapse control + toggles the expanded/collapsed state of the corresponding row.
  2. + +
  3. If the current active row contains an expand/collapse + control in collapsed state then the Right, + plus, and KP_Add keys expand the + corresponding row by invoking the non-recursive version of the + expand subcommand.
  4. + +
  5. If the current active row contains an expand/collapse + control in expanded state then the Left, + minus, and KP_Subtract keys collapse the + corresponding row by invoking the non-recursive version of the + collapse subcommand.
  6. +
+
+ +
DEFAULT AND INDIVIDUAL BINDINGS FOR + THE HEADER ITEMS
+ +
The hedaer items are contained in a text widget whose binding tag + Text is replaced with a new binding tag called + TablelistHeader.  This tag replaces also the + binding tag Message of the message widgets used to + display multi-line header elements, as well as the binding tag + Label of the label widgets used to display embedded + images in the header cells.  This makes sure that the default handling + of the mouse events on the multi-line cells and embedded images in the + tablelist's header is the same as in the rest of the header text + widget.
+ +
+ Header items are designed for display purposes only, they are not + intended to be interactive.  For this reason, the only default + bindings associated with the binding tag + TablelistHeader are the ones used internally by + Tablelist for tooltip support.  You can, however, define individual + bindings for the header component, like in the following example (which + requires Tk 8.5 or later): + +
+
+bind [.tbl headertag] <Button-1> {printClickedCell %W %x %y}
+proc printClickedCell {w x y} { + foreach {tbl x y} [tablelist::convEventFields $w $x $y] {} + puts "clicked on header cell [$tbl header containingcell $x $y]" +
+
+
+ +
DEFAULT AND INDIVIDUAL BINDINGS FOR + THE HEADER LABELS
+ +
Tablelist automatically creates the following bindings for the header + labels of a tablelist widget:
+ +
+
    +
  1. If the mouse pointer is on the right edge of a header + label or within a few pixels of its right edge, and both the value of + the -resizablecolumns configuration + option and that of the -resizable option for the column + corresponding to that label are true, then the mouse cursor takes on + the shape specified by the -resizecursor option.  By clicking + mouse button 1 in this area and moving the mouse while its button 1 is + down, the column corresponding to that label will be resized by the + amount of the cursor motion.  The interactive column resizing ends + when mouse button 1 is released, and can be canceled by pressing the + Escape key.  In both cases, the mouse cursor is reset + to its original value, specified by the -cursor + configuration option.  When the column resize operation is + finished, the virtual event + <<TablelistColumnResized>> is + generated, with its -data option set to the + numerical column index for Tk versions 8.5 and higher.
  2. + +
  3. If mouse button 1 is pressed over a header label but + outside the resize area described above and then dragged outside the + label, and the value of the -movablecolumns configuration option + is true, then the mouse cursor takes on the shape specified by the + -movecolumncursor + option, indicating that the column in question is being moved to + another position, visualized with the aid of a gap placed before the + label of the target column.  This operation ends when mouse button + 1 is released, and can be canceled by pressing the Escape + key when the mouse pointer is outside the label.  In both cases, + the mouse cursor is reset to its original value, specified by the + -cursor configuration option.  After releasing + mouse button 1, the source column is moved before the one indicated by + the gap mentioned above and the virtual event + <<TablelistColumnMoved>> is + generated.  For Tk versions 8.5 and higher, this virtual event is + generated with its -data option set to a list of + length 4, whose first two elements are identical to the two numerical + column indices passed to the movecolumn subcommand invoked for moving + the source column to its new position, and the last two elements are + the corresponding column names, retrieved with the aid of the  + columncget ... + -name  subcommand.
  4. + +
  5. If mouse button 1 is pressed over a header label but + outside the resize area described above and later released over the + same label, and the command specified by the -labelcommand option is a nonempty + string, then this command is concatenated with the path name of the + tablelist widget and the column index of the respective label, and the + resulting script is evaluated in the global scope.  If another + nonempty label command was specified at column level by using the + columnconfigure + option of the Tcl command associated with the tablelist widget, then + that column-specific command will be used instead of the global + one.  If mouse button 1 was pressed together with the + Shift key then the widget- or column-specific command + mentioned above will be replaced with the one specified by the + -labelcommand2 option + at widget or column level.
  6. + +
  7. The Tablelist package defines the virtual + event <<Button3>> as + <Button-3> for all windowing systems and + additionally as <Control-Button-1> for Mac OS + Classic and Mac OS X Aqua.  If this event occurs over a header + label and both the value of the -resizablecolumns configuration + option and that of the -resizable option for the column + corresponding to that label are true, then the width of that column is + set to zero, i.e., it is made just large enough to hold all the + elements in the column, including the header (but no larger than the + maximum width indicated by the -maxwidth column configuration option), + and the virtual event + <<TablelistColumnResized>> is + generated, with its -data option set to the + numerical column index for Tk versions 8.5 and higher.  The same + action is triggered by double-clicking the resize area of a header + label.
  8. + +
  9. The Tablelist package defines the virtual event + <<ShiftButton3>> as + <Shift-Button-3> for all windowing systems + and additionally as <Shift-Control-Button-1> + for Mac OS Classic and Mac OS X Aqua.  If this event occurs over a + header label and both the value of the -resizablecolumns configuration + option and that of the -resizable option for the column + corresponding to that label are true, then the width of that column is + set to its last static width (if any) and the virtual event + <<TablelistColumnResized>> is + generated, with its -data option set to the + numerical column index for Tk versions 8.5 and higher.  The same + action is triggered by double-clicking the resize area of a header + label with the Shift key held down.
  10. +
+
+ +
BINDINGS FOR COLUMN-WISE CELL + SELECTION:  If the selection type is cell then + a few further bindings apply to the header labels.  In the description + below the Alt key can be replaced with Meta; on + Mac OS Classic and Mac OS X Aqua the Command key is used + instead of Alt and Meta.  Notice also that + you can restrict the set of cells that will be selected when these bindings + perform a column-wise cell selection:  If the command specified by the + -selectfiltercommand + option is a nonempty string then this command is concatenated with the path + name of the tablelist widget and the numerical index of the respective + column, and the resulting script is evaluated in the global scope.  If + another nonempty command was specified as the value of the option of the + same name at column level then that column-specific command will be used + instead of the global one.  In both cases, only those cells contained + in that column will be selected whose row numbers are contained in the list + returned by the script.
+ +
+
    +
  1. Pressing mouse button 1 on a header label with the + Alt key down selects the cells of the corresponding + column, deselects everything else, and sets the anchor to the first + viewable selected cell of that column; dragging the mouse with button 1 + down extends the selection to include all the columns between the + anchor and the column under the mouse, inclusive.
  2. + +
  3. If the anchor column contains at least one selected cell + then the range of selected columns can be adjusted by pressing button 1 + on a header label with the Alt and Shift keys + down: this modifies the selection to consist of the cells of the + columns between the anchor and the one under the mouse, + inclusive.  The un-anchored end of this new column-wise cell + selection can also be dragged with the button down.
  4. + +
  5. Pressing button 1 on a header label with the + Alt and Control keys down starts a toggle + operation: the cells of the column corresponding to the clicked label + will be deselected if at least one of them was selected before, and + selected otherwise; in the first case the anchor is set to the first + viewable cell of that column, while in the second case to the column's + first viewable selected cell.  The selection state of other cells + is not changed.  If subsequently the mouse is dragged with button + 1 down, then the selection state of the cells between the anchor column + and the one under the mouse is set to match the toggled state of the + anchor column; the selection state of all other cells remains what it + was before the toggle operation began.
  6. +
+
+ +
If the tablelist's state is disabled then none of + the above actions occur: the labels are completely insensitive.
+ +
+ If you want to define non-default bindings for the header labels, it is + recommended to associate them with the binding tag whose name is returned + by the labeltag subcommand + and make use of the helper commands tablelist::getTablelistColumn + and tablelist::getTablelistPath.  + For example, to replace the default binding for + <Button-3> with a script that performs a + column-dependent action, you can proceed like in the code shown below: + +
+
+bind [.tbl labeltag] <Button-3> {
+    puts "right-clicked on header label no. [tablelist::getTablelistColumn %W]"
+    break
+}
+
+
+
+ +
DEFAULT BINDINGS FOR INTERACTIVE CELL + EDITING
+ +
Tablelist extends and partially redefines the bindings of some of the + components of the temporary embedded widget used for interactive cell + editing, which is started by pressing mouse button 1 in an editable cell + (see the -editselectedonly option for details) or + using keyboard navigation to move from one editable cell into + another.  If the selection type is cell and the + location cursor is in an editable cell, then the interactive editing of the + active element can also be started by pressing Return or + KP_Enter.
+ +
The affected components of the temporary embedded widget + depend on the edit window: the widget itself in case of a Tk or tile + checkbutton or menubutton; the edit window's entry children in case of a + mentry widget; the only entry or entry-like component of the edit window in + all other cases (see also the entrypath subcommand).  The list of + binding tags of these edit window components contains two addditional tags, + inserted just before their path names: the binding tag whose name is + returned by the editwintag + subcommand, followed by the tag TablelistEdit.  + The bindings described below are associated with the tag + TablelistEdit, and can be overridden for individual + tablelist widgets by making use of the binding tag given by the + editwintag subcommand.
+ +
+
    +
  1. Control-i inserts a tabulator character + into the edit window's entry or entry-like components (if any), at the + point of the insertion cursor.
  2. + +
  3. Control-j inserts a newline character into + the edit window's entry or entry-like components (if any), at the point + of the insertion cursor.
  4. + +
  5. If the edit window is a text or ctext widget then + Return and KP_Enter insert a newline + character at the point of the insertion cursor.  Otherwise they + terminate the editing and destroy the edit window.
  6. + +
  7. Control-Return and + Control-KP_Enter terminate the editing and destroy the + edit window.
  8. + +
  9. Escape aborts the editing and destroys the + edit window.
  10. + +
  11. A click with the left mouse button anywhere in the + tablelist's body, outside the cell just being edited, terminates the + editing in the current cell and destroys the edit window or moves it + into the cell that was just clicked into if the latter is + editable.
  12. + +
  13. + When editing a cell that is not the only editable cell of the + tablelist widget, Tab and Shift-Tab + terminate the editing in the current cell, move the edit window into + the next/previous editable cell of the tablelist, select the content + of the edit window's first entry or entry-like component (if any), + and set the insertion cursor to its end.  If the new edit window + is a text or ctext widget then its content is left unselected. + +

    Notice that these bindings replace the common inter-widget + navigation via Tab and Shift-Tab with + inter-cell navigation.  Just like in the case of the text + widget, Control-Tab and Control-Shift-Tab + are intended to be used for widget-to-widget keyboard navigation + during interactive cell editing.  Unfortunately, this won't + always work because some window managers intercept the latter key + sequences and use them for their own purposes (like inter-workplace + navigation).  For this reason, Tablelist supports the additional + key sequences Meta-Tab and Meta-Shift-Tab + as replacements for Control-Tab and + Control-Shift-Tab, respectively.

    +
  14. + +
  15. When editing a cell that is not the first/last editable + cell within its row, Alt-Left/Alt-Right + (Command-Left/Command-Right on Mac OS Classic + and Mac OS X Aqua) terminates the editing in the current cell, moves + the edit window into the previous/next editable cell of the row, + selects the content of the edit window's first entry or entry-like + component (if any), and sets the insertion cursor to its end.  If + the new edit window is a text or ctext widget then its content is left + unselected.  The key sequence + Meta-Left/Meta-Right has the same effect as + Alt-Left/Alt-Right.  If + tk_strictMotif is false and the edit window is not + a text or ctext widget then Meta-b and Meta-f + behave the same as Alt-Left and Alt-Right, + respectively.  If the edit window is a Tk or tile checkbutton or + menubutton widget then Left/Right has the + same effect as Alt-Left/Alt-Right.
  16. + +
  17. When editing a cell that is not the first/last editable + cell within its column, Alt-Up/Alt-Down + (Command-Up/Command-Down on Mac OS Classic + and Mac OS X Aqua) terminates the editing in the current cell, moves + the edit window one line up/down within the column, selects the content + of the edit window's first entry or entry-like component (if any), and + sets the insertion cursor to its end.  If the new edit window is a + text or ctext widget then its content is left unselected.  The key + sequence Meta-Up/Meta-Down has the same + effect as Alt-Up/Alt-Down.  If + tk_strictMotif is false and the edit window is not + a text or ctext widget or an Iwidgets combobox, then + Control-p and Control-n behave the same as + Alt-Up and Alt-Down, respectively.  If + the edit window is a Tk or tile entry, Tk or tile checkbutton, Tk or + tile menubutton, BWidget Entry, Iwidgets entryfield/spinner/spinint, or + a mentry widget of type "FixedPoint", then + Up/Down has the same effect as + Alt-Up/Alt-Down.
  18. + +
  19. When editing a cell that is not the first/last editable + cell within its column, Alt-Prior/Alt-Next + (Command-Prior/Command-Next on Mac OS Classic + and Mac OS X Aqua) terminates the editing in the current cell, moves + the edit window up/down by one page within the column, selects the + content of the edit window's first entry or entry-like component (if + any), and sets the insertion cursor to its end.  If the new edit + window is a text or ctext widget then its content is left + unselected.  The key sequence + Meta-Prior/Meta-Next has the same effect as + Alt-Prior/Alt-Next.  If the edit window + is not a text or ctext widget, BWidget SpinBox, Oakley combobox, or a + mentry widget of type "Date", "Time", + "DateTime", "IPAddr", or + "IPv6Addr", then Prior/Next has + the same effect as Alt-Prior/Alt-Next.
  20. + +
  21. When editing a cell that is not the only editable cell + of the tablelist widget, Alt-Home/Alt-End + (Command-Home/Command-End on Mac OS Classic + and Mac OS X Aqua) terminates the editing in the current cell, moves + the edit window into the first/last editable cell of the tablelist, + selects the content of the edit window's first entry or entry-like + component (if any), and sets the insertion cursor to its end.  If + the new edit window is a text or ctext widget then its content is left + unselected.  The key sequence + Meta-Home/Meta-End has the same effect as + Alt-Home/Alt-End.  If + tk_strictMotif is false and the edit window is not + a text or ctext widget then Meta-< and + Meta-> behave the same as Alt-Home and + Alt-End, respectively.  If the edit window is not a + text or ctext widget then + Control-Home/Control-End has the same effect + as Alt-Home/Alt-End.
  22. +
+
+ +
Before moving the edit window, the key sequences mentioned + under 7 - 11 move the active item or element and change the (cell)selection + and the (cell)selection anchor in the body of the tablelist widget.  + For example, if Alt-Up/Alt-Down or + Meta-Up/Meta-Down + (Command-Up/Command-Down on Mac OS Classic and + Mac OS X Aqua) is pressed when editing a cell that is not the first/last + editable cell within its column, then the active item or element (depending + on the selection type) moves one line up/down.  If the selection mode + is browse or extended then the new + active item or element is also selected and all other items or elements are + deselected.  In extended mode the new active item + or element becomes the (cell)selection anchor.  This is exactly the + same behavior as the one exhibited by the Up and + Down keys in the tablelist's body.
+ +
If the tablelist's state is disabled then none of + the above actions occur.
+ +
KEYWORDS
+ +
tablelist, multi-column, listbox, tree, widget
+
+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/tablelist/tileWidgets.png Index: embedded/www/tklib/files/modules/tablelist/tileWidgets.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/tileWidgets.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/ubuntu.png Index: embedded/www/tklib/files/modules/tablelist/ubuntu.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/ubuntu.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/ubuntu2.png Index: embedded/www/tklib/files/modules/tablelist/ubuntu2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/ubuntu2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/ubuntu3.png Index: embedded/www/tklib/files/modules/tablelist/ubuntu3.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/ubuntu3.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/ubuntuMate.png Index: embedded/www/tklib/files/modules/tablelist/ubuntuMate.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/ubuntuMate.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/vistaAero.png Index: embedded/www/tklib/files/modules/tablelist/vistaAero.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/vistaAero.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/vistaClassic.png Index: embedded/www/tklib/files/modules/tablelist/vistaClassic.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/vistaClassic.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/win10.png Index: embedded/www/tklib/files/modules/tablelist/win10.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/win10.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/win7Aero.png Index: embedded/www/tklib/files/modules/tablelist/win7Aero.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/win7Aero.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/win7Classic.png Index: embedded/www/tklib/files/modules/tablelist/win7Classic.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/win7Classic.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/winnative.png Index: embedded/www/tklib/files/modules/tablelist/winnative.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/winnative.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/winxpBlue.png Index: embedded/www/tklib/files/modules/tablelist/winxpBlue.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/winxpBlue.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/winxpOlive.png Index: embedded/www/tklib/files/modules/tablelist/winxpOlive.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/winxpOlive.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/winxpSilver.png Index: embedded/www/tklib/files/modules/tablelist/winxpSilver.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/winxpSilver.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/tablelist/yuyo.png Index: embedded/www/tklib/files/modules/tablelist/yuyo.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/tablelist/yuyo.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/wcb/entrytest.png Index: embedded/www/tklib/files/modules/wcb/entrytest.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/wcb/entrytest.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/wcb/index.html Index: embedded/www/tklib/files/modules/wcb/index.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/wcb/index.html @@ -0,0 +1,31 @@ + + + The Widget Callback Package Wcb 3.6 + + + + + + +
+

The Widget Callback Package Wcb 3.6

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+ +
+ +

Contents

+ +

Wcb Programmer's Guide

+ +

Wcb Command Reference

+ + ADDED embedded/www/tklib/files/modules/wcb/listboxtest1.png Index: embedded/www/tklib/files/modules/wcb/listboxtest1.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/wcb/listboxtest1.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/wcb/listboxtest2.png Index: embedded/www/tklib/files/modules/wcb/listboxtest2.png ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/wcb/listboxtest2.png cannot compute difference between binary files ADDED embedded/www/tklib/files/modules/wcb/stylesheet.css Index: embedded/www/tklib/files/modules/wcb/stylesheet.css ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/wcb/stylesheet.css @@ -0,0 +1,5 @@ +/* generic class defining a top margin whose height equals the font size */ +.tm {margin-top: 1em} + +/* background and border for the
 tag */
+pre {background: #F7F7F7; border: silver solid 1px}

ADDED   embedded/www/tklib/files/modules/wcb/texttest1.png
Index: embedded/www/tklib/files/modules/wcb/texttest1.png
==================================================================
--- /dev/null
+++ embedded/www/tklib/files/modules/wcb/texttest1.png
cannot compute difference between binary files

ADDED   embedded/www/tklib/files/modules/wcb/texttest2.png
Index: embedded/www/tklib/files/modules/wcb/texttest2.png
==================================================================
--- /dev/null
+++ embedded/www/tklib/files/modules/wcb/texttest2.png
cannot compute difference between binary files

ADDED   embedded/www/tklib/files/modules/wcb/wcb.html
Index: embedded/www/tklib/files/modules/wcb/wcb.html
==================================================================
--- /dev/null
+++ embedded/www/tklib/files/modules/wcb/wcb.html
@@ -0,0 +1,770 @@
+
+
+  Wcb Programmer's Guide
+
+  
+  
+
+  
+
+
+
+  
+

Wcb Programmer's Guide

+ +

For Wcb Version 3.6

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+
+ +

Contents

+ +

Overview

+ + + +

Examples

+ + + + +
+ +

Overview

+ +

Some Common Problems

+ +

Many Tcl/Tk programmers are confronted with questions like the + following:

+ +
    +
  • How to restrict the set of characters that the user can type or paste + into a Tk or tile entry, BWidget Entry, Tk or tile spinbox, tile combobox, + text, or ctext widget?
  • + +
  • How to manipulate the user input characters before they are inserted + into one of these widgets?  In the case of a text or ctext + widget:  How to change the font, colors, or other attributes of the + input characters?
  • + +
  • How to set a limit for the number of characters that can be typed or + pasted into a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile + combobox widget?
  • + +
  • How to protect some parts of the text contained in a Tk or tile entry, + BWidget Entry, Tk or tile spinbox, tile combobox, text, or ctext widget + from being changed by the user?
  • + +
  • How to define notifications to be triggered automatically after text is + inserted into or deleted from one of these widgets?
  • + +
  • How to define some actions to be invoked automatically whenever the + insertion cursor in a Tk or tile entry, BWidget Entry, Tk or tile spinbox, + tile combobox, text, or ctext widget is moved?
  • + +
  • How to define a command to be called automatically when selecting a + listbox element, a tablelist row or cell, a tile treeview item, or a range + of characters in a text or ctext widget?
  • + +
  • How to protect any or all items/elements of a listbox, tablelist, or + tile treeview, or a range of characters in a text or ctext widget from + being selected?
  • +
+ +

In most books, FAQs, newsgroup articles, and widget sets, you can find + individual solutions to some of the above problems by means of widget + bindings.  This approach is based on adding new binding tags or + modifying some of the existing ones, which quite often proves to be + incomplete.

+ +

The Tk core addresses just a few of the above problems:  In Tk 8.1 + the <<ListboxSelect>> virtual event for listbox + widgets was introduced, Tk versions 8.3 and higher support widget options for + entry validation, and the spinbox widget (introduced in Tk 8.4) provides the + same validation facility.  Finally, Tk versions 8.4 and higher support + the disabled state for listbox widgets, as well as the + modified flag, the <<Modified>> and + <<Selection>> virtual events, and an undo/redo + mechanism for text widgets.  However, also these improvements are of + individual nature.

+ +

The Wcb Package

+ +

The Widget callback package Wcb provides a completely + different, general solution to the above problems:  Based on + redefining the Tcl command corresponding to a widget, the main Wcb procedure + wcb::callback enables you to + associate arbitrary commands with some Tk entry, tile entry, BWidget Entry, + Tk spinbox, tile spinbox, tile combobox, listbox, tablelist, tile treeview, + text, and ctext widget operations.  These commands will be invoked + automatically in the global scope whenever the respective widget operation is + executed.  You can request that these commands be called either before + or after executing the respective widget operation, i.e., you can define both + before- and after-callbacks.  From within a + before-callback, you can cancel the respective widget command by invoking the + procedure wcb::cancel, or + modify its arguments by calling wcb::extend or wcb::replace.

+ +

Besides these (and four other) general-purpose commands, the Wcb package + exports four utility procedures for Tk entry, tile entry, BWidget Entry, Tk + spinbox, tile spinbox, and tile combobox widgets, as well as some + before-insert callbacks for Tk + entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, tile + combobox, text, and ctext widgets, which + you can use unchanged or modify to suit your needs.  To learn how to do + this, have a look at the Examples section below.

+ +

The Wcb package is implemented in pure Tcl/Tk code, which makes it + completely platform-independent and very easy to install.  It requires + version 8.0 or higher of both Tcl and Tk.

+ +

How to Get It?

+ +

Wcb is available for free download from the Web page

+ +
+
+ http://www.nemethi.de +
+
+ +

The distribution file is wcb3.6.tar.gz for UNIX and + wcb3_6.zip for Windows.  These files contain the same + information, except for the additional carriage return character preceding + the linefeed at the end of each line in the text files for Windows.

+ +

Wcb is also included in tklib, which has the address

+ +
+
+ http://core.tcl.tk/tklib +
+
+ +

How to Install It?

+ +

Install the package as a subdirectory of one of the directories given by + the auto_path variable.  For example, you can install it as + a directory at the same level as the Tcl and Tk script libraries.  The + locations of these library directories are given by the + tcl_library and tk_library variables, + respectively.

+ +

To install Wcb on UNIX, cd to the desired directory + and unpack the distribution file wcb3.6.tar.gz:

+ +
+
+gunzip -c wcb3.6.tar.gz | tar -xf -
+
+
+ +

This command will create a directory named wcb3.6, with the + subdirectories demos, doc, and + scripts.

+ +

On Windows, use WinZip or some other program capable of unpacking + the distribution file wcb3_6.zip into the directory + wcb3.6, with the subdirectories demos, + doc, and scripts.

+ +

Notice that in tklib the Wcb demos directory is replaced with + the subdirectory wcb of the examples + directory.  Please take this into account when reading the examples below.

+ +

How to Use It?

+ +

To be able to access the commands and variables defined in the package + Wcb, your scripts must contain one of the lines

+ +
+
+package require wcb ?version?
+package require Wcb ?version?
+
+
+ +

You can use either one of the two statements above because the file + wcb.tcl contains both lines

+ +
+
+package provide wcb ...
+package provide Wcb ...
+
+
+ +

You are free to remove one of these two lines from wcb.tcl if + you want to prevent the package from making itself known under two different + names.  Of course, by doing so you restrict the argument of  + package require  to a single name.

+ +

Please note that ActiveTcl versions 8.5 and later use a modified + package mechanism, which only exports the all-lowercase name + wcb.  For this reason, the examples below use the statement  package require + wcb.

+ +

Since the package Wcb is implemented in its own namespace called + wcb, you must either invoke the

+ +
+
+namespace import wcb::pattern ?wcb::pattern ...?
+
+
+ +

command to import the procedures you need, or use qualified names + like wcb::callback.  In the examples below we have chosen + the latter approach.

+ +

To access Wcb variables, you must use qualified names.  + There are only two Wcb variables that are designed to be accessed outside the + namespace wcb:

+ +
    +
  • The variable wcb::version holds the current version number + of the Wcb package.
  • + +
  • The variable wcb::library holds the location of the Wcb + installation directory.
  • +
+ +
+

Contents     Start page

+
+
+ +

Examples

+ +

Some before-insert Callbacks for entry + Widgets

+ +

The script entrytest.tcl in the demos directory + creates three entry widgets with the constraints shown in the following + figure:

+ +
+ entrytest +
+ +

For the topmost entry .e1 we define two + before-insert callbacks contained in the Wcb package:

+ +
+
+wcb::callback .e1 before insert wcb::checkStrForAlnum \
+                                wcb::convStrToUpper
+
+
+ +

To force the second entry .e2 to accept only integers of + maximal length 10, we use again two before-insert callbacks from + Wcb:

+ +
+
+wcb::callback .e2 before insert {wcb::checkEntryLen 10} \
+                                 wcb::checkEntryForInt
+
+
+ +

And finally, here are the two callbacks for the third entry widget + .e3:

+ +
+
+wcb::callback .e3 before insert {wcb::checkEntryLen 10} \
+                                 checkNumber
+
+#
+# Callback procedure checkNumber
+#
+proc checkNumber {w idx str} {
+    set newText [wcb::postInsertEntryText $w $idx $str]
+    if {![regexp {^[0-9]*\.?[0-9]?[0-9]?$} $newText]} {
+        wcb::cancel
+    }
+}
+
+
+ +

This last example also shows the arguments of the callbacks declared with + the wcb::callback + command:  Whenever a callback is invoked, the name of the original Tcl + command for the widget as well as the arguments of the respective widget + operation are automatically appended to it as parameters.  Since we + defined checkNumber as a before-callback for the + insert subcommand, its last three arguments must be: the name of + the original entry widget command (w), the index + (idx), and the string (str) to be inserted just + before the character indicated by the index.

+ +

Notice that in the argument list of a Wcb callback, the name of the + original Tcl widget command can be be preceded by any number of additional + arguments.  The procedure wcb::checkEntryLen is an example of such a + callback.

+ +

The command wcb::postInsertEntryText invoked + in the procedure checkNumber returns the text that would be + contained in the entry widget w after inserting the string + str before the character indicated by the index + idx.  If this text is not (the starting part of) an + unsigned real number with at most two digits after the decimal point, then we + call the procedure wcb::cancel, + which aborts the insert command.

+ +

Without the constraint that the content of the third entry must not start + with a sign, we could have used the callback procedure wcb::checkEntryForFixed instead of + checkNumber:

+ +
+
+wcb::callback .e3 before insert {wcb::checkEntryLen 10} \
+                                {wcb::checkEntryForFixed 2}
+
+
+ +

A selset Callback for a listbox Widget

+ +

In the case of a listbox, you will probably most often want to define a + callback for the  selection set  widget + subcommand.  In most cases it does not matter whether this is a before- + or after-callback.  Please note that the wcb::callback command expects the + abbreviated form selset as parameter.  Similarly, you must + pass selclear to this command when defining a callback for + the  selection clear  listbox operation.

+ +

In the following example we build a listbox .lb containing + the names of the bitmap files in the subdirectory images of the + directory demos in the Tk library directory.  Whenever an + item is selected, the callback procedure showBitmap will display + the corresponding bitmap in the label .picture.

+ +
+ listboxtest1 +
+ +

Here is the relevant code fragment from the script + listboxtest1.tcl, contained in the demos + directory:

+ +
+
+set dirName [file join $tk_library demos images]
+
+#
+# Frame .spacer and listbox .lb
+#
+frame .spacer -width 10
+listbox .lb -height 0 -width 0 -background gray98
+if {$tk_version < 8.5} {
+    set pattern [file join $dirName *.bmp] 
+} else { 
+    set pattern [file join $dirName *.xbm]
+}   
+foreach pathName [lsort [glob $pattern]] {
+    .lb insert end [file tail $pathName]
+}
+
+#
+# Label .picture
+#
+label .picture -relief sunken
+
+#
+# Define a before-selset callback for .lb
+#
+wcb::callback .lb before selset showBitmap
+
+#
+# Callback procedure showBitmap
+#
+proc showBitmap {w first args} {
+    global dirName
+    set pathName [file join $dirName [$w get $first]]
+    .picture configure -bitmap @$pathName
+}
+
+
+ +

Recall that the  selection set  listbox operation + takes as arguments one or two indices, which will be passed automatically to + the callback as parameters, along with the name of the original Tcl command + associated with the listbox widget.  For this reason, the arguments of + the callback procedure showBitmap are: the name of the original + listbox widget command (w), the first index + (first), as well as the args keyword representing + the empty list or the optional second index passed to the  + selection set  command.

+ +

An activate Callback for a listbox + Widget

+ +

The listbox used in the preceding example has the default selection mode + browse, hence the before-selset callback + showBitmap will be fired every time the mouse is dragged from + one element to another, with button 1 down.  But what happens if we want + to display not only the bitmaps but also the photo images contained in the + subdirectory images of the directory demos in the + Tk library directory?  Loading a photo image is a much more complex + operation than loading a bitmap, which can have the effect that some images + cannot be displayed quickly enough to follow the mouse when browsing with it + within the listbox.

+ +
+ listboxtest2 +
+ +

To solve this problem, we can either change the selection mode to have the + less common value single, or arrange for the images not to be + displayed when browsing with the mouse but when releasing its button 1.  + The second method can be implemented with the aid of an activate + callback, as shown in the following code fragment taken from the script + listboxtest2.tcl, contained in the demos + directory:

+ +
+
+set dirName [file join $tk_library demos images]
+image create photo photoImage
+
+#
+# Frame .spacer and listbox .lb
+#
+frame .spacer -width 10
+listbox .lb -height 0 -width 0 -background gray98
+set pattern [file join $dirName *]
+foreach pathName [lsort [glob $pattern]] {
+    .lb insert end [file tail $pathName]
+}
+
+#
+# Label .picture
+#
+label .picture -relief sunken
+
+#
+# Define a before-activate callback for .lb
+#
+wcb::callback .lb before activate showPicture
+
+#
+# Callback procedure showPicture
+#
+proc showPicture {w idx} {
+    set leafName [$w get $idx]
+
+    #
+    # When traversing the listbox with the arrow keys, the value
+    # of idx can become -1 or the number of listbox elements,
+    # hence the value of leafName can be an empty string:
+    #
+    if {[string compare $leafName ""] == 0} {
+        return ""
+    }
+
+    global dirName
+    set pathName [file join $dirName $leafName]
+    if {[regexp {^\.(bmp|xbm)$} [file extension $pathName]]} {
+        .picture configure -bitmap @$pathName -image ""
+    } else {
+        photoImage configure -file $pathName
+        .picture configure -bitmap "" -image photoImage
+    }
+}
+
+
+ +

Seven Callbacks for a text Widget

+ +

The script texttest1.tcl in the demos directory + creates the text widget shown in the following figure:

+ +
+ texttest1 +
+ +

Here is the relevant code fragment:

+ +
+
+#
+# Text .txt
+#
+set width 50
+text .txt -width $width -height 12 -setgrid true -wrap none -background white \
+          -font "Courier -12"
+.txt tag configure prog -foreground red
+.txt tag configure user -foreground DarkGreen
+.txt insert end "Everything you type or paste into this window will\n"  prog
+.txt insert end "be displayed in dark green.  You cannot make any\n"    prog
+.txt insert end "changes or selections in this red area, and will\n"    prog
+.txt insert end "not be able to send the message as long as any\n"      prog
+.txt insert end "line contains more than $width characters.\n"          prog
+.txt insert end "--------------------------------------------------\n"  prog
+set limit [.txt index insert]
+
+#
+# Label .pos displaying the current cursor position
+#
+label .pos -textvariable pos
+
+#
+# Button .send (actually, it does not send anything)
+#
+button .send -text Send -command exit
+
+#
+# Define 5 before- and 2 after-callbacks for .txt
+#
+wcb::callback .txt before insert protectRedArea changeColor
+wcb::callback .txt before delete protectRedArea
+wcb::callback .txt before selset protectRedArea
+wcb::callback .txt before motion displayPos
+wcb::callback .txt  after insert "checkLines $width"
+wcb::callback .txt  after delete "checkLines $width"
+
+#
+# Callback procedure protectRedArea
+#
+# The parameters following w can be interpreted either as
+# "index string ?tagList string tagList ...?" (for an insert
+# callback), or as "from ?to?" (for a delete callback),
+# or as "from ?to from to ...?" (for a selset callback).
+#
+proc protectRedArea {w idx args} {
+    global limit
+    if {[$w compare $idx < $limit]} {
+        wcb::cancel
+    }
+}
+
+#
+# Callback procedure changeColor
+#
+proc changeColor {w args} {
+    wcb::extend user
+}
+
+#
+# Callback procedure displayPos
+#
+proc displayPos {w idx} {
+    set index [$w index $idx]
+    scan $index "%d.%d" line column
+    incr column
+
+    global pos
+    set pos [format "Line: %d   Column: %d" $line $column]
+}
+
+#
+# Callback procedure checkLines
+#
+# The parameter args can be interpreted both as "index
+# string ?tagList string tagList ...?" (for an insert
+# callback) and as "from ?to?" (for a delete callback).
+#
+proc checkLines {maxCharsPerLine w args} {
+    #
+    # Display the new cursor position
+    #
+    displayPos $w insert
+
+    #
+    # Disable or enable the .send button
+    #
+    scan [$w index end] "%d" lastLine
+    for {set line 1} {$line < $lastLine} {incr line} {
+        scan [$w index $line.end] "%d.%d" dummy charsInLine
+        if {$charsInLine > $maxCharsPerLine} {
+            .send configure -state disabled
+            return ""
+        }
+    }
+    .send configure -state normal
+}
+
+. . .
+
+displayPos .txt insert
+focus .txt
+
+
+ +

The procedure protectRedArea is a before-insert, + before-delete, and before-selset callback.  It + checks whether the attempted change would affect the text area displayed in + red; if this is the case, it calls the procedure wcb::cancel, which aborts the + insert, delete, or  tag add + sel  command, respectively.

+ +

The before-insert callback changeColor invokes + the wcb::extend command to + append the user tag to the argument list of the + insert command, thus changing the foreground color of the + characters entered by the user to DarkGreen.

+ +

The procedure displayPos displays the line and column + corresponding to the index passed to it as its second argument.  This + index will be the target position of the insertion cursor when the procedure + is triggered automatically as a before-motion callback.  As + seen in the checkLines procedure discussed below, it is also + invoked after performing an insert or delete + operation; in that case, its second argument will be the new position of the + insertion cursor after the execution of insert or + delete.  In this way, we are able to keep track completely + of the position of the insertion cursor.

+ +

It is interesting to see what happens if we register + displayPos as an after- instead of before-motion + callback.  Well, in that case the procedure would have to ignore its + second argument and we would have to replace the line

+ +
+
+set index [$w index $idx]
+
+
+ +

with

+ +
+
+set index [$w index insert]
+
+
+ +

The reason is that the value of the idx argument passed to + displayPos can be, for instance, insert+1c, where + insert means the position of the insertion cursor before + moving it forward by one character.  The after-motion + callback is, however, triggered after the insertion cursor has been + moved, and at that time the insert mark already points to the + new cursor position.  For this reason,  [$w index + $idx]  is not adequate to retrieve the position of the insertion + cursor within an after-motion callback.

+ +

Our last procedure checkLines is both an + after-insert and after-delete callback.  After + calling displayPos to display the new cursor position, it + disables or enables the .send button, depending upon whether any + line of the text widget contains more than $maxCharsPerLine + characters.

+ +

Notice that we could also have defined before-replace and + after-replace callbacks for the replace text widget + subcommand, introduced in Tk version 8.6.  There is, however, no need + for it, because the default text widget bindings currently don't make use of + this subcommand.

+ +

Instead of just disabling the .send button if any line has + more than $maxCharsPerLine characters, we can even prevent the + user from entering lines that are longer than allowed.  The script + texttest2.tcl in the demos directory shows how this + can be achieved by combining widget callbacks with the undo mechanism for + text widgets, introduced in Tk 8.4.  This script creates the text widget + shown in the following figure:

+ +
+ texttest2 +
+ +

Most of the code contained in the script texttest2.tcl is + identical to the one in the previous example.  The main difference is a + new line activating the undo mechanism for the text widget .txt + and a new version of the callback procedure checkLines:

+ +
+
+. . .
+
+.txt configure -undo yes
+
+. . .
+
+proc checkLines {maxCharsPerLine w args} {
+    #
+    # Undo the last insert or delete action if necessary
+    #
+    scan [$w index end] "%d" lastLine
+    for {set line 1} {$line < $lastLine} {incr line} {
+        scan [$w index $line.end] "%d.%d" dummy charsInLine
+        if {$charsInLine > $maxCharsPerLine} {
+            $w edit undo
+            bell
+            break
+        }
+    }
+
+    #
+    # Clear the undo and redo stacks, and display the new cursor position
+    #
+    $w edit reset
+    displayPos $w insert
+}
+
+. . .
+
+
+ +

This version of the callback checkLines undoes the last edit + action if any text line contains more characters than the allowed + maximum.  For this reason, we had to move the invocation of the + displayPos procedure to the end of the callback, because + the  edit undo  command might change the position of + the insertion cursor.

+ +

Note that we could have implemented this example also without making use + of the undo mechanism for text widgets, by saving the last accepted contents + of the widget, along with the cursor position, and restoring them in case any + line gets longer than allowed.  The resulting script would then run with + Tk versions earlier than 8.4, too.

+ +
+

Contents     Start page

+
+ + ADDED embedded/www/tklib/files/modules/wcb/wcbRef.html Index: embedded/www/tklib/files/modules/wcb/wcbRef.html ================================================================== --- /dev/null +++ embedded/www/tklib/files/modules/wcb/wcbRef.html @@ -0,0 +1,1087 @@ + + + Wcb Command Reference + + + + + + + + +
+

Wcb Command Reference

+ +

For Wcb Version 3.6

+ +

by

+ +

Csaba Nemethi

+ +
+ csaba.nemethi@t-online.de +
+
+
+ +

Contents

+ + + + +
+ +

The wcb::callback Command

+ +
+
NAME
+ +
wcb::callback – Retrieve, set, and remove widget + callbacks
+ +
SYNOPSIS
+ +
+
+wcb::callback widgetName before|after option ?callback callback ...?
+
+
+ +
DESCRIPTION
+ +
Retrieves, sets, or removes the callbacks for the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, tile combobox, listbox, tablelist, tile + treeview, text, or ctext widget widgetName, the + argument before or after, and the + command corresponding to option.  The values of + the option argument can be:
+ +
+
    +
  • insert, delete, or + motion, for a Tk or tile entry, BWidget Entry, Tk + or tile spinbox, tile combobox, text, or ctext widget;
  • + +
  • replace, for a text or ctext widget;
  • + +
  • activate, for a listbox, tablelist, or tile + treeview widget;
  • + +
  • selset or selclear, for a + listbox, tablelist, tile treeview, text, or ctext widget;
  • + +
  • seladd or seltoggle, for a + tile treeview widget;
  • + +
  • activatecell, cellselset, + or cellselclear, for a tablelist widget.
  • +
+
+ +
If no arguments after the option + parameter are specified, then the procedure just returns the current + before- or after-callback list, respectively, for the given widget + operation.
+ +
Otherwise:
+ +
+
    +
  • +

    If at least one of the arguments following the + option parameter is a nonempty string, then:

    + +
      +
    • if called for the first time for this widget with at least one + nonempty argument following the option + parameter, then the procedure renames the Tcl command + widgetName to _widgetName + and builds a new procedure widgetName, in which + the execution of the widget operations associated with the above + values of option is preceded by invocations of + the corresponding before-callbacks and followed by calls to the + corresponding after-callbacks, in the global scope;
    • + +
    • it sets the callback list to the one built from + these arguments and returns the new list.
    • +
    +
  • + +
  • If all arguments following the + option parameter are empty, then the procedure + unregisters all the corresponding before- or after-callbacks for the + given widget and returns an empty string.
  • +
+
+ +
When a callback is invoked, the name of the original Tcl + command for the widget widgetName as well as the + command arguments are automatically appended to it as parameters.
+ +
The following table shows the widget subcommands + corresponding to the above values of option, together + with the arguments of these subcommands:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WidgetoptionSubcommandArguments
Tk entry, ttk::entry,
+ BWidget Entry,
+ Tk spinbox, ttk::spinbox,
+ or ttk::combobox
insertinsertindex string
deletedeletefrom ?to?
motionicursorindex
listboxactivateactivateindex
selsetselection setfirst ?last?
selclearselection clearfirst ?last?
tablelist::tablelistactivateactivateindex
selsetselection setfirst ?last?
selclearselection clearfirst ?last?
activatecellactivatecellcellIndex
cellselsetcellselection setfirst ?last?
cellselclearcellselection clearfirst ?last?
ttk::treeviewactivatefocusitem
selsetselection setitemList
seladdselection additemList
selclearselection removeitemList
seltoggleselection toggleitemList
text or ctextinsertinsertindex string ?tagList string + tagList ...?
deletedeletefrom ?to?
replacereplacefrom to string ?tagList + string tagList ...?
motionmark set insertindex
selsettag add selfrom ?to from to + ...?
selcleartag remove selfrom ?to from to + ...?
+
+ +
REMARKS:
+ +
+
    +
  1. You may abbreviate the words before, + after, insert, + delete, replace, + motion, and activate (the + latter not for tablelist widgets) to a minimum of one character.  + Similarly, the first four characters of the words + selset, selclear, + seladd, and seltoggle, the + first eight characters of cellselset and + cellselclear, and the first nine characters of + activatecell are sufficient for Wcb to recognize + these options.
  2. + +
  3. After a successful invocation of this command with at + least one nonempty callback following the option + argument, you can use either the new procedure + widgetName or the original Tcl command + _widgetName to perform any valid operation on the + widget widgetName.  Use the old Tcl command + _widgetName if you want to prevent the callbacks + from being invoked when executing the respective widget + subcommand.
  4. + +
  5. When destroying a widget widgetName + for which wcb::callback has replaced the + corresponding Tcl command with a new procedure, the original command + _widgetName is deleted automatically by the Tcl + interpreter (this is not true in the case of a BWidget Entry, + tablelist, or ctext widget).  The new widget procedure + widgetName would persist, but Wcb arranges for it + to be deleted from within a cleanup script bound to the + <Destroy> event.  This cleanup script is + associated with a binding tag called WcbCleanup, + which is appended to the list of binding tags of the widget the first + time when registering some callbacks for it.  (In the case of a + BWidget Entry, tablelist, or ctext widget, this script also deletes the + original Tcl command _widgetName.)
  6. + +
  7. The cleanup script mentioned above also unregisters all + callbacks defined for widgetName, thus ensuring + that a widget with the same path created later will not inherit them + from the widget just deleted (this can be important in some + applications).  For this reason, you should be careful not to + remove WcbCleanup from the list of binding tags of + the given widget!
  8. +
+
+ +
KEYWORDS
+ +
callback, widget, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile + spinbox, tile combobox, listbox, tablelist, tile treeview, text, ctext
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::cbappend Command

+ +
+
NAME
+ +
wcb::cbappend – Append to a callback list
+ +
SYNOPSIS
+ +
+
+wcb::cbappend widgetName before|after option ?callback callback ...?
+
+
+ +
DESCRIPTION
+ +
This command is almost identical to wcb::callback.  The only difference is that + wcb::cbappend appends the arguments specified + after the option parameter to the current callback list + (if present), while wcb::callback replaces the + old callbacks with these arguments.
+ +
KEYWORDS
+ +
callback, append, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::cbprepend Command

+ +
+
NAME
+ +
wcb::cbprepend – Prepend to a callback list
+ +
SYNOPSIS
+ +
+
+wcb::cbprepend widgetName before|after option ?callback callback ...?
+
+
+ +
DESCRIPTION
+ +
This command is almost identical to wcb::callback.  The only difference is that + wcb::cbprepend prepends the arguments specified + after the option parameter to the current callback list + (if present), while wcb::callback replaces the + old callbacks with these arguments.
+ +
KEYWORDS
+ +
callback, prepend, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::cancel Command

+ +
+
NAME
+ +
wcb::cancel – Cancel a widget command
+ +
SYNOPSIS
+ +
+
+wcb::cancel ?script?
+
+
+ +
DESCRIPTION
+ +
This procedure is designed to be invoked from a before-callback for a + widget command.  It cancels the execution of that command and of the + remaining callbacks, and evaluates the script argument + in the global scope.  If this argument is not specified, it defaults + to the bell command.
+ +
The return value is the one obtained from + script if this argument is specified and + nonempty.  Otherwise, the command returns an empty string.
+ +
KEYWORDS
+ +
cancel, command, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::canceled Command

+ +
+
NAME
+ +
wcb::canceled – Query the canceled status of a + widget command
+ +
SYNOPSIS
+ +
+
+wcb::canceled widgetName option
+
+
+ +
DESCRIPTION
+ +
Returns the value 1 if the most recent invocation of the + widget operation corresponding to widgetName and + option has been aborted by some before-callback by + invoking wcb::cancel; otherwise, + the return value is 0.  The arguments must fulfil the + same restrictions as in the case of the wcb::callback command.
+ +
KEYWORDS
+ +
cancel, command, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::extend Command

+ +
+
NAME
+ +
wcb::extend – Extend the argument list of a widget + command
+ +
SYNOPSIS
+ +
+
+wcb::extend ?arg arg ...?
+
+
+ +
DESCRIPTION
+ +
This procedure is designed to be invoked from a before-callback for a + widget command.  It appends the values given in the optional + arg parameters to the argument list of that + command.  The new argument list will be passed to the remaining + callbacks for that command, too.
+ +
This procedure simply passes its parameters to the + lappend command, called for the argument list of the + respective widget operation.
+ +
KEYWORDS
+ +
extend, argument, command, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::replace Command

+ +
+
NAME
+ +
wcb::replace – Replace arguments of a widget command + with new ones
+ +
SYNOPSIS
+ +
+
+wcb::replace first last ?arg arg ...?
+
+
+ +
DESCRIPTION
+ +
This procedure is designed to be invoked from a before-callback for a + widget command.  It replaces the arguments having the indices + first through last of that command + with the optional arg parameters.  The new + argument list will be passed to the remaining callbacks for that command, + too.  The arguments are numbered from 0 (see the table in the description of the wcb::callback command).
+ +
This procedure simply passes its parameters to the + lreplace command, called for the argument list of the + respective widget operation.
+ +
KEYWORDS
+ +
replace, argument, command, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::pathname Command

+ +
+
NAME
+ +
wcb::pathname – Query the path name of the widget + corresponding to a Tcl command name
+ +
SYNOPSIS
+ +
+
+wcb::pathname origCmd
+
+
+ +
DESCRIPTION
+ +
This procedure returns the path name of the widget corresponding to the + Tcl command name origCmd passed to a callback.
+ +
When a before- or after-callback for a widget is invoked, + the name of the original Tcl command associated with that widget is + automatically appended to it as parameter.  This procedure can be used + within a callback to derive the path name of the widget from the command + name passed to the callback as argument.  It simply returns the string + range obtained from origCmd by removing the + "::_" prefix.
+ +
KEYWORDS
+ +
path name, command, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::changeEntryText + Command

+ +
+
NAME
+ +
wcb::changeEntryText – Change the text of a Tk or + tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget
+ +
SYNOPSIS
+ +
+
+wcb::changeEntryText widgetName string
+
+
+ +
DESCRIPTION
+ +
Replaces the text of the Tk or tile entry, BWidget Entry, Tk or tile + spinbox, or tile combobox widget widgetName with + string, by using the delete and + insert operations.  If the first subcommand is + canceled by some before-delete callback then the + procedure returns without inserting the new text; if the second operation + is canceled by some before-insert callback then the + command restores the original contents of the widget.
+ +
The procedure keeps the position of the insertion + cursor.  The return value is 1 on success and + 0 on failure, i.e., if one of the attempted operations was + canceled by some before-callback.
+ +
KEYWORDS
+ +
Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, tile + combobox, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::postInsertEntryLen + Command

+ +
+
NAME
+ +
wcb::postInsertEntryLen – Query the would-be length + of the text in a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or + tile combobox widget after text insertion
+ +
SYNOPSIS
+ +
+
+wcb::postInsertEntryLen widgetName string
+
+
+ +
DESCRIPTION
+ +
Returns the length of the text that would be contained in the Tk or + tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget + widgetName after inserting + string.
+ +
KEYWORDS
+ +
insert, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, + tile combobox, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::postInsertEntryText + Command

+ +
+
NAME
+ +
wcb::postInsertEntryText – Query the would-be text + of a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox + widget after text insertion
+ +
SYNOPSIS
+ +
+
+wcb::postInsertEntryText widgetName index string
+
+
+ +
DESCRIPTION
+ +
Returns the text that would be contained in the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, or tile combobox widget + widgetName after inserting string + before the character indicated by index.
+ +
KEYWORDS
+ +
insert, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, + tile combobox, widget
+
+ +
+

Contents     Start page

+
+
+ +

The wcb::postDeleteEntryText + Command

+ +
+
NAME
+ +
wcb::postDeleteEntryText – Query the would-be text + of a Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile combobox + widget after text deletion
+ +
SYNOPSIS
+ +
+
+wcb::postDeleteEntryText widgetName from ?to?
+
+
+ +
DESCRIPTION
+ +
Returns the text that would be contained in the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, or tile combobox widget + widgetName after deleting the characters starting with + the one indicated by the index from and stopping just + before to.  If to is not + specified then the return value is the text that would be contained in the + widget after deleting the single character given by + from.
+ +
REMARK:  This command has a variable number (2 + or 3) of arguments, because the delete subcommand of + the Tcl command associated with widgetName expects + either one or two indices as arguments.  For this reason, the correct + way to invoke this command from within a before-delete + callback is as shown in the following example:
+ +
+
+
+proc myBeforeDeleteCallback {w args} {
+    #
+    # Get the text that would be contained in the widget after
+    # deleting the characters specified by $args, which stands
+    # for the one or two arguments passed to delete; pass these
+    # arguments to wcb::postDeleteEntryText by expanding $args
+    #
+    set newText [eval [list wcb::postDeleteEntryText $w] $args]
+    if {!some_condition_on_$newText} {
+        wcb::cancel
+    }
+}
+
+
+
+ +
The following alternative, more elegant solution requires Tcl/Tk 8.5 or + later:
+ +
+
+
+proc myBeforeDeleteCallback {w args} {
+    # . . .
+    set newText [wcb::postDeleteEntryText $w {*}$args]
+    . . .
+}
+
+
+
+ +
KEYWORDS
+ +
delete, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile spinbox, + tile combobox, widget
+
+ +
+

Contents     Start page

+
+
+ +

Before-insert Callbacks for entry, + spinbox, and combobox Widgets

+ +
+
NAME
+ +
wcb::checkStrFor*, wcb::convStrTo*, + wcb::checkEntryFor*, wcb::checkEntryLen – + Before-insert callbacks for Tk entry, tile entry, + BWidget Entry, Tk spinbox, tile spinbox, and tile combobox widgets
+ +
SYNOPSIS
+ +
+
+wcb::checkStrForRegExp  exp w idx str
+
+wcb::checkStrForAlpha       w idx str
+wcb::checkStrForNum         w idx str
+wcb::checkStrForAlnum       w idx str
+
+wcb::convStrToUpper         w idx str
+wcb::convStrToLower         w idx str
+
+wcb::checkEntryForInt       w idx str
+wcb::checkEntryForUInt  max w idx str
+wcb::checkEntryForReal      w idx str
+wcb::checkEntryForFixed cnt w idx str
+
+wcb::checkEntryLen      len w idx str
+
+
+ +
DESCRIPTION
+ +
The wcb::checkStrForRegExp callback checks whether + the string str to be inserted into the Tk or tile + entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget + w is matched by the regular expression + exp; if not, it cancels the insert + operation.
+ +
The three other wcb::checkStrFor* + callbacks check whether the string str to be inserted + into the Tk or tile entry, BWidget Entry, Tk or tile spinbox, or tile + combobox widget w is alphabetic, numeric, or + alphanumeric, respectively; if not, they cancel the + insert operation.  These procedures just invoke + the callback wcb::checkStrForRegExp, passing to it the + Unicode-based patterns {^[[:alpha:]]*$}, + {^[[:digit:]]*$}, and {^[[:alnum:]]*$} for Tk + versions 8.1 or higher, and the ASCII patterns {^[A-Za-z]*$}, + {^[0-9]*$}, and {^[A-Za-z0-9]*$} if Tk version + 8.0 is being used.
+ +
The wcb::convStrTo* callbacks replace + the string str to be inserted into the Tk or tile + entry, BWidget Entry, Tk or tile spinbox, or tile combobox widget + w with its uppercase or lowercase equivalent, + respectively.
+ +
The wcb::checkEntryFor* callbacks check + whether the text contained in the Tk or tile entry, BWidget Entry, Tk or + tile spinbox, or tile combobox widget w after inserting + the string str before the character indicated by the + index idx would represent (the starting part of) an + integer number, unsigned integer no greater than max, + real number, or real number in fixed-point format with at most + cnt digits after the decimal point, respectively; if + not, they cancel the insert operation.  + max and cnt should be nonnegative + numbers or *max = + *  means: no upper bound for the Tk or tile entry, + BWidget Entry, Tk or tile spinbox, or tile combobox value, while  + cnt = *  stands for an unlimited number of + digits after the decimal point.
+ +
The wcb::checkEntryLen callback checks + whether the length of the text contained in the Tk or tile entry, BWidget + Entry, Tk or tile spinbox, or tile combobox widget w + after inserting the string str would be greater than + len; if yes, it cancels the insert + operation.
+ +
These callback procedures are implemented in the file + wcbEntry.tcl, contained in the + scripts directory.  They return an empty + string.
+ +
KEYWORDS
+ +
callback, insert, Tk entry, tile entry, BWidget Entry, Tk spinbox, tile + spinbox, tile combobox, widget
+
+ +
+

Contents     Start page

+
+
+ +

Before-insert Callbacks for text and + ctext Widgets

+ +
+
NAME
+ +
wcb::checkStrsFor*, wcb::convStrsTo* – + Before-insert callbacks for text and ctext widgets
+ +
SYNOPSIS
+ +
+
+wcb::checkStrsForRegExp exp w idx args
+
+wcb::checkStrsForAlpha      w idx args
+wcb::checkStrsForNum        w idx args
+wcb::checkStrsForAlnum      w idx args
+
+wcb::convStrsToUpper        w idx args
+wcb::convStrsToLower        w idx args
+
+
+ +
DESCRIPTION
+ +
The wcb::checkStrsForRegExp callback checks whether + the strings to be inserted into the text or ctext widget + w, contained in the list args of + the form  string ?tagList string + tagList ...?,  are matched by the regular expression + exp; if not, it cancels the insert + operation.
+ +
The three other wcb::checkStrsFor* + callbacks check whether the strings to be inserted into the text or ctext + widget w, contained in the list + args of the form  string + ?tagList string tagList ...?,  are + alphabetic, numeric, or alphanumeric, respectively; if not, they cancel the + insert operation.  These procedures just invoke + the callback wcb::checkStrsForRegExp, passing to it the + Unicode-based patterns {^[[:alpha:]\n]*$}, + {^[[:digit:]\n]*$}, and {^[[:alnum:]\n]*$} for Tk + versions 8.1 or higher, and the ASCII patterns + "^\[A-Za-z\n]*$", "^\[0-9\n]*$", and + "^\[A-Za-z0-9\n]*$" if Tk version 8.0 is being used (in this + case, the presence of the "\n" makes the regular expressions a + bit ugly).
+ +
The wcb::convStrsTo* callbacks replace + the strings to be inserted into the text or ctext widget + w, contained in the list args of + the form  string ?tagList string + tagList ...?,  with their uppercase or lowercase + equivalents, respectively.
+ +
These callback procedures are implemented in the file + wcbText.tcl, contained in the + scripts directory.  They return an empty + string.
+ +
KEYWORDS
+ +
callback, insert, text, ctext, widget
+
+ +
+

Contents     Start page

+
+ + Index: embedded/www/tklib/files/modules/widgetPlus/widgetPlus.html ================================================================== --- embedded/www/tklib/files/modules/widgetPlus/widgetPlus.html +++ embedded/www/tklib/files/modules/widgetPlus/widgetPlus.html @@ -136,10 +136,11 @@
  • TO DO
  • BUGS
  • EXAMPLES
  • +
  • Bugs, Ideas, Feedback
  • See Also
  • Synopsis

    @@ -397,10 +398,18 @@ package require widgetPlus ::widgetPlus::EnableBWidget namespace import widgetPlus::* entryPlus .cb.e -undo 1 -maxundo 0
    + +

    Bugs, Ideas, Feedback

    +

    This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such in the category widgetPlus of the +Tklib Trackers. +Please also report any ideas for enhancements you may have for either +package and/or documentation.

    See Also

    BWidget, ComboBox, Entry, entry, persistentSelection, spinbox, text, ttk::combobox, ttk::entry, ttk::spinbox

    Index: embedded/www/tklib/toc.html ================================================================== --- embedded/www/tklib/toc.html +++ embedded/www/tklib/toc.html @@ -127,61 +127,77 @@ khim Provides key bindings for entering international characters on a keyboard that does not support them +mentry +The Multi-Entry Widget Package + + menubar Creates an instance of the Class. - + notifywindow Provides unobtrusive window for alerts/notifications from Tk applications - + ntext Alternative Bindings for the Text Widget - + ntextBindings Alternative Bindings for the Text Widget - + ntextIndent ntext Indentation for the Text Widget - + ntextWordBreak ntext Word Boundary Detection for the Text Widget - + persistentSelection Enhanced PRIMARY selection - + pie 2D or 3D pie chart object in a canvas - + pieBoxLabeler tkpiechart pie box style labeler class - + piePeripheralLabeler tkpiechart pie peripheral style labeler class - + Plotchart Simple plotting and charting package + +scrollutil +The Scrolling Utilities Package + swaplist A dialog which allows a user to move options between two lists +tablelist +The Multi-Column Listbox and Tree Widget Package + + tooltip Tooltip management + +wcb +The Widget Callback Package + widget Megawidget bundle Index: embedded/www/toc.html ================================================================== --- embedded/www/toc.html +++ embedded/www/toc.html @@ -201,14 +201,30 @@ ipentry An IP address entry widget + +mentry +The Multi-Entry Widget Package + + +scrollutil +The Scrolling Utilities Package + swaplist A dialog which allows a user to move options between two lists + +tablelist +The Multi-Column Listbox and Tree Widget Package + + +wcb +The Widget Callback Package + widget Megawidget bundle Index: embedded/www/toc0.html ================================================================== --- embedded/www/toc0.html +++ embedded/www/toc0.html @@ -201,14 +201,30 @@ ipentry An IP address entry widget + +mentry +The Multi-Entry Widget Package + + +scrollutil +The Scrolling Utilities Package + swaplist A dialog which allows a user to move options between two lists + +tablelist +The Multi-Column Listbox and Tree Widget Package + + +wcb +The Widget Callback Package + widget Megawidget bundle Index: embedded/www/toc1.html ================================================================== --- embedded/www/toc1.html +++ embedded/www/toc1.html @@ -155,10 +155,17 @@ +
    khim Provides key bindings for entering international characters on a keyboard that does not support them
    +
    mentry
    + + + + +
    mentryThe Multi-Entry Widget Package
    menubar
    @@ -202,17 +209,31 @@
    menubar
    +
    Plotchart Simple plotting and charting package
    +
    scrollutil
    + + + + +
    scrollutilThe Scrolling Utilities Package
    swaplist
    +
    swaplist A dialog which allows a user to move options between two lists
    +
    tablelist
    + + + + +
    tablelistThe Multi-Column Listbox and Tree Widget Package
    tkpiechart
    @@ -235,10 +256,17 @@
    canvasLabel
    +
    tooltip Tooltip management
    +
    wcb
    + + + + +
    wcbThe Widget Callback Package
    widget
    Index: installer.tcl ================================================================== --- installer.tcl +++ installer.tcl @@ -44,32 +44,30 @@ puts $index "# Tcl package index file, version 1.1" puts $index "# Do NOT edit by hand. Let $package install generate this file." puts $index "# Generated by $package installer for version $version" - puts $index { -# All tklib packages need Tcl 8 (use [namespace]) -if {![package vsatisfies [package provide Tcl] 8]} {return} - -# Extend the auto_path to make tklib packages available -if {[lsearch -exact $::auto_path $dir] == -1} { - lappend ::auto_path $dir -} - -# For Tcl 8.3.1 and later, that's all we need -if {[package vsatisfies [package provide Tcl] 8.4]} {return} -if {(0 == [catch { - package vcompare [info patchlevel] [info patchlevel] -}]) && ( - [package vcompare [info patchlevel] 8.3.1] >= 0 -)} {return} - -# For older Tcl releases, here are equivalent contents -# of the pkgIndex.tcl files of all the modules - -if {![package vsatisfies [package provide Tcl] 8.0]} {return} -} + puts $index [string map [list \n\t {} "\n " \n \t {}] { + # All tklib packages need Tcl 8 (use [namespace]) + if {![package vsatisfies [package provide Tcl] 8]} {return} + + # Extend the auto_path to make tklib packages available + if {[lsearch -exact $::auto_path $dir] == -1} { + lappend ::auto_path $dir + } + + # For Tcl 8.3.1 and later, that's all we need + if {[package vsatisfies [package provide Tcl] 8.4]} {return} + if {(0 == [catch { + package vcompare [info patchlevel] [info patchlevel] + }]) && ([package vcompare [info patchlevel] 8.3.1] >= 0)} {return} + + # For older Tcl releases, here are equivalent contents + # of the pkgIndex.tcl files of all the modules + + if {![package vsatisfies [package provide Tcl] 8.0]} {return} + }] puts $index "" puts $index "set maindir \$dir" foreach pi [lsort [glob -nocomplain [file join $outdir * pkgIndex.tcl]]] { set subdir [file tail [file dirname $pi]] Index: modules/datefield/datefield.man ================================================================== --- modules/datefield/datefield.man +++ modules/datefield/datefield.man @@ -5,12 +5,12 @@ [keywords clock] [keywords date] [keywords dateentry] [keywords entry] [keywords widget] -[copyright {Keith Vetter } and -{Thomas Wunderlich }] +[copyright {Keith Vetter }] +[copyright {Thomas Wunderlich }] [moddesc {Tk datefield widget}] [titledesc {Tk datefield widget}] [category Widget] [require Tk] [require datefield [opt 0.3]] @@ -17,11 +17,11 @@ [description] The [package datefield] package provides the datefield widget which is an enhanced text entry widget for the purpose of date entry. There are three valid formats for the dates which can be entered: -[list_begin [enum]] +[list_begin enumerated] [enum] English form MM/DD/YYYY using [arg {-format "%m/%d/%Y"}] (default) [enum] German form DD.MM.YYYY using [arg {-format "%d.%m.%Y"}] [enum] ISO form YYYY-MM-DD using [arg {-format "%Y-%m-%d"}] [list_end] Index: modules/ntext/pkgIndex.tcl ================================================================== --- modules/ntext/pkgIndex.tcl +++ modules/ntext/pkgIndex.tcl @@ -1,1 +1,2 @@ +if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded ntext 1.0b3 [list source [file join $dir ntext.tcl]] Index: modules/persistentSelection/persistentSelection.tcl ================================================================== --- modules/persistentSelection/persistentSelection.tcl +++ modules/persistentSelection/persistentSelection.tcl @@ -25,10 +25,13 @@ # MODIFICATIONS. # # ------------------------------------------------------------------------------ # 80 columns # Conventional use of namespace/package names. + +package require Tcl 8.5 +package require Tk 8.5 # ------------------------------------------------------------------------------ # Module persistentSelection # ------------------------------------------------------------------------------ # Module to retain a non-empty PRIMARY selection. Index: modules/persistentSelection/pkgIndex.tcl ================================================================== --- modules/persistentSelection/pkgIndex.tcl +++ modules/persistentSelection/pkgIndex.tcl @@ -1,1 +1,2 @@ +if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded persistentSelection 1.0b1 [list source [file join $dir persistentSelection.tcl]] Index: modules/plotchart/plotchart.man ================================================================== --- modules/plotchart/plotchart.man +++ modules/plotchart/plotchart.man @@ -1453,11 +1453,11 @@ [call [cmd \$xyplot] minmax [arg series] [arg xcrd] [arg ymin] [arg ymax]] Draw a filled strip representing a minimum and a maximum. The configuration of the series influences the polygon as follows: [term -fillcolour] is used to fill the polygon, [term -colour] is used for the boundary (set it to {} if no boundary is required and [term -width] determines the width of the boundary. -[nl] +[para] The arguments [term ymin] and [term ymax] may be empty to get an extra vertex in the strip. If both are empty, a new strip is started. For best results, the x-coordinate should be specified in ascending order. [list_begin arguments] Index: modules/widgetPlus/entryExtras.test ================================================================== --- modules/widgetPlus/entryExtras.test +++ modules/widgetPlus/entryExtras.test @@ -1,12 +1,28 @@ +# -*- tcl -*- # This file is a Tcl script to test entry widgets in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. + +if {![package vsatisfies [package provide Tcl] 8.5]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tcl 8.5, have [package present Tcl]" + return +} + +# Future: put all tests under constraint tk and set constraint properly +if {[catch { package require Tk 8.5 } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tk 8.5, $msg" + return +} + +::tcltest::testConstraint tk 1 package require widgetPlus namespace import ::widgetPlus::entryPlus # ------------------------------------------------------------ @@ -14,11 +30,11 @@ # entryPlus.test which is copied with mods from Tk entry.test. # ------------------------------------------------------------ package require tcltest 2.2 namespace import ::tcltest::* -eval tcltest::configure $argv +catch { tcltest::configure {*}$::argv } tcltest::loadTestedCommands # ------------------------------------------------------------ # First test the entry widget when changing its -textvariable. # Cf. entry.test 5.* and 22.* Index: modules/widgetPlus/entryPlus.test ================================================================== --- modules/widgetPlus/entryPlus.test +++ modules/widgetPlus/entryPlus.test @@ -1,12 +1,28 @@ +# -*- tcl -*- # This file is a Tcl script to test entry widgets in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. + +if {![package vsatisfies [package provide Tcl] 8.5]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tcl 8.5, have [package present Tcl]" + return +} + +# Future: put all tests under constraint tk and set constraint properly +if {[catch { package require Tk 8.5 } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tk 8.5, $msg" + return +} + +::tcltest::testConstraint tk 1 package require widgetPlus namespace import ::widgetPlus::entryPlus # ------------------------------------------------------------------------------ @@ -32,37 +48,41 @@ # obtained when using "entryPlus" instead of "entry". # ------------------------------------------------------------------------------ package require tcltest 2.2 namespace import ::tcltest::* -eval tcltest::configure $argv +catch { tcltest::configure {*}$::argv } tcltest::loadTestedCommands +# Initialize +set scrollInfo {Inf Inf} +set x {} + # For xscrollcommand proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args } # For trace variable proc override args { - global x - set x 12345 + global x + set x 12345 } # Procedures used in widget VALIDATION tests proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 1 } proc doval2 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - set ::e mydata - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + set ::e mydata + return 1 } proc doval3 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 0 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } set cy [font metrics {Courier -12} -linespace] @@ -724,19 +744,24 @@ } -body { .e } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"} + test entry-3.1 {EntryWidgetCmd procedure} -setup { entryPlus .e pack .e update } -body { .e } -cleanup { destroy .e -} -returnCodes error -result {wrong # args: should be ".e subcommand ?arg ...?"} +} -returnCodes error \ + -result [expr {[package vsatisfies [package present Tcl] 8.6] + ? "wrong # args: should be \".e subcommand ?arg ...?\"" + : "wrong # args: should be \".e subcommand ?argument ...?\""}] + test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entryPlus .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { Index: modules/widgetPlus/pkgIndex.tcl ================================================================== --- modules/widgetPlus/pkgIndex.tcl +++ modules/widgetPlus/pkgIndex.tcl @@ -1,1 +1,2 @@ +if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded widgetPlus 1.0b2 [list source [file join $dir widgetPlus.tcl]] Index: modules/widgetPlus/spinboxPlus.test ================================================================== --- modules/widgetPlus/spinboxPlus.test +++ modules/widgetPlus/spinboxPlus.test @@ -1,16 +1,32 @@ +# -*- tcl -*- # This file is a Tcl script to test spinbox widgets in Tk. It is # organized in the standard fashion for Tcl tests. # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. +if {![package vsatisfies [package provide Tcl] 8.5]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tcl 8.5, have [package present Tcl]" + return +} + +# Future: put all tests under constraint tk and set constraint properly +if {[catch { package require Tk 8.5 } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tk 8.5, $msg" + return +} + +::tcltest::testConstraint tk 1 + package require tcltest 2.2 namespace import ::tcltest::* -eval tcltest::configure $argv +catch { tcltest::configure {*}$::argv } tcltest::loadTestedCommands package require widgetPlus namespace import ::widgetPlus::spinboxPlus @@ -35,34 +51,38 @@ # Copies of the same tests without the ".spinbox" suffix or the added constraints # have the test result modified to reflect the (valid but different) value # obtained when using "spinboxPlus" instead of "spinbox". # ------------------------------------------------------------------------------ +# Initialize +set scrollInfo {Inf Inf} +set x {} + # For xscrollcommand proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args } # For trace variable proc override args { - global x - set x 12345 + global x + set x 12345 } # Procedures used in widget VALIDATION tests proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 1 } proc doval2 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - set ::e mydata - return 1 + set ::vVals [list $W $d $i $P $s $S $v $V] + set ::e mydata + return 1 } proc doval3 {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 0 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } set cy [font metrics {Courier -12} -linespace] test spinbox-1.1 {configuration option: "activebackground"} -setup { @@ -1067,12 +1087,10 @@ test spinbox-2.5 {Tk_SpinboxCmd procedure} -body { spinboxPlus .e } -cleanup { destroy .e } -result {.e} - - test spinbox-3.1.spinbox {SpinboxWidgetCmd procedure} -constraints { spinboxErrorMsgDifferent } -setup { spinboxPlus .e pack .e @@ -1080,19 +1098,24 @@ } -body { .e } -cleanup { destroy .e } -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"} + test spinbox-3.1 {SpinboxWidgetCmd procedure} -setup { spinboxPlus .e pack .e update } -body { .e } -cleanup { destroy .e -} -returnCodes error -result {wrong # args: should be ".e subcommand ?arg ...?"} +} -returnCodes error \ + -result [expr {[package vsatisfies [package present Tcl] 8.6] + ? "wrong # args: should be \".e subcommand ?arg ...?\"" + : "wrong # args: should be \".e subcommand ?argument ...?\""}] + test spinbox-3.2 {SpinboxWidgetCmd procedure, "bbox" widget command} -setup { spinboxPlus .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e update } -body { Index: modules/widgetPlus/ttkComboboxPlus.test ================================================================== --- modules/widgetPlus/ttkComboboxPlus.test +++ modules/widgetPlus/ttkComboboxPlus.test @@ -1,5 +1,22 @@ +# -*- tcl -*- + +if {![package vsatisfies [package provide Tcl] 8.5]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tcl 8.5, have [package present Tcl]" + return +} + +# Future: put all tests under constraint tk and set constraint properly +if {[catch { package require Tk 8.5 } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tk 8.5, $msg" + return +} + +::tcltest::testConstraint tk 1 + # # ttk::combobox widget tests # package require Tk 8.5 Index: modules/widgetPlus/ttkEntryPlus.test ================================================================== --- modules/widgetPlus/ttkEntryPlus.test +++ modules/widgetPlus/ttkEntryPlus.test @@ -1,5 +1,22 @@ +# -*- tcl -*- + +if {![package vsatisfies [package provide Tcl] 8.5]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tcl 8.5, have [package present Tcl]" + return +} + +# Future: put all tests under constraint tk and set constraint properly +if {[catch { package require Tk 8.5 } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tk 8.5, $msg" + return +} + +::tcltest::testConstraint tk 1 + # # Tile package: entry widget tests # package require Tk 8.5 @@ -18,20 +35,22 @@ # "ttk::entry", including important matters such as validation. # # All tests pass. # ------------------------------------------------------------------------------ -variable scrollInfo +# Initialize +set scrollInfo {Inf Inf} +set bgerror {} + proc scroll args { global scrollInfo set scrollInfo $args } # Some of the tests raise background errors; # override default bgerror to catch them. # -variable bgerror "" proc bgerror {error} { variable bgerror $error variable bgerrorInfo $::errorInfo variable bgerrorCode $::errorCode } Index: modules/widgetPlus/ttkSpinboxPlus.test ================================================================== --- modules/widgetPlus/ttkSpinboxPlus.test +++ modules/widgetPlus/ttkSpinboxPlus.test @@ -1,5 +1,22 @@ +# -*- tcl -*- + +if {![package vsatisfies [package provide Tcl] 8.5]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tcl 8.5, have [package present Tcl]" + return +} + +# Future: put all tests under constraint tk and set constraint properly +if {[catch { package require Tk 8.5 } msg]} { + puts " Aborting the tests found in \"[file tail [info script]]\"." + puts " Requiring Tk 8.5, $msg" + return +} + +::tcltest::testConstraint tk 1 + # # ttk::spinbox widget tests # package require widgetPlus Index: modules/widgetPlus/widgetPlus.man ================================================================== --- modules/widgetPlus/widgetPlus.man +++ modules/widgetPlus/widgetPlus.man @@ -1,13 +1,14 @@ +[vset VERSION 1.0] [comment {-*- tcl -*- widgetPlus manpage}] -[manpage_begin widgetPlus n 1.0] +[manpage_begin widgetPlus n [vset VERSION]] [moddesc {Enhanced Entry, Spinbox, and Combobox Widgets with Undo/Redo and other useful features}] [titledesc {Enhanced Entry, Spinbox, and Combobox Widgets with Undo/Redo and other useful features}] [require Tcl 8.5] [require Tk 8.5] [require snit] -[require widgetPlus [opt 1.0]] +[require widgetPlus [opt [vset VERSION]]] [description] The [package widgetPlus] package adds new features to the widgets [syscmd [widget entry]], [syscmd [widget spinbox]], [syscmd [widget ttk::entry]], [syscmd [widget ttk::spinbox]], and [syscmd [widget ttk::combobox]]. [para] @@ -333,7 +334,11 @@ namespace import widgetPlus::* entryPlus .cb.e -undo 1 -maxundo 0 }] -[see_also entry spinbox ttk::entry ttk::spinbox ttk::combobox text persistentSelection BWidget ComboBox Entry] +[see_also entry spinbox ttk::entry ttk::spinbox ttk::combobox] +[see_also text persistentSelection BWidget ComboBox Entry] + +[vset CATEGORY widgetPlus] +[include ../../support/devel/doc/feedback.inc] [manpage_end] Index: modules/widgetPlus/widgetPlus.tcl ================================================================== --- modules/widgetPlus/widgetPlus.tcl +++ modules/widgetPlus/widgetPlus.tcl @@ -30,11 +30,12 @@ # Conventional use of namespace/package names. # Defines bindtags EntryPlus, SpinboxPlus, TEntryPlus, TSpinboxPlus, # TComboboxPlus, and BwEntryPlus. # Docs are in "man n widgetPlus". -package require Tk +package require Tcl 8.5 +package require Tk 8.5 package require snit namespace eval ::widgetPlus { variable BWidgetEnabled 0 namespace export entryPlus spinboxPlus Index: support/devel/sak/localdoc/localdoc.tcl ================================================================== --- support/devel/sak/localdoc/localdoc.tcl +++ support/devel/sak/localdoc/localdoc.tcl @@ -86,10 +86,133 @@ -exclude {*/support/*} \ -merge \ -o embedded/www \ html .] + # Special docs, pre-made HTML. Integrate into the docs made above. + + puts "Special HTML..." + + set base embedded/www + set dst [lindex [glob $base/*/files/modules] 0] + set xbase [file dirname [file dirname $dst]] + + foreach special [glob -nocomplain modules/*/doc/index.html] { + set src [file dirname $special] + set mod [file tail [file dirname $src]] + set desc [xdesc $special] + puts "\t$mod @ $src... ($desc)" + + # Base assembly + file copy $src $dst/$mod + + # Toc integration. + write $xbase/toc.html [xbasetoc [cat $xbase/toc.html] $mod $desc] + write $base/toc.html [basetoc [cat $base/toc.html] $mod $desc] + write $base/toc0.html [basetoc0 [cat $base/toc0.html] $mod $desc] + write $base/toc1.html [basetoc1 [cat $base/toc1.html] $mod $desc] + } + return +} + +proc sak::localdoc::xdesc {path} { + set index [cat $path] + regexp {(.*)} $index -> desc + return [join [lrange [split $desc] 0 end-2] { }] +} + +proc sak::localdoc::basetoc {toc mod mdesc} { + regexp {^(.*>Widget
    \n
    widget
    )(.*)(
    \n\n
    .*)$} $toc -> h t f + set tn [xtable $t $mod $mdesc tklib/] + return $h\n$tn$f +} + +proc sak::localdoc::basetoc0 {toc mod mdesc} { + regexp {^(.*>Widget
    \n)(.*)(
    .*)$} $toc -> h t f + set tn [xtable $t $mod $mdesc tklib/] + return $h\n$tn$f +} + +proc sak::localdoc::basetoc1 {toc mod mdesc} { + regexp {^(.*
    Modules
    )(.*)(
    \n
    .*)$} $toc -> h t f + set tn [xdd $t $mod $mdesc tklib/] + return $h\n$tn$f +} + +proc sak::localdoc::xbasetoc {toc mod mdesc} { + regexp {^(.*)(.*)(
    .*)$} $toc -> h t f + set tn [xtable $t $mod $mdesc] + return $h\n$tn$f +} + +proc sak::localdoc::xdd {t mod mdesc {prefix {}}} { + set check 1 + set tn "" + + foreach line [split [string trim $t] \n] { + if {!$check} { + append tn $line \n + continue + } + if {[regexp {
    .*
    } $line -> name]} { + if {$check && ([string compare $name $mod] > 0)} { + # Insert before first entry just lexicographically after the new module. + set check 0 + append tn "
    $mod
    " \n + append tn "" \n + append tn "" \n + append tn "" \n + append tn "" \n + append tn "" \n + append tn "
    $mod$mdesc
    " \n + } + } + append tn $line \n + } + + return $tn +} + +proc sak::localdoc::xtable {t mod mdesc {prefix {}}} { + set check 1 + set even 1 + set tn "" + foreach {__ link desc post} [split [string trim $t] \n] { + #puts |$__|\n|$link|\n|$desc|\n|$post| + regexp {} $link -> name + + if {$check && ([string compare $name $mod] > 0)} { + # Insert before first entry just lexicographically after the new module. + set check 0 + append tn "" \n + append tn "$mod" \n + append tn "$mdesc" \n + append tn "" \n + set even [expr {1-$even}] + } + + append tn "" \n + append tn $link \n + append tn $desc \n + append tn $post \n + set even [expr {1-$even}] + } + return $tn +} + +proc sak::localdoc::cat {path} { + set c [open $path r] + set d [read $c] + close $c + return $d +} + +proc sak::localdoc::write {path d} { + puts "\t\tRewriting $path" + set c [open $path w] + puts -nonewline $c $d + close $c return } # ### ### ### ######### ######### ######### Index: support/devel/sak/old/help.txt ================================================================== --- support/devel/sak/old/help.txt +++ support/devel/sak/old/help.txt @@ -93,10 +93,11 @@ gendist - Generate distribution from CVS snapshot rpmspec - Generate a RPM spec file for the bundle. gentip55 - Generate a TIP55-style DESCRIPTION.txt file. yml - Generate a YAML description file. + tap - Generate TDK .tap description file. release name sf-user-id - Marks the current state of all files as a new release. This updates all ChangeLog's, and regenerates the contents of PACKAGES Index: support/devel/sak/util/registry.tcl ================================================================== --- support/devel/sak/util/registry.tcl +++ support/devel/sak/util/registry.tcl @@ -38,11 +38,11 @@ } namespace eval ::sak::registry { variable _here [file dirname [info script]] - variable statedir [file join ~ .Tcllib] + variable statedir [file join ~ .Tklib] variable state [file join $statedir Registry] variable _local {} } ## Index: support/installation/version.tcl ================================================================== --- support/installation/version.tcl +++ support/installation/version.tcl @@ -1,2 +1,2 @@ -package_version 0.6 +package_version 0.7 package_name tklib ADDED support/releases/history/README-0.7.txt Index: support/releases/history/README-0.7.txt ================================================================== --- /dev/null +++ support/releases/history/README-0.7.txt @@ -0,0 +1,85 @@ +Overview +======== + + 5 new packages in 5 modules + 11 changed packages in 9 modules + 2 internally changed packages in 1 modules + 47 unchanged packages in 19 modules + 79 packages, total in 31 modules, total + +New in tklib 0.7 +================ + + Module Package New Version Comments + --------------------- --------------------- ------------- ---------- + canvas canvas::gradient 0.2 + notifywindow notifywindow 1.0 + persistentSelection persistentSelection 1.0b1 + scrollutil scrollutil::common 1.5 + widgetPlus widgetPlus 1.0b2 + --------------------- --------------------- ------------- ---------- + +Changes from tklib 0.6 to 0.7 +============================= + + tklib 0.6 tklib 0.7 + Module Package Old Version New Version Comments + --------------- -------------------- ------------- ------------- ---------------- + controlwidget rdial 0.3 0.7 D EF EX + crosshair crosshair 1.1 1.2 B EF EX + datefield datefield 0.2 0.3 D EF + mentry mentry::common 3.6 3.10 B D EF I + plotchart Plotchart 2.1.0 2.4.1 B D EF I + --------------- -------------------- ------------- ------------- ---------------- + tablelist tablelist::common 5.7 API B D EF I P + tablelist::common 6.8 API B D EF I P + --------------- -------------------- ------------- ------------- ---------------- + tooltip tooltip 1.4.4 1.4.6 B D EF + --------------- -------------------- ------------- ------------- ---------------- + wcb Wcb 3.4 3.6 B D EF I P + wcb 3.4 3.6 B D EF I P + --------------- -------------------- ------------- ------------- ---------------- + widgetl widget::listentry 0.1.1 0.1.2 D I + widget::listsimple 0.1.1 0.1.2 D I + --------------- -------------------- ------------- ------------- ---------------- + +Invisible changes (documentation, testsuites) +============================================= + + tklib 0.6 tklib 0.7 + Module Package Old Version New Version Comments + --------------- --------------- ------------- ------------- ---------- + controlwidget controlwidget 0.1 0.1 D + meter 1.0 1.0 EX + --------------- --------------- ------------- ------------- ---------- + +Unchanged +========= + + autoscroll, bindDown, canvas::drag, canvas::edit::points, + canvas::edit::polyline, canvas::edit::quadrilateral, + canvas::highlight, canvas::mvg, canvas::snap, canvas::sqmap, + canvas::tag, canvas::track::lines, canvas::zoom, chatwidget, + ctext, cursor, diagram, diagram::application, + diagram::attribute, diagram::basic, diagram::core, + diagram::direction, diagram::element, diagram::navigation, + diagram::point, getstring, history, ico, ipentry, khim, led, + menubar, menubar::debug, menubar::node, menubar::tree, plotanim, + radioMatrix, style, style::as, style::lobster, swaplist, + tachometer, tipstack, tkpiechart, voltmeter, widget::validator, + xyplot + +Legend Change Details Comments + ------ ------- --------- + Major API: ** incompatible ** API changes. + + Minor EF : Extended functionality, API. + I : Major rewrite, but no API change + + Patch B : Bug fixes. + EX : New examples. + P : Performance enhancement. + + None T : Testsuite changes. + D : Documentation updates. + Index: tklib.spec ================================================================== --- tklib.spec +++ tklib.spec @@ -1,8 +1,8 @@ # $Id: package_rpm.txt,v 1.1 2009/02/07 05:18:22 andreas_kupries Exp $ -%define version 0.6 +%define version 0.7 %define directory /usr Summary: The standard Tk library Name: tklib Version: %{version} Index: tklib.tap ================================================================== --- tklib.tap +++ tklib.tap @@ -1,14 +1,14 @@ format {TclDevKit Project File} fmtver 2.0 fmttool {TclDevKit TclApp PackageDefinition} 2.5 -## Saved at : Mon Mar 11 14:48:34 PST 2013 -## By : andreask +## Saved at : Sun Feb 09 12:43:25 PST 2020 +## By : aku ## ## Generated by "sak.tcl tap" -## of tklib 0.6 +## of tklib 0.7 ######## ##### ### ## @@ -15,11 +15,11 @@ # # ############### # Complete bundle -Package {tklib 0.6} +Package {tklib 0.7} Base @TAP_DIR@ Platform * Desc {Tklib: Bundle of all packages} Path pkgIndex.tcl Path autoscroll @@ -37,19 +37,23 @@ Path ipentry Path khim Path mentry Path menubar Path ntext +Path notifywindow +Path persistentSelection Path plotchart +Path scrollutil Path style Path swaplist Path tablelist Path tkpiechart Path tooltip Path wcb Path widget Path widgetl +Path widgetPlus Path widgetv # ################### # Module "autoscroll" # [1] | "autoscroll" (1.1) @@ -65,21 +69,22 @@ # # ################### # ############### # Module "canvas" -# [1] | "canvas::tag" (0.1) -# [2] | "canvas::highlight" (0.1) +# [1] | "canvas::sqmap" (0.3.1) +# [2] | "canvas::snap" (1.0.1) # [3] | "canvas::track::lines" (0.1) -# [4] | "canvas::edit::quadrilateral" (0.1) -# [5] | "canvas::zoom" (0.2.1) -# [6] | "canvas::mvg" (1) -# [7] | "canvas::snap" (1.0.1) -# [8] | "canvas::edit::polyline" (0.1) -# [9] | "canvas::drag" (0.1) -# [10] | "canvas::sqmap" (0.3.1) -# [11] | "canvas::edit::points" (0.1) +# [4] | "canvas::tag" (0.1) +# [5] | "canvas::drag" (0.1) +# [6] | "canvas::edit::polyline" (0.1) +# [7] | "canvas::gradient" (0.2) +# [8] | "canvas::highlight" (0.1) +# [9] | "canvas::mvg" (1) +# [10] | "canvas::zoom" (0.2.1) +# [11] | "canvas::edit::quadrilateral" (0.1) +# [12] | "canvas::edit::points" (0.1) # -------+ Package {__canvas 0.0} Platform * Desc {Variations on a canvas} @@ -87,68 +92,74 @@ Base @TAP_DIR@/canvas Path canvas_drag.tcl Path canvas_epoints.tcl Path canvas_epolyline.tcl Path canvas_equad.tcl +Path canvas_gradient.tcl Path canvas_highlight.tcl Path canvas_mvg.tcl Path canvas_snap.tcl Path canvas_sqmap.tcl Path canvas_tags.tcl Path canvas_trlines.tcl Path canvas_zoom.tcl Path pkgIndex.tcl + +Package {canvas::sqmap 0.3.1} +See __canvas +Platform * +Desc {Canvas with map background based on square tiles} + +Package {canvas::snap 1.0.1} +See __canvas +Platform * +Desc {Canvas snapshot to Tk photo image} + +Package {canvas::track::lines 0.1} +See __canvas +Platform * +Desc {Tklib package} Package {canvas::tag 0.1} See __canvas Platform * -Desc {Easier management of the tags on canvas items or item groups} +Desc {Manage a group of rubber band lines} + +Package {canvas::drag 0.1} +See __canvas +Platform * +Desc {Manage the dragging of canvas items or item groups} + +Package {canvas::edit::polyline 0.1} +See __canvas +Platform * +Desc {Editing a polyline on a canvas} + +Package {canvas::gradient 0.2} +See __canvas +Platform * +Desc {Canvas with a gradient background} Package {canvas::highlight 0.1} See __canvas Platform * Desc {Manage the highlighting of canvas items or item groups} -Package {canvas::track::lines 0.1} -See __canvas -Platform * -Desc {Tklib package} - -Package {canvas::edit::quadrilateral 0.1} -See __canvas -Platform * -Desc {Editing a quadrilateral on a canvas} - -Package {canvas::zoom 0.2.1} -See __canvas -Platform * -Desc {Zoom control for canvas::sqmap} - Package {canvas::mvg 1} See __canvas Platform * Desc {Canvas to ImageMagick MVG vector format} -Package {canvas::snap 1.0.1} -See __canvas -Platform * -Desc {Canvas snapshot to Tk photo image} - -Package {canvas::edit::polyline 0.1} -See __canvas -Platform * -Desc {Editing a polyline on a canvas} - -Package {canvas::drag 0.1} -See __canvas -Platform * -Desc {Manage the dragging of canvas items or item groups} - -Package {canvas::sqmap 0.3.1} -See __canvas -Platform * -Desc {Canvas with map background based on square tiles} +Package {canvas::zoom 0.2.1} +See __canvas +Platform * +Desc {Zoom control for canvas::sqmap} + +Package {canvas::edit::quadrilateral 0.1} +See __canvas +Platform * +Desc {Editing a quadrilateral on a canvas} Package {canvas::edit::points 0.1} See __canvas Platform * Desc {Editing a cloud of points on a canvas} @@ -171,13 +182,13 @@ # # ################### # ###################### # Module "controlwidget" -# [1] | "rdial" (0.3) -# [2] | "radioMatrix" (1.0) -# [3] | "tachometer" (0.1) +# [1] | "tachometer" (0.1) +# [2] | "rdial" (0.7) +# [3] | "radioMatrix" (1.0) # [4] | "controlwidget" (0.1) # [5] | "meter" (1.0) # [6] | "bindDown" (1.0) # [7] | "led" (1.0) # [8] | "voltmeter" (0.1) @@ -196,22 +207,22 @@ Path rdial.tcl Path tachometer.tcl Path vertical_meter.tcl Path voltmeter.tcl -Package {rdial 0.3} -See __controlwidget -Platform * -Desc {Tklib package} - -Package {radioMatrix 1.0} -See __controlwidget -Platform * -Desc {Tklib package} - Package {tachometer 0.1} See __controlwidget +Platform * +Desc {Tklib package} + +Package {rdial 0.7} +See __controlwidget +Platform * +Desc {Tklib package} + +Package {radioMatrix 1.0} +See __controlwidget Platform * Desc {Tklib package} Package {controlwidget 0.1} See __controlwidget @@ -271,14 +282,14 @@ # # ############### # ################## # Module "crosshair" -# [1] | "crosshair" (1.1) +# [1] | "crosshair" (1.2) # -------+ -Package {crosshair 1.1} +Package {crosshair 1.2} Platform * Desc {Crosshairs for Tk canvas} Base @TAP_DIR@/crosshair Path crosshair.tcl Path pkgIndex.tcl @@ -286,14 +297,14 @@ # # ################## # ################## # Module "datefield" -# [1] | "datefield" (0.2) +# [1] | "datefield" (0.3) # -------+ -Package {datefield 0.2} +Package {datefield 0.3} Platform * Desc {Tk datefield widget} Base @TAP_DIR@/datefield Path datefield.tcl Path pkgIndex.tcl @@ -301,16 +312,16 @@ # # ################## # ################# # Module "diagrams" -# [1] | "diagram::navigation" (1) -# [2] | "diagram::application" (1.2) -# [3] | "diagram" (1) -# [4] | "diagram::attribute" (1) -# [5] | "diagram::direction" (1) -# [6] | "diagram::core" (1) +# [1] | "diagram::attribute" (1) +# [2] | "diagram" (1) +# [3] | "diagram::application" (1.2) +# [4] | "diagram::navigation" (1) +# [5] | "diagram::core" (1) +# [6] | "diagram::direction" (1) # [7] | "diagram::element" (1) # [8] | "diagram::point" (1) # [9] | "diagram::basic" (1.0.1) # -------+ @@ -328,37 +339,37 @@ Path element.tcl Path navigation.tcl Path pkgIndex.tcl Path point.tcl -Package {diagram::navigation 1} -See __diagrams -Platform * -Desc {Tklib package} - -Package {diagram::application 1.2} +Package {diagram::attribute 1} See __diagrams Platform * Desc {Tklib package} Package {diagram 1} See __diagrams Platform * Desc {Diagram drawing} -Package {diagram::attribute 1} +Package {diagram::application 1.2} See __diagrams Platform * Desc {Tklib package} -Package {diagram::direction 1} +Package {diagram::navigation 1} See __diagrams Platform * Desc {Tklib package} Package {diagram::core 1} See __diagrams +Platform * +Desc {Tklib package} + +Package {diagram::direction 1} +See __diagrams Platform * Desc {Tklib package} Package {diagram::element 1} See __diagrams @@ -475,14 +486,14 @@ # # ############# # ############### # Module "mentry" -# [1] | "mentry::common" (3.6) +# [1] | "mentry::common" (3.10) # -------+ -Package {mentry::common 3.6} +Package {mentry::common 3.10} Platform * Desc {Tklib package} Base @TAP_DIR@/mentry Path mentry.tcl Path mentry_tile.tcl @@ -502,12 +513,12 @@ # ################ # Module "menubar" # [1] | "menubar::node" (0.5) # [2] | "menubar::debug" (0.5) -# [3] | "menubar" (0.5) -# [4] | "menubar::tree" (0.5) +# [3] | "menubar::tree" (0.5) +# [4] | "menubar" (0.5) # -------+ Package {__menubar 0.0} Platform * Desc {Create and manipulate menubars} @@ -527,43 +538,72 @@ Package {menubar::debug 0.5} See __menubar Platform * Desc {Tklib package} +Package {menubar::tree 0.5} +See __menubar +Platform * +Desc {Tklib package} + Package {menubar 0.5} See __menubar Platform * Desc {Creates an instance of the Class.} -Package {menubar::tree 0.5} -See __menubar -Platform * -Desc {Tklib package} - # # ################ # ############## # Module "ntext" -# [1] | "ntext" (0.81) # -------+ -Package {ntext 0.81} +Package {menubar 0.5} Platform * -Desc {ntext Word Boundary Detection for the Text Widget} +Desc {Creates an instance of the Class.} Base @TAP_DIR@/ntext Path ntext.tcl Path pkgIndex.tcl # # ############## +# ##################### +# Module "notifywindow" +# [1] | "notifywindow" (1.0) +# -------+ + +Package {notifywindow 1.0} +Platform * +Desc {Provides unobtrusive window for alerts/notifications from Tk applications} +Base @TAP_DIR@/notifywindow +Path notifywindow.tcl +Path pkgIndex.tcl + +# +# ##################### + +# ############################ +# Module "persistentSelection" +# [1] | "persistentSelection" (1.0b1) +# -------+ + +Package {persistentSelection 1.0} +Platform * +Desc {Enhanced PRIMARY selection} +Base @TAP_DIR@/persistentSelection +Path persistentSelection.tcl +Path pkgIndex.tcl + +# +# ############################ + # ################## # Module "plotchart" -# [1] | "plotanim" (0.2) -# [2] | "xyplot" (1.0.1) -# [3] | "Plotchart" (2.0.1) +# [1] | "xyplot" (1.0.1) +# [2] | "plotanim" (0.2) +# [3] | "Plotchart" (2.4.1) # -------+ Package {__plotchart 0.0} Platform * Desc {Plotchart} @@ -584,31 +624,55 @@ Path plotobject.tcl Path plotpack.tcl Path plotpriv.tcl Path plotscada.tcl Path plotspecial.tcl +Path plotstatustimeline.tcl Path plottable.tcl Path scaling.tcl Path xyplot.tcl -Package {plotanim 0.2} -See __plotchart -Platform * -Desc {Tklib package} - Package {xyplot 1.0.1} See __plotchart Platform * Desc {Tklib package} -Package {Plotchart 2.0.1} +Package {plotanim 0.2} +See __plotchart +Platform * +Desc {Tklib package} + +Package {Plotchart 2.4.1} See __plotchart Platform * Desc {Simple plotting and charting package} # # ################## + +# ################### +# Module "scrollutil" +# [1] | "scrollutil::common" (1.5) +# -------+ + +Package {scrollutil::common 1.5} +Platform * +Desc {Tklib package} +Base @TAP_DIR@/scrollutil +Path pkgIndex.tcl +Path scripts/mwutil.tcl +Path scripts/scrollableframe.tcl +Path scripts/scrollarea.tcl +Path scripts/scrollsync.tcl +Path scripts/tclIndex +Path scripts/wheelEvent.tcl +Path scrollutil.tcl +Path scrollutil_tile.tcl +Path scrollutilCommon.tcl + +# +# ################### # ############## # Module "style" # [1] | "style::lobster" (0.2) # [2] | "style" (0.3) @@ -658,19 +722,20 @@ # # ################# # ################## # Module "tablelist" -# [1] | "tablelist::common" (5.7) +# [1] | "tablelist::common" (6.8) # -------+ -Package {tablelist::common 5.7} +Package {tablelist::common 6.8} Platform * Desc {Tklib package} Base @TAP_DIR@/tablelist Path pkgIndex.tcl Path scripts/mwutil.tcl +Path scripts/pencil.cur Path scripts/repair.tcl Path scripts/tablelistBind.tcl Path scripts/tablelistConfig.tcl Path scripts/tablelistEdit.tcl Path scripts/tablelistImages.tcl @@ -692,11 +757,11 @@ # [1] | "tkpiechart" (6.6) # -------+ Package {tkpiechart 6.6} Platform * -Desc {2D or 3D pie chart object in a canvas} +Desc {tkpiechart canvas label class} Base @TAP_DIR@/tkpiechart Path boxlabel.tcl Path canlabel.tcl Path labarray.tcl Path objselec.tcl @@ -713,16 +778,16 @@ # ################### # ################ # Module "tooltip" # [1] | "tipstack" (1.0.1) -# [2] | "tooltip" (1.4.4) +# [2] | "tooltip" (1.4.6) # -------+ Package {__tooltip 0.0} Platform * -Desc {Tooltip management} +Desc {widget::listsimple widget} Hidden Base @TAP_DIR@/tooltip Path pkgIndex.tcl Path tipstack.tcl Path tooltip.tcl @@ -730,22 +795,22 @@ Package {tipstack 1.0.1} See __tooltip Platform * Desc {Tklib package} -Package {tooltip 1.4.4} +Package {tooltip 1.4.6} See __tooltip Platform * -Desc {Tooltip management} +Desc {widget::listsimple widget} # # ################ # ############ # Module "wcb" -# [1] | "Wcb" (3.4) -# [2] | "wcb" (3.4) +# [1] | "Wcb" (3.6) +# [2] | "wcb" (3.6) # -------+ Package {__wcb 0.0} Platform * Desc {Tklib module} @@ -756,18 +821,19 @@ Path scripts/wcbCommon.tcl Path scripts/wcbEntry.tcl Path scripts/wcbListbox.tcl Path scripts/wcbTablelist.tcl Path scripts/wcbText.tcl +Path scripts/wcbTreeview.tcl Path wcb.tcl -Package {Wcb 3.4} +Package {Wcb 3.6} See __wcb Platform * Desc {Tklib package} -Package {wcb 3.4} +Package {wcb 3.6} See __wcb Platform * Desc {Tklib package} # @@ -775,22 +841,22 @@ # ############### # Module "widget" # [1] | "widget::statusbar" (1.2.1) # [2] | "widget::superframe" (1.0.1) -# [3] | "widget::calendar" (1) -# [4] | "widget::ruler" (1.1) -# [5] | "widget::screenruler" (1.2) +# [3] | "widget::ruler" (1.1) +# [4] | "widget::screenruler" (1.2) +# [5] | "widget::calendar" (1.0.1) # [6] | "widget" (3.1) # [7] | "widget::scrolledtext" (1.0) -# [8] | "widget::dateentry" (0.95) +# [8] | "widget::dateentry" (0.96) # [9] | "widget::dialog" (1.3.1) # [10] | "widget::scrolledwindow" (1.2.1) -# [11] | "widget::panelframe" (1.1) -# [12] | "widget::toolbar" (1.2.1) -# [13] | "widget::menuentry" (1.0.1) -# [14] | "widget::arrowbutton" (1) +# [11] | "widget::toolbar" (1.2.1) +# [12] | "widget::panelframe" (1.1) +# [13] | "widget::arrowbutton" (1) +# [14] | "widget::menuentry" (1.0.1) # -------+ Package {__widget 0.0} Platform * Desc {widget::listsimple widget, Various megawidgets} @@ -819,15 +885,10 @@ Package {widget::superframe 1.0.1} See __widget Platform * Desc {Tklib package} -Package {widget::calendar 1} -See __widget -Platform * -Desc {Calendar Megawidget} - Package {widget::ruler 1.1} See __widget Platform * Desc {Tklib package} @@ -834,21 +895,26 @@ Package {widget::screenruler 1.2} See __widget Platform * Desc {Tklib package} +Package {widget::calendar 1.0.1} +See __widget +Platform * +Desc {Calendar Megawidget} + Package {widget 3.1} See __widget Platform * -Desc {Date Entry Megawidget} +Desc {Toolbar Megawidget} Package {widget::scrolledtext 1.0} See __widget Platform * Desc {Tklib package} -Package {widget::dateentry 0.95} +Package {widget::dateentry 0.96} See __widget Platform * Desc {Date Entry Megawidget} Package {widget::dialog 1.3.1} @@ -859,69 +925,84 @@ Package {widget::scrolledwindow 1.2.1} See __widget Platform * Desc {widget::listsimple widget} -Package {widget::panelframe 1.1} -See __widget -Platform * -Desc {Tklib package} - Package {widget::toolbar 1.2.1} See __widget Platform * Desc {Toolbar Megawidget} -Package {widget::menuentry 1.0.1} +Package {widget::panelframe 1.1} See __widget Platform * Desc {Tklib package} Package {widget::arrowbutton 1} See __widget +Platform * +Desc {Tklib package} + +Package {widget::menuentry 1.0.1} +See __widget Platform * Desc {Tklib package} # # ############### # ################ # Module "widgetl" -# [1] | "widget::listsimple" (0.1.1) -# [2] | "widget::listentry" (0.1.1) +# [1] | "widget::listentry" (0.1.2) +# [2] | "widget::listsimple" (0.1.2) # -------+ Package {__widgetl 0.0} Platform * -Desc {widget::listentry widget, widget::listsimple widget} +Desc {widget::listsimple widget, widget::listentry widget} Hidden Base @TAP_DIR@/widgetl Path listentry.tcl Path listsimple.tcl Path pkgIndex.tcl -Package {widget::listsimple 0.1.1} -See __widgetl -Platform * -Desc {widget::listsimple widget} - -Package {widget::listentry 0.1.1} +Package {widget::listentry 0.1.2} See __widgetl Platform * Desc {widget::listentry widget} +Package {widget::listsimple 0.1.2} +See __widgetl +Platform * +Desc {widget::listsimple widget} + # # ################ + +# ################### +# Module "widgetPlus" +# [1] | "widgetPlus" (1.0b2) +# -------+ + +Package {widgetPlus 1.0} +Platform * +Desc {Enhanced Entry, Spinbox, and Combobox Widgets with Undo/Redo and other useful features} +Base @TAP_DIR@/widgetPlus +Path pkgIndex.tcl +Path widgetPlus.tcl + +# +# ################### # ################ # Module "widgetv" # [1] | "widget::validator" (0.1) # -------+ Package {widget::validator 0.1} Platform * -Desc {widget::listsimple widget} +Desc {widget::validator behaviour} Base @TAP_DIR@/widgetv Path pkgIndex.tcl Path validator.tcl # Index: tklib.yml ================================================================== --- tklib.yml +++ tklib.yml @@ -1,7 +1,7 @@ dist_id: tklib -version: 0.6 +version: 0.7 language: tcl description: | This package is intended to be a collection of Tcl packages that provide utility functions useful to a large collection of Tk programmers. @@ -13,6 +13,6 @@ categories: - Library/Utility - Library/GUI license: BSD owner_id: AndreasKupries -wrapped_content: tklib-0.6/ +wrapped_content: tklib-0.7/