All fills and lines consist of dots. So there is OO class dot.
Common variable canvas to show up – not only for debugging but also for casual hilight.
Common variable instances – useful for calculating ID for I/O via XML.
Attribute -x, -y for coordinats on plane.
Private data baseX, baseY for storing original coordinates, and lines for line objects using current dot object.
Variable zoom intende for scaling factor on Canvas widget.
obj class dot -common {
canvas .c
instances {}
} -configure {
-x 0.0
-y 0.0
}
obj constructor dot args {
$self storeXY
# Liste der verwendenden Objekte line
my lines {}
foreach {x y} [concat {*}$args] {
$self configure -x $x -y $y
}
$self storeXY
our instances [concat [our instances] $self]
}
obj destructor dot {
$self show no
set index [lsearch [our instances] $self]
our instances [lreplace [our instances] $index $index]
}
obj inscope dot variable zoom 1.0
© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z