1 |
578 |
markom |
#
|
2 |
|
|
# itk::Archetype
|
3 |
|
|
# ----------------------------------------------------------------------
|
4 |
|
|
# Base class for all widgets in the [incr Tk] Toolkit. Provides
|
5 |
|
|
# facilities to merge widget options into a composite list of options
|
6 |
|
|
# for the overall widget. Derived classes add widgets and methods to
|
7 |
|
|
# specialize behavior.
|
8 |
|
|
#
|
9 |
|
|
# METHODS:
|
10 |
|
|
# configure
|
11 |
|
|
# configure -option
|
12 |
|
|
# configure -option value ?-option value?...
|
13 |
|
|
# Used to set/query configuration options
|
14 |
|
|
#
|
15 |
|
|
# component
|
16 |
|
|
# component ? ...?
|
17 |
|
|
# Invokes the given as a method on the component
|
18 |
|
|
# called .
|
19 |
|
|
#
|
20 |
|
|
# itk_component add
|
21 |
|
|
# Creates a component widget and merges its options into
|
22 |
|
|
# the composite option list for the overall widget
|
23 |
|
|
#
|
24 |
|
|
# itk_component delete ?...?
|
25 |
|
|
# Destroys a component widget and removes its options from
|
26 |
|
|
# the composite option list
|
27 |
|
|
#
|
28 |
|
|
# itk_option add ?...?
|
29 |
|
|
# Adds the option belonging to a class or component
|
30 |
|
|
# widget into the option list. Options can be added even
|
31 |
|
|
# if they were not originally kept when the component was
|
32 |
|
|
# created.
|
33 |
|
|
#
|
34 |
|
|
# itk_option remove ?...?
|
35 |
|
|
# Removes the option belonging to a class or component
|
36 |
|
|
# widget from the option list. This allows a derived class
|
37 |
|
|
# to turn off or redefine undesirable options inherited from
|
38 |
|
|
# a base class.
|
39 |
|
|
#
|
40 |
|
|
# WIDGET ATTRIBUTES:
|
41 |
|
|
# none
|
42 |
|
|
#
|
43 |
|
|
# ----------------------------------------------------------------------
|
44 |
|
|
# AUTHOR: Michael J. McLennan
|
45 |
|
|
# Bell Labs Innovations for Lucent Technologies
|
46 |
|
|
# mmclennan@lucent.com
|
47 |
|
|
# http://www.tcltk.com/itcl
|
48 |
|
|
#
|
49 |
|
|
# RCS: $Id: Archetype.itk,v 1.1.1.1 2002-01-16 10:24:47 markom Exp $
|
50 |
|
|
# ----------------------------------------------------------------------
|
51 |
|
|
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
52 |
|
|
# ======================================================================
|
53 |
|
|
# See the file "license.terms" for information on usage and
|
54 |
|
|
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
55 |
|
|
|
56 |
|
|
itcl::class itk::Archetype {
|
57 |
|
|
|
58 |
|
|
constructor {args} {
|
59 |
|
|
_initOptionInfo
|
60 |
|
|
eval itk_initialize $args
|
61 |
|
|
}
|
62 |
|
|
|
63 |
|
|
destructor {
|
64 |
|
|
_deleteOptionInfo
|
65 |
|
|
}
|
66 |
|
|
|
67 |
|
|
method cget {option} @Archetype-cget
|
68 |
|
|
method configure {{option ""} args} \
|
69 |
|
|
@Archetype-configure
|
70 |
|
|
method config {{option ""} args} {
|
71 |
|
|
eval configure $option $args
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
method component {{name ""} args} \
|
75 |
|
|
@Archetype-component
|
76 |
|
|
|
77 |
|
|
protected method itk_component {option args} \
|
78 |
|
|
@Archetype-itk_component
|
79 |
|
|
|
80 |
|
|
protected method itk_option {option args} \
|
81 |
|
|
@Archetype-itk_option
|
82 |
|
|
|
83 |
|
|
protected method itk_initialize {args} \
|
84 |
|
|
@Archetype-itk_initialize
|
85 |
|
|
|
86 |
|
|
protected variable itk_option
|
87 |
|
|
protected variable itk_component
|
88 |
|
|
protected variable itk_interior ""
|
89 |
|
|
|
90 |
|
|
# ------------------------------------------------------------------
|
91 |
|
|
# Options common to all widgets
|
92 |
|
|
# ------------------------------------------------------------------
|
93 |
|
|
itk_option define -clientdata clientData ClientData ""
|
94 |
|
|
|
95 |
|
|
# ------------------------------------------------------------------
|
96 |
|
|
# Private methods needed for option management
|
97 |
|
|
# ------------------------------------------------------------------
|
98 |
|
|
private method _initOptionInfo {} @Archetype-init
|
99 |
|
|
private method _deleteOptionInfo {} @Archetype-delete
|
100 |
|
|
}
|