hide

In certain cases an object is desired to be hidden; in other cases it is desired to be hidden if and only if constraint noprint is set.

$line hide yes
hides line if constraint noprint is set
$line hide yes yes
hides line in any case
$line hide no
unveils line

obj method line hide {{bool yes} {noPrint no}} {
  set tag line$self
  if {$bool} then {
    if {$noPrint} then {
      $self canvas itemconfigure $tag -state hidden
    } else {
      if {[$self constraint noprint]} then {
        $self canvas itemconfigure $tag -state hidden
      } else {
        $self canvas itemconfigure $tag -state normal
      }
    } 
  } else {
    $self canvas itemconfigure $tag -state normal
  }
}

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