elements

$canvaseditor elements method …
applies method to all elements on canvas

obj method canvaseditor elements args {
  if {[lindex $args 0] eq "-all"} {
    set inactive no
    set args [lrange $args 1 end]
  } else {
    set inactive yes
  }
  set result {}
  foreach item [$self canvas find all] {
    if {$inactive &&\
        [$self canvas itemcget $item -state] eq "disabled"} continue
    foreach tag [$self canvas gettags $item] {
      if {[regexp (?:fill|line)(:.*) $tag - obj]} then {
        lappend result [$obj topgroup]
      }
    }
  }
  lmap obj [lunique $result] {$obj {*}$args}
}

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