draw

$line draw
draws on canvas
$line draw no
undraws on canvas
$line draw yes -outline color
draws on canvas with additional item tags (debugging purposes)
$line drawn?
determines of already drawn

obj method line draw {{option yes} {withAtts yes}} {
  set tag line$self
  set coords [$self xy]
  if {[string is false -strict $option]} then {
    $self canvas delete $tag
  } elseif {$option eq "coords"} then {
    $self canvas coords $tag $coords
    set group [my group]
    if {$group ne "" && [$group isa fill]} then {
      $group draw fillcoords
    }
  } elseif {[$self drawn?]} then {
    $self canvas coords $tag $coords
  } else {
    $self canvas create line $coords\
      -tags "$tag line"
  }
  $self updateAtts
  $self canvas find withtag $tag
}

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