summaryrefslogtreecommitdiffstats
path: root/tcl8.6/pkgs/itcl4.1.1/doc/itclcomponent.n
blob: be1c8ffb324ce4b1ebe1888815d9b196d800c56c (plain)
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
'\"
'\" Copyright (c) 2008 Arnulf Wiedemann
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH component n 4.0 itcl "[incr\ Tcl]"
.so man.macros
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
itcl::component \- define components for extendedclass, widget or widgetadaptor
.PP
Parts of this description are "borrowed" from Tcl extension [snit], as the functionality is mostly identical.
.SH WARNING!
This is new functionality in [incr Tcl] where the API can still change!!
.SH SYNOPSIS
.nf
\fBpublic component \fIcomp\fR ?\fB-inherit\fR?
\fBprotected component \fIcomp\fR ?\fB-inherit\fR?
\fBprivate component \fIcomp\fR ?\fB-inherit\fR?
.fi
.BE

.SH DESCRIPTION
.PP
The \fBcomponent\fR command is used inside an \fB[incr\ Tcl]\fR
extendedclass/widget/widgetadaptor definition to define components.
.PP
Explicitly declares a component called comp, and automatically defines
the component's instance variable.
.PP
If the \fI-inherit\fR option is specified then all unknown methods
and options will be delegated to this component. The name -inherit
implies that instances of this new type inherit, in a sense,
the methods and options of the component. That is,
-inherit yes is equivalent to:
.PP
.CS
component mycomp
delegate option * to mycomp
delegate method * to mycomp
.CE

.SH KEYWORDS
component, widget, widgetadaptor, extendedclass