Class Group

Class group is intended to collect lines, fills and other groups.

Common data: instances, canvas

Attributes -width, -fill, -outline, -constraint

Private data: centerDot, group, elements


obj class group -common {
  instances {}
  canvas .c
} -configure {
  -width ""
  -fill ""
  -outline ""
  -constraint ""
}
obj constructor group args {
  my centerDot [new dot]
  my group ""
  my elements {}
  foreach element $args {
    $self add $element
  }
  our instances [list {*}[our instances] $self]
  $self calcCenter
}
obj destructor group {
  foreach element [my elements] {
    $self release $element
  }
  set index [lsearch [our instances] $self]
  our instances [lreplace [our instances] $index $index]
}

© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z