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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [itcl/] [itcl/] [doc/] [itclvars.n] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\"
2
'\" Copyright (c) 1993-1998  Lucent Technologies, Inc.
3
'\"
4
'\" See the file "license.terms" for information on usage and redistribution
5
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6
'\"
7
'\" RCS: $Id: itclvars.n,v 1.1.1.1 2002-01-16 10:24:46 markom Exp $
8
'\"
9
.so man.macros
10
.TH itclvars n 3.0 itcl "[incr\ Tcl]"
11
.BS
12
'\" Note:  do not modify the .SH NAME line immediately below!
13
.SH NAME
14
itclvars \- variables used by [incr\ Tcl]
15
.BE
16
 
17
.SH DESCRIPTION
18
.PP
19
The following global variables are created and managed automatically
20
by the \fB[incr\ Tcl]\fR library.  Except where noted below, these
21
variables should normally be treated as read-only by application-specific
22
code and by users.
23
.TP
24
\fBitcl::library\fR
25
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this variable
26
to hold the name of a directory containing the system library of
27
\fB[incr\ Tcl]\fR scripts.  The initial value of \fBitcl::library\fR
28
is set from the ITCL_LIBRARY environment variable if it exists,
29
or from a compiled-in value otherwise.
30
.TP
31
\fBitcl::patchLevel\fR
32
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this
33
variable to hold the current patch level for \fB[incr\ Tcl]\fR.
34
For example, the value "\fB2.0p1\fR" indicates \fB[incr\ Tcl]\fR
35
version 2.0 with the first set of patches applied.
36
.TP
37
\fBitcl::purist\fR
38
When an interpreter is created containing Tcl/Tk and the
39
\fB[incr\ Tcl]\fR namespace facility, this variable controls
40
a "backward-compatibility" mode for widget access.
41
.sp
42
In vanilla Tcl/Tk, there is a single pool of commands, so the
43
access command for a widget is the same as the window name.
44
When a widget is created within a namespace, however, its access
45
command is installed in that namespace, and should be accessed
46
outside of the namespace using a qualified name.  For example,
47
.CS
48
namespace foo {
49
    namespace bar {
50
        button .b -text "Testing"
51
    }
52
}
53
foo::bar::.b configure -background red
54
pack .b
55
.CE
56
Note that the window name "\fC.b\fR" is still used in conjunction
57
with commands like \fBpack\fR and \fBdestroy\fR.  However, the
58
access command for the widget (i.e., name that appears as the
59
\fIfirst\fR argument on a command line) must be more specific.
60
.sp
61
The "\fBwinfo command\fR" command can be used to query the
62
fully-qualified access command for any widget, so one can write:
63
.CS
64
[winfo command .b] configure -background red
65
.CE
66
and this is good practice when writing library procedures.  Also,
67
in conjunction with the \fBbind\fR command, the "%q" field can be
68
used in place of "%W" as the access command:
69
.CS
70
bind Button  {%q flash; %q invoke}
71
.CE
72
While this behavior makes sense from the standpoint of encapsulation,
73
it causes problems with existing Tcl/Tk applications.  Many existing
74
applications are written with bindings that use "%W".  Many
75
library procedures assume that the window name is the access
76
command.
77
.sp
78
The \fBitcl::purist\fR variable controls a backward-compatibility
79
mode.  By default, this variable is "0", and the window name
80
can be used as an access command in any context.  Whenever the
81
\fBunknown\fR procedure stumbles across a widget name, it simply
82
uses "\fBwinfo command\fR" to determine the appropriate command
83
name.  If this variable is set to "1", this backward-compatibility
84
mode is disabled.  This gives better encapsulation, but using the
85
window name as the access command may lead to "invalid command"
86
errors.
87
.TP
88
\fBitcl::version\fR
89
When an interpreter is created, \fB[incr\ Tcl]\fR initializes this
90
variable to hold the version number of the form \fIx.y\fR.
91
Changes to \fIx\fR represent major changes with probable
92
incompatibilities and changes to \fIy\fR represent small enhancements
93
and bug fixes that retain backward compatibility.
94
 
95
.SH KEYWORDS
96
itcl, variables

powered by: WebSVN 2.1.0

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