OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [itcl/] [doc/] [itclvars.n] - Diff between revs 578 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 578 Rev 1765
'\"
'\"
'\" Copyright (c) 1993-1998  Lucent Technologies, Inc.
'\" Copyright (c) 1993-1998  Lucent Technologies, Inc.
'\"
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
'\" RCS: $Id: itclvars.n,v 1.1.1.1 2002-01-16 10:24:46 markom Exp $
'\" RCS: $Id: itclvars.n,v 1.1.1.1 2002-01-16 10:24:46 markom Exp $
'\"
'\"
.so man.macros
.so man.macros
.TH itclvars n 3.0 itcl "[incr\ Tcl]"
.TH itclvars n 3.0 itcl "[incr\ Tcl]"
.BS
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
.SH NAME
itclvars \- variables used by [incr\ Tcl]
itclvars \- variables used by [incr\ Tcl]
.BE
.BE
.SH DESCRIPTION
.SH DESCRIPTION
.PP
.PP
The following global variables are created and managed automatically
The following global variables are created and managed automatically
by the \fB[incr\ Tcl]\fR library.  Except where noted below, these
by the \fB[incr\ Tcl]\fR library.  Except where noted below, these
variables should normally be treated as read-only by application-specific
variables should normally be treated as read-only by application-specific
code and by users.
code and by users.
.TP
.TP
\fBitcl::library\fR
\fBitcl::library\fR
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this variable
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this variable
to hold the name of a directory containing the system library of
to hold the name of a directory containing the system library of
\fB[incr\ Tcl]\fR scripts.  The initial value of \fBitcl::library\fR
\fB[incr\ Tcl]\fR scripts.  The initial value of \fBitcl::library\fR
is set from the ITCL_LIBRARY environment variable if it exists,
is set from the ITCL_LIBRARY environment variable if it exists,
or from a compiled-in value otherwise.
or from a compiled-in value otherwise.
.TP
.TP
\fBitcl::patchLevel\fR
\fBitcl::patchLevel\fR
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this
variable to hold the current patch level for \fB[incr\ Tcl]\fR.
variable to hold the current patch level for \fB[incr\ Tcl]\fR.
For example, the value "\fB2.0p1\fR" indicates \fB[incr\ Tcl]\fR
For example, the value "\fB2.0p1\fR" indicates \fB[incr\ Tcl]\fR
version 2.0 with the first set of patches applied.
version 2.0 with the first set of patches applied.
.TP
.TP
\fBitcl::purist\fR
\fBitcl::purist\fR
When an interpreter is created containing Tcl/Tk and the
When an interpreter is created containing Tcl/Tk and the
\fB[incr\ Tcl]\fR namespace facility, this variable controls
\fB[incr\ Tcl]\fR namespace facility, this variable controls
a "backward-compatibility" mode for widget access.
a "backward-compatibility" mode for widget access.
.sp
.sp
In vanilla Tcl/Tk, there is a single pool of commands, so the
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.
access command for a widget is the same as the window name.
When a widget is created within a namespace, however, its access
When a widget is created within a namespace, however, its access
command is installed in that namespace, and should be accessed
command is installed in that namespace, and should be accessed
outside of the namespace using a qualified name.  For example,
outside of the namespace using a qualified name.  For example,
.CS
.CS
namespace foo {
namespace foo {
    namespace bar {
    namespace bar {
        button .b -text "Testing"
        button .b -text "Testing"
    }
    }
}
}
foo::bar::.b configure -background red
foo::bar::.b configure -background red
pack .b
pack .b
.CE
.CE
Note that the window name "\fC.b\fR" is still used in conjunction
Note that the window name "\fC.b\fR" is still used in conjunction
with commands like \fBpack\fR and \fBdestroy\fR.  However, the
with commands like \fBpack\fR and \fBdestroy\fR.  However, the
access command for the widget (i.e., name that appears as the
access command for the widget (i.e., name that appears as the
\fIfirst\fR argument on a command line) must be more specific.
\fIfirst\fR argument on a command line) must be more specific.
.sp
.sp
The "\fBwinfo command\fR" command can be used to query the
The "\fBwinfo command\fR" command can be used to query the
fully-qualified access command for any widget, so one can write:
fully-qualified access command for any widget, so one can write:
.CS
.CS
[winfo command .b] configure -background red
[winfo command .b] configure -background red
.CE
.CE
and this is good practice when writing library procedures.  Also,
and this is good practice when writing library procedures.  Also,
in conjunction with the \fBbind\fR command, the "%q" field can be
in conjunction with the \fBbind\fR command, the "%q" field can be
used in place of "%W" as the access command:
used in place of "%W" as the access command:
.CS
.CS
bind Button  {%q flash; %q invoke}
bind Button  {%q flash; %q invoke}
.CE
.CE
While this behavior makes sense from the standpoint of encapsulation,
While this behavior makes sense from the standpoint of encapsulation,
it causes problems with existing Tcl/Tk applications.  Many existing
it causes problems with existing Tcl/Tk applications.  Many existing
applications are written with bindings that use "%W".  Many
applications are written with bindings that use "%W".  Many
library procedures assume that the window name is the access
library procedures assume that the window name is the access
command.
command.
.sp
.sp
The \fBitcl::purist\fR variable controls a backward-compatibility
The \fBitcl::purist\fR variable controls a backward-compatibility
mode.  By default, this variable is "0", and the window name
mode.  By default, this variable is "0", and the window name
can be used as an access command in any context.  Whenever the
can be used as an access command in any context.  Whenever the
\fBunknown\fR procedure stumbles across a widget name, it simply
\fBunknown\fR procedure stumbles across a widget name, it simply
uses "\fBwinfo command\fR" to determine the appropriate command
uses "\fBwinfo command\fR" to determine the appropriate command
name.  If this variable is set to "1", this backward-compatibility
name.  If this variable is set to "1", this backward-compatibility
mode is disabled.  This gives better encapsulation, but using the
mode is disabled.  This gives better encapsulation, but using the
window name as the access command may lead to "invalid command"
window name as the access command may lead to "invalid command"
errors.
errors.
.TP
.TP
\fBitcl::version\fR
\fBitcl::version\fR
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this
variable to hold the version number of the form \fIx.y\fR.
variable to hold the version number of the form \fIx.y\fR.
Changes to \fIx\fR represent major changes with probable
Changes to \fIx\fR represent major changes with probable
incompatibilities and changes to \fIy\fR represent small enhancements
incompatibilities and changes to \fIy\fR represent small enhancements
and bug fixes that retain backward compatibility.
and bug fixes that retain backward compatibility.
.SH KEYWORDS
.SH KEYWORDS
itcl, variables
itcl, variables
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.