dump

$canvaseditor dump
returns code to restore screen content

obj method canvaseditor dump {} {
  set canvas [my canvas]
  lappend objects
  foreach obj [$self stackSequence] {
    set top [$obj topgroup]
    if {$top ni $objects} then {
      lappend objects $top
    }
  }
  foreach obj $objects {
    lappend cmdLines [$obj restoreCode]
  }
  lappend cmdLines "$self select"
  lappend cmdLines "$self canvas delete all"
  foreach obj $objects {
    lappend cmdLines [list $obj draw]
  }
  foreach tag [$self stackSequence yes] {
    lappend cmdLines "$self canvas raise $tag"
    if {[$self canvas itemcget $tag -state] eq "disabled"} then {
      lappend cmdLines "$self canvas itemconfigure $tag -state disabled"
    }
  }
  lappend cmdLines "$self select [my selection]"
  join $cmdLines \n
}

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