Interactive Tablelist Cell Editing Using the Mentry Package
For Tablelist Version 5.13
by
Csaba Nemethi
csaba.nemethi@t-online.deContents
- Overview
- The
tablelist::addDateMentry
Command - The
tablelist::addTimeMentry
Command - The
tablelist::addDateTimeMentry
Command - The
tablelist::addFixedPointMentry
Command - The
tablelist::addIPAddrMentry
Command - The
tablelist::addIPv6AddrMentry
Command
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
http://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:
- Register the desired widget for interactive cell editing by invoking one of the commands described in this reference page.
- 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 thecellconfigure
subcommand.)
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. Theformat
andseparator
arguments have the same meanings as in thementry::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 isdateMentry
. The command returns itsname
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). Thefinishediting
subcommand of the Tcl command associated with the tablelist widget will retrieve the contents of the embedded window used for interactive cell editing by invoking thementry::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 contents by invoking therejectinput
subcommand. - KEYWORDS
- tablelist, editing, Mentry, date
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. Theformat
andseparator
arguments have the same meanings as in thementry::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 istimeMentry
. The command returns itsname
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). Thefinishediting
subcommand of the Tcl command associated with the tablelist widget will retrieve the contents of the embedded window used for interactive cell editing by invoking thementry::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 contents by invoking therejectinput
subcommand. - KEYWORDS
- tablelist, editing, Mentry, time
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. Theformat
,dateSeparator
, andtimeSeparator
arguments have the same meanings as in thementry::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 isdateTimeMentry
. The command returns itsname
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). Thefinishediting
subcommand of the Tcl command associated with the tablelist widget will retrieve the contents of the embedded window used for interactive cell editing by invoking thementry::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 contents by invoking therejectinput
subcommand. - KEYWORDS
- tablelist, editing, Mentry, date, time
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. Thecount1
,count2
, and-comma
arguments have the same meanings as in thementry::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 isfixedPointMentry_count1.count2
(e.g.,fixedPointMentry_6.2
) orfixedPointMentry_count1,count2
(e.g.,fixedPointMentry_6,2
), depending on the presence of the optional-comma
argument. The command returns itsname
argument. - A tablelist column having the above
name
as the value of its-editwindow
option must contain real numbers as internal cell values. Thefinishediting
subcommand of the Tcl command associated with the tablelist widget will retrieve the contents of the embedded window used for interactive cell editing by invoking thementry::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 contents by invoking therejectinput
subcommand. - KEYWORDS
- tablelist, editing, Mentry, real number
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 isipAddrMentry
. The command returns itsname
argument. - A tablelist column having the above
name
as the value of its-editwindow
option must contain IP addresses as internal cell values. Thefinishediting
subcommand of the Tcl command associated with the tablelist widget will retrieve the contents of the embedded window used for interactive cell editing by invoking thementry::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 contents by invoking therejectinput
subcommand. - KEYWORDS
- tablelist, editing, Mentry, IP address
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 isipv6AddrMentry
. The command returns itsname
argument. - A tablelist column having the above
name
as the value of its-editwindow
option must contain IPv6 addresses as internal cell values. Thefinishediting
subcommand of the Tcl command associated with the tablelist widget will retrieve the contents of the embedded window used for interactive cell editing by invoking thementry::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 contents by invoking therejectinput
subcommand. - KEYWORDS
- tablelist, editing, Mentry, IPv6 address