File: Archetype.itk

package info (click to toggle)
itcl3.1 3.1.0-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,604 kB
  • ctags: 1,045
  • sloc: tcl: 33,268; ansic: 14,071; sh: 3,918; makefile: 762; awk: 273; perl: 265
file content (100 lines) | stat: -rw-r--r-- 3,527 bytes parent folder | download | duplicates (13)
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
#
# itk::Archetype
# ----------------------------------------------------------------------
# Base class for all widgets in the [incr Tk] Toolkit.  Provides
# facilities to merge widget options into a composite list of options
# for the overall widget.  Derived classes add widgets and methods to
# specialize behavior.
#
#   METHODS:
#     configure
#     configure -option
#     configure -option value ?-option value?...
#        Used to set/query configuration options
#
#     component
#     component <name> <command> ?<arg> <arg>...?
#        Invokes the given <command> as a method on the component
#        called <name>.
#
#     itk_component add <name> <create-cmd> <option-cmds>
#        Creates a component widget and merges its options into
#        the composite option list for the overall widget
#
#     itk_component delete <name> ?<name>...?
#        Destroys a component widget and removes its options from
#        the composite option list
#
#     itk_option add <name> ?<name>...?
#        Adds the option <name> belonging to a class or component
#        widget into the option list.  Options can be added even
#        if they were not originally kept when the component was
#        created.
#
#     itk_option remove <name> ?<name>...?
#        Removes the option <name> belonging to a class or component
#        widget from the option list.  This allows a derived class
#        to turn off or redefine undesirable options inherited from
#        a base class.
#
#   WIDGET ATTRIBUTES:
#     none
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            mmclennan@lucent.com
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: Archetype.itk,v 1.1 1998/07/27 18:45:26 stanton Exp $
# ----------------------------------------------------------------------
#            Copyright (c) 1993-1998  Lucent Technologies, Inc.
# ======================================================================
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.

itcl::class itk::Archetype {

    constructor {args} {
        _initOptionInfo
        eval itk_initialize $args
    }

    destructor {
        _deleteOptionInfo
    }

    method cget {option} @Archetype-cget
    method configure {{option ""} args} \
        @Archetype-configure
    method config {{option ""} args} {
        eval configure $option $args
    }

    method component {{name ""} args} \
        @Archetype-component

    protected method itk_component {option args} \
        @Archetype-itk_component

    protected method itk_option {option args} \
        @Archetype-itk_option

    protected method itk_initialize {args} \
        @Archetype-itk_initialize

    protected variable itk_option
    protected variable itk_component
    protected variable itk_interior ""

    # ------------------------------------------------------------------
    #  Options common to all widgets
    # ------------------------------------------------------------------
    itk_option define -clientdata clientData ClientData ""

    # ------------------------------------------------------------------
    #  Private methods needed for option management
    # ------------------------------------------------------------------
    private method _initOptionInfo {} @Archetype-init
    private method _deleteOptionInfo {} @Archetype-delete
}