File: scopedobject.n.html

package info (click to toggle)
itcl3.0 3.0.1-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,128 kB
  • ctags: 3,519
  • sloc: tcl: 32,416; ansic: 12,683; sh: 3,917; makefile: 692; awk: 273; perl: 265
file content (147 lines) | stat: -rw-r--r-- 4,559 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!-- manual page source format generated by RosettaMan v2.5a6, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>man page(1) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="#toc">Table of Contents</A><P>
_________________________________________________________________
<P>

<H2><A NAME="sect1" HREF="#toc1"><B>NAME</B></A></H2>

scopedobject - Create and manipulate a scoped [incr Tcl]
class object.
<P>

<H2><A NAME="sect2" HREF="#toc2"><B>SYNOPSIS</B></A></H2>

<B>scopedobject</B> <I>objName</I> ?<I>options</I>?
<P>

<H2><A NAME="sect3" HREF="#toc3"><B>INHERITANCE</B></A></H2>

None
<P>

<H2><A NAME="sect4" HREF="#toc4"><B>STANDARD</B> <B>OPTIONS</B></A></H2>

<DL>
<DT>Name: <DD>    <B>enterscopecommand:</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD>    <B>-enterscopecommand</B>
<P>
</DD>
</DL>
Specifies a Tcl command to invoke when an object enters
scope (i.e. when it is created..). The default is {}.
<P>
<DL>
<DT>Name: <DD>    <B>enterscopecommand:</B>
</DD>
</DL>
<DL>
<DT>Command-Line Switch: <DD>    <B>-enterscopecommand</B>
<P>
</DD>
</DL>
Specifies a Tcl command to invoke when an object exits
scope (i.e. when it is deleted..). The default is {}.
<P>
_________________________________________________________________
<P>

<H2><A NAME="sect5" HREF="#toc5"><B>DESCRIPTION</B></A></H2>

The <B>scopedobject</B> command creates a base class for defining
Itcl classes which posses scoped behavior like Tcl variables.
The objects are only accessible within the procedure
in which they are instantiated and are deleted when the procedure
returns. This class was designed to be a general
purpose base class for supporting scoped incr Tcl classes.
The options include the execute a Tcl script command when an
object enters and exits its scope.
<P>

<H2><A NAME="sect6" HREF="#toc6"><B>METHODS</B></A></H2>

The <B>scopedobject</B> command creates a new Tcl command whose
name is <I>pathName</I>. This command may be used to invoke various
operations on the object. It has the following general
form:
<P>
<I>pathName</I> <I>option</I> ?<I>arg</I> <I>arg</I> ...?
<P>
<I>Option</I> and the <I>arg</I>s determine the exact behavior of the command.
The following commands are possible for scopedobject
objects:
<P>

<H2><A NAME="sect7" HREF="#toc7"><B>OBJECT-SPECIFIC</B> <B>METHODS</B></A></H2>

<I>pathName</I> <B>cget</B> <I>option</I>
<P>
Returns the current value of the configuration option
given by <I>option</I>. <I>Option</I> may have any of the values
accepted by the <B>scopedobject</B> command.
<P>
<I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
Query or modify the configuration options of the
object. If no <I>option</I> is specified, returns a list
describing all of the available options for <I>pathName</I>.
If <I>option</I> is specified with no <I>value</I>, 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 <I>option</I> is specified). If one
or more <I>option</I>-<I>value</I> pairs are specified, then the command
modifies the given objects option(s) to have the
given value(s); in this case the command returns an
empty string. <I>Option</I> may have any of the values
accepted by the <B>scopedobject</B> command.
<P>

<H2><A NAME="sect8" HREF="#toc8"><B>EXAMPLE</B></A></H2>

The scopedobject was primarily meant to be a base
class. The following is an example of usage without
inheritance:
<P>
proc scopedobject_demo {} {<BR>

<DL>
<DT>scopedobject #auto <DD>        -exitscopecommand {puts &quot;enter scopedobject_demo"}         -exitscopecommand {puts &quot;exit scopedobject_demo"}
}
<P>
</DD>
</DL>
scopedobject_demo
<P>

<H2><A NAME="sect9" HREF="#toc9"><B>AUTHOR</B></A></H2>

John A. Tucker
<P>

<H2><A NAME="sect10" HREF="#toc10"><B>KEYWORDS</B></A></H2>

scopedobject, object
<P>

<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc1" HREF="#sect1">NAME</A></LI>
<LI><A NAME="toc2" HREF="#sect2">SYNOPSIS</A></LI>
<LI><A NAME="toc3" HREF="#sect3">INHERITANCE</A></LI>
<LI><A NAME="toc4" HREF="#sect4">STANDARD OPTIONS</A></LI>
<LI><A NAME="toc5" HREF="#sect5">DESCRIPTION</A></LI>
<LI><A NAME="toc6" HREF="#sect6">METHODS</A></LI>
<LI><A NAME="toc7" HREF="#sect7">OBJECT-SPECIFIC METHODS</A></LI>
<LI><A NAME="toc8" HREF="#sect8">EXAMPLE</A></LI>
<LI><A NAME="toc9" HREF="#sect9">AUTHOR</A></LI>
<LI><A NAME="toc10" HREF="#sect10">KEYWORDS</A></LI>
</UL>
</BODY></HTML>