📄 scopedobject.n
字号:
'\"'\" Copyright (c) 1997 DSC Technologies Corporation'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\"'\" @(#) scopedobject.n 1.21 97/1/30 16:04:44'/" .so man.macros.HS scopedobject iwid.BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEscopedobject \- Create and manipulate a scoped \[incr Tcl\] class object..SH SYNOPSIS\fBscopedobject\fI \fIobjName \fR?\fIoptions\fR?.SH "INHERITANCE"None.SH "STANDARD OPTIONS".LP.nfName: \fBenterscopecommand:\fRCommand-Line Switch: \fB-enterscopecommand\fR.fi.IPSpecifies a Tcl command to invoke when an object enters scope(i.e. when it is created..). The default is {}..LP.nfName: \fBenterscopecommand:\fRCommand-Line Switch: \fB-enterscopecommand\fR.fi.IPSpecifies a Tcl command to invoke when an object exits scope(i.e. when it is deleted..). The default is {}..LP.BE.SH DESCRIPTION.PPThe \fBscopedobject\fR command creates a base class for definingItcl classes which posses scoped behavior like Tcl variables.The objects are only accessible within the procedure in whichthey are instantiated and are deleted when the procedure returns.This class was designed to be a general purpose base class forsupporting scoped incr Tcl classes. The options include theexecute a Tcl script command when an object enters and exits itsscope..SH "METHODS".PPThe \fBscopedobject\fR command creates a new Tcl command whosename is \fIpathName\fR. Thiscommand may be used to invoke various operations on the object.It has the following general form:.DS C\fIpathName option \fR?\fIarg arg ...\fR?.DE\fIOption\fR and the \fIarg\fRsdetermine the exact behavior of the command. The followingcommands are possible for scopedobject objects:.SH "OBJECT-SPECIFIC METHODS".TP\fIpathName \fBcget\fR \fIoption\fRReturns the current value of the configuration option givenby \fIoption\fR.\fIOption\fR may have any of the values accepted by the \fBscopedobject\fRcommand..TP\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?Query or modify the configuration options of the object.If no \fIoption\fR is specified, returns a list describing all ofthe available options for \fIpathName\fR. If \fIoption\fR is specifiedwith no \fIvalue\fR, then the command returns a list describing theone named option (this list will be identical to the correspondingsublist of the value returned if no \fIoption\fR is specified). Ifone or more \fIoption\-value\fR pairs are specified, then the commandmodifies the given objects option(s) to have the given value(s); inthis case the command returns an empty string.\fIOption\fR may have any of the values accepted by the \fBscopedobject\fRcommand..SH EXAMPLE.IPThe scopedobject was primarily meant to be a base class. Thefollowing is an example of usage without inheritance:.LP.DS proc scopedobject_demo {} { scopedobject #auto \ -exitscopecommand {puts "enter scopedobject_demo"} \ -exitscopecommand {puts "exit scopedobject_demo"} } scopedobject_demo.DE.SH AUTHORJohn A. Tucker.SH KEYWORDSscopedobject, object
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -