NAME
itclvars - variables used by [incr Tcl]
DESCRIPTION
The following global variables are created and managed automatically by the [[iinnccrr TTccll]] library. Except where noted below, these variablesshould normally be treated as read-only by application-specific code
and by users. iittccll::::lliibbrraarryy When an interpreter is created, [[iinnccrr TTccll]] initializes this variable to hold the name of a directory containing the system library of [[iinnccrr TTccll]] scripts. The initial value of iittccll::::lliibbrraarryy is set from the ITCLLIBRARY environment variableif it exists, or from a compiled-in value otherwise.
iittccll::::ppaattcchhLLeevveell When an interpreter is created, [[iinnccrr TTccll]] initializes this variable to hold the current patch level for [[iinnccrr TTccll]]. For example, the value "22..00pp11" indicates [[iinnccrr TTccll]] version 2.0 with the first set of patches applied. iittccll::::ppuurriisstt When an interpreter is created containing Tcl/Tk and the[[iinnccrr TTccll]] namespace facility, this variable controls a "back-
ward-compatibility" mode for widget access.
In vanilla Tcl/Tk, there is a single pool of commands, so the access command for a widget is the same as the window name. When a widget is created within a namespace, however, its access command is installed in that namespace, and should be accessed outside of the namespace using a qualified name. For example, namespace foo { namespace bar {button .b -text "Testing"
} } foo::bar::.b configure -background red pack .b Note that
the window name ".b" is still used in conjunction with commandslike ppaacckk and ddeessttrrooyy. However, the access command for the wid-
get (i.e., name that appears as the first argument on a command line) must be more specific.The "wwiinnffoo ccoommmmaanndd" command can be used to query the fully-qual-
ified access command for any widget, so one can write: [winfocommand .b] configure -background red and this is good practice
when writing library procedures. Also, in conjunction with thebbiinndd command, the "%q" field can be used in place of "%W" as the
access command: bind Button
{%q flash; %q invoke} While this behavior makes sense from the standpoint of encapsu-
lation, it causes problems with existing Tcl/Tk applications. Many existing applications are written with bindings that use"%W". Many library procedures assume that the window name is
the access command.The iittccll::::ppuurriisstt variable controls a backward-compatibility
mode. By default, this variable is "0", and the window name can be used as an access command in any context. Whenever the uunnkknnoowwnn procedure stumbles across a widget name, it simply uses "wwiinnffoo ccoommmmaanndd" to determine the appropriate command name. Ifthis variable is set to "1", this backward-compatibility mode is
disabled. This gives better encapsulation, but using the window name as the access command may lead to "invalid command" errors. iittccll::::vveerrssiioonn When an interpreter is created, [[iinnccrr TTccll]] initializes this variable to hold the version number of the form x.y. Changes to x represent major changes with probable incompatibilities and changes to y represent small enhancements and bug fixes that retain backward compatibility. KKEEYYWWOORRDDSS itcl, variablesitcl 3.0 itclvars(n)