Main

On startup, canvaseditor object is created. First checks if exists a file lib/dump.vectorleaf and, if so, reads it in.

On exit writes contents to file lib/dump.vectorleaf.


cd [file dirname [info script]]

pack [canvas .c -scrollregion "0 0 400 300"] -expand yes -fill both

set e [obj new canvaseditor .c {
    set xml [$self canvasToXML]
    set ch [open .dump.vectorleaf w]
    puts $ch $xml
    close $ch
  }]

if {
  $argv in {{} {{source /home/wolf/bin/Projekte/vectorleaf/vectorleaf.tcl}}}
} then {
  wm protocol . WM_DELETE_WINDOW "
    $e destroy
    update
    destroy .
    "  
  if [file exists .dump.vectorleaf] then {
    apply {
      self {
        set ch [open .dump.vectorleaf r]
        if {[catch {
              $self processXML [read $ch]
            } err]} then {
          tk_messageBox -type ok -title Problem -icon error -message\
            [string cat "Sorry. Problems on Loading .dump.vectorleaf:"\
              \n\n $err \n\n "Start with empty workspace!"]
        }
        close $ch
      }
    } $e 
  } else {
    $e setting width 380 height 267
    $e processXML {<selection>
  <!--
      user: wolf
      time: 2021-05-06 08:16:57
  -->
  <elements>
    <group id="group-3" constraint="">
      <line id="line-55" width="2.0" outline="black" smooth="no" constraint="">
        <dot id="dot-125" x="291.86954756838213" y="235.29100512224835" />
        <dot id="dot-126" x="295.827947997797" y="253.499647097557" />
      </line>
      <line id="line-56" width="2.0" outline="black" smooth="no" constraint="">
        <dot id="dot-127" x="270.42054059038963" y="235.35149894940884" />
        <dot id="dot-128" x="272.5509753729983" y="245.15149894940885" />
      </line>
      <line id="line-57" width="2.0" outline="black" smooth="no" constraint="">
        <dot id="dot-129" x="315.1596710251722" y="232.44779524570515" />
        <dot id="dot-130" x="318.01340156730856" y="245.5749557395323" />
      </line>
      <line id="line-58" width="5.0" outline="#4b8800" smooth="yes" constraint="">
        <dot id="dot-131" x="289.77856528174766" y="156.70952364076686" />
        <dot id="dot-132" x="272.2353554052045" y="208.1292767271866" />
        <dot id="dot-133" x="268.00078750396983" y="230.51199277656934" />
        <dot id="dot-134" x="300.6674541706366" y="220.8329804308903" />
      </line>
      <line id="line-59" width="5.0" outline="#ff0000" smooth="yes" constraint="">
        <dot id="dot-135" x="243.1983183681674" y="215.9934742580508" />
        <dot id="dot-136" x="264.37115787434027" y="249.2650791963224" />
        <dot id="dot-137" x="341.80325663977237" y="243.820634751878" />
        <dot id="dot-138" x="364.18597268915505" y="177.27742487533476" />
      </line>
      <line id="line-60" width="5.0" outline="#ff0000" smooth="yes" constraint="">
        <dot id="dot-139" x="265.5810344175501" y="241.4008816654582" />
        <dot id="dot-140" x="282.836898615081" y="272.34347425805083" />
        <dot id="dot-141" x="345.94405910890816" y="258.38149894940886" />
        <dot id="dot-142" x="364.18597268915505" y="189.37619030743355" />
      </line>
      <line id="line-61" width="2.0" outline="#0000ff" smooth="yes" constraint="">
        <dot id="dot-143" x="265.5810344175501" y="177.27742487533476" />
        <dot id="dot-144" x="275.86498503483404" y="157.3144619123718" />
        <dot id="dot-145" x="298.2477010842168" y="158.52433845558167" />
        <dot id="dot-146" x="309.13658997310563" y="177.27742487533476" />
      </line>
      <group id="group-2" constraint="">
        <fill id="fill-0" fill="#81ffff" constraint="">
          <line id="line-62" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-147" x="235.93905910890817" y="171.2280421592854" />
            <dot id="dot-148" x="269.21066404717976" y="171.2280421592854" />
          </line>
          <line id="line-63" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-148" x="269.21066404717976" y="171.2280421592854" />
            <dot id="dot-149" x="272.2353554052045" y="183.9317458629891" />
          </line>
          <line id="line-64" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-149" x="272.2353554052045" y="183.9317458629891" />
            <dot id="dot-150" x="238.96375046693282" y="183.9317458629891" />
          </line>
          <line id="line-65" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-150" x="238.96375046693282" y="183.9317458629891" />
            <dot id="dot-147" x="235.93905910890817" y="171.2280421592854" />
          </line>
        </fill>
        <fill id="fill-1" fill="#81ffff" constraint="">
          <line id="line-66" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-151" x="304.9020220718711" y="171.2280421592854" />
            <dot id="dot-152" x="338.1736270101427" y="171.2280421592854" />
          </line>
          <line id="line-67" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-152" x="338.1736270101427" y="171.2280421592854" />
            <dot id="dot-153" x="341.1983183681674" y="183.9317458629891" />
          </line>
          <line id="line-68" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-153" x="341.1983183681674" y="183.9317458629891" />
            <dot id="dot-154" x="307.9267134298958" y="183.9317458629891" />
          </line>
          <line id="line-69" width="2.0" outline="#0000ff" smooth="no" constraint="">
            <dot id="dot-154" x="307.9267134298958" y="183.9317458629891" />
            <dot id="dot-151" x="304.9020220718711" y="171.2280421592854" />
          </line>
        </fill>
      </group>
      <line id="line-70" width="2.0" outline="gray75" smooth="yes" constraint="">
        <dot id="dot-155" x="349.0625158990316" y="174.857671788915" />
        <dot id="dot-156" x="371.4452319484143" y="163.3638446284212" />
        <dot id="dot-157" x="374.469923306439" y="187.5613754926187" />
        <dot id="dot-158" x="364.79091096076" y="220.2280421592854" />
      </line>
    </group>
    <group id="group-17" constraint="">
      <group id="group-16" constraint="">
        <line id="line-12" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-22" x="220.87722230100883" y="10.0" />
          <dot id="dot-23" x="220.87722230100883" y="29.081949164512878" />
        </line>
        <line id="line-13" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-24" x="214.1551720271463" y="17.589411599522165" />
          <dot id="dot-25" x="220.87722230100883" y="10.0" />
        </line>
        <line id="line-14" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-26" x="214.1551720271463" y="29.081949164512878" />
          <dot id="dot-27" x="227.5992725748713" y="29.081949164512878" />
        </line>
      </group>
      <group id="group-15" constraint="">
        <line id="line-15" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-28" x="202.12053363361832" y="10.0" />
          <dot id="dot-29" x="198.46792492933594" y="10.0" />
          <dot id="dot-30" x="195.50690352546326" y="14.271637435094952" />
          <dot id="dot-31" x="195.50690352546326" y="19.54097458225644" />
        </line>
        <line id="line-16" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-31" x="195.50690352546326" y="19.54097458225644" />
          <dot id="dot-32" x="195.50690352546326" y="24.810311729417926" />
          <dot id="dot-33" x="198.46792492933594" y="29.081949164512878" />
          <dot id="dot-34" x="202.12053363361832" y="29.081949164512878" />
        </line>
        <line id="line-17" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-34" x="202.12053363361832" y="29.081949164512878" />
          <dot id="dot-35" x="205.77314233790065" y="29.081949164512878" />
          <dot id="dot-36" x="208.73416374177333" y="24.810311729417926" />
          <dot id="dot-37" x="208.73416374177333" y="19.54097458225644" />
        </line>
        <line id="line-18" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-37" x="208.73416374177333" y="19.54097458225644" />
          <dot id="dot-38" x="208.73416374177333" y="14.271637435094952" />
          <dot id="dot-39" x="205.77314233790065" y="10.0" />
          <dot id="dot-28" x="202.12053363361832" y="10.0" />
        </line>
      </group>
      <group id="group-14" constraint="">
        <line id="line-19" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-40" x="152.78935823672424" y="29.081949164512878" />
          <dot id="dot-41" x="160.7040303333688" y="10.0" />
        </line>
        <line id="line-20" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-42" x="168.6187024300133" y="29.081949164512878" />
          <dot id="dot-43" x="160.7040303333688" y="10.0" />
        </line>
        <line id="line-21" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-44" x="155.21772339458226" y="23.227260216310064" />
          <dot id="dot-45" x="158.87526127165427" y="23.227260216310064" />
          <dot id="dot-46" x="162.53279914872633" y="23.227260216310064" />
          <dot id="dot-47" x="166.19033702579833" y="23.227260216310064" />
        </line>
      </group>
      <group id="group-13" constraint="">
        <line id="line-22" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-48" x="53.49991392168333" y="10.0" />
          <dot id="dot-49" x="48.277516963818165" y="10.0" />
          <dot id="dot-50" x="44.043932032142294" y="14.233584931675871" />
          <dot id="dot-51" x="44.043932032142294" y="19.455981889541036" />
        </line>
        <line id="line-23" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-51" x="44.043932032142294" y="19.455981889541036" />
          <dot id="dot-52" x="44.043932032142294" y="24.678378847406208" />
          <dot id="dot-53" x="48.277516963818165" y="28.911963779082072" />
          <dot id="dot-54" x="53.49991392168333" y="28.911963779082072" />
        </line>
        <line id="line-24" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-54" x="53.49991392168333" y="28.911963779082072" />
          <dot id="dot-55" x="54.92487578387963" y="28.911963779082072" />
          <dot id="dot-56" x="56.276220248246034" y="28.59677191459501" />
          <dot id="dot-57" x="57.48803229441079" y="28.032303205992605" />
        </line>
        <line id="line-25" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-58" x="57.48803229441079" y="10.87966057308947" />
          <dot id="dot-59" x="56.276220248246034" y="10.315191864487065" />
          <dot id="dot-60" x="54.92487578387963" y="10.0" />
          <dot id="dot-48" x="53.49991392168333" y="10.0" />
        </line>
      </group>
      <group id="group-12" constraint="">
        <line id="line-26" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-61" x="28.64826850168304" y="10.0" />
          <dot id="dot-62" x="28.64826850168304" y="29.081949164512878" />
        </line>
        <line id="line-27" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-63" x="28.64826850168304" y="21.709377896405627" />
          <dot id="dot-64" x="39.49028507242899" y="21.709377896405627" />
        </line>
        <line id="line-28" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-65" x="28.64826850168304" y="29.081949164512878" />
          <dot id="dot-66" x="41.00816739233343" y="29.081949164512878" />
        </line>
        <line id="line-29" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-67" x="28.64826850168304" y="10.0" />
          <dot id="dot-68" x="41.00816739233343" y="10.0" />
        </line>
      </group>
      <group id="group-11" constraint="">
        <line id="line-30" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-69" x="171.4376267384073" y="29.081949164512878" />
          <dot id="dot-70" x="171.4376267384073" y="10.0" />
        </line>
        <line id="line-31" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-71" x="171.4376267384073" y="10.0" />
          <dot id="dot-72" x="183.79752562905765" y="10.0" />
        </line>
        <line id="line-32" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-73" x="171.4376267384073" y="18.239932593766923" />
          <dot id="dot-74" x="182.2796433091532" y="18.239932593766923" />
        </line>
      </group>
      <group id="group-10" constraint="">
        <line id="line-33" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-75" x="121.78119084439078" y="29.081949164512878" />
          <dot id="dot-76" x="133.92424940362628" y="29.081949164512878" />
        </line>
        <line id="line-34" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-77" x="121.78119084439078" y="10.0" />
          <dot id="dot-78" x="121.78119084439078" y="29.081949164512878" />
        </line>
      </group>
      <group id="group-9" constraint="">
        <line id="line-35" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-79" x="89.36356129786039" y="10.0" />
          <dot id="dot-80" x="84.09422415069889" y="10.0" />
          <dot id="dot-81" x="79.82258671560395" y="14.271637435094952" />
          <dot id="dot-82" x="79.82258671560395" y="19.54097458225644" />
        </line>
        <line id="line-36" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-82" x="79.82258671560395" y="19.54097458225644" />
          <dot id="dot-83" x="79.82258671560395" y="24.810311729417926" />
          <dot id="dot-84" x="84.09422415069889" y="29.081949164512878" />
          <dot id="dot-85" x="89.36356129786039" y="29.081949164512878" />
        </line>
        <line id="line-37" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-85" x="89.36356129786039" y="29.081949164512878" />
          <dot id="dot-86" x="94.63289844502187" y="29.081949164512878" />
          <dot id="dot-87" x="98.90453588011682" y="24.810311729417926" />
          <dot id="dot-88" x="98.90453588011682" y="19.54097458225644" />
        </line>
        <line id="line-38" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-88" x="98.90453588011682" y="19.54097458225644" />
          <dot id="dot-89" x="98.90453588011682" y="14.271637435094952" />
          <dot id="dot-90" x="94.63289844502187" y="10.0" />
          <dot id="dot-79" x="89.36356129786039" y="10.0" />
        </line>
      </group>
      <group id="group-8" constraint="">
        <group id="group-7" constraint="">
          <line id="line-39" width="2.0" outline="navy" smooth="no" constraint="">
            <dot id="dot-91" x="104.32554416548979" y="10.0" />
            <dot id="dot-92" x="104.32554416548979" y="29.081949164512878" />
          </line>
          <line id="line-40" width="2.0" outline="navy" smooth="yes" constraint="">
            <dot id="dot-93" x="110.05012891484368" y="21.449169498707718" />
            <dot id="dot-94" x="113.21173120314059" y="21.449169498707718" />
            <dot id="dot-95" x="115.7747136641975" y="18.886187037650785" />
            <dot id="dot-96" x="115.7747136641975" y="15.724584749353859" />
          </line>
          <line id="line-41" width="2.0" outline="navy" smooth="yes" constraint="">
            <dot id="dot-96" x="115.7747136641975" y="15.724584749353859" />
            <dot id="dot-97" x="115.7747136641975" y="12.56298246105698" />
            <dot id="dot-98" x="113.21173120314059" y="10.0" />
            <dot id="dot-99" x="110.05012891484368" y="10.0" />
          </line>
          <line id="line-42" width="2.0" outline="navy" smooth="no" constraint="">
            <dot id="dot-99" x="110.05012891484368" y="10.0" />
            <dot id="dot-91" x="104.32554416548979" y="10.0" />
          </line>
          <line id="line-43" width="2.0" outline="navy" smooth="no" constraint="">
            <dot id="dot-100" x="104.32554416548979" y="21.449169498707718" />
            <dot id="dot-93" x="110.05012891484368" y="21.449169498707718" />
          </line>
        </group>
        <line id="line-44" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-101" x="111.13360992217142" y="21.34677626113605" />
          <dot id="dot-102" x="115.7747136641975" y="29.081949164512878" />
        </line>
        <line id="line-45" width="2.0" outline="navy" smooth="yes" constraint="">
          <dot id="dot-103" x="111.13360980855647" y="21.346776769544384" />
          <dot id="dot-104" x="113.77713415346122" y="20.840364733935843" />
          <dot id="dot-105" x="115.7747136641975" y="18.51575583501642" />
          <dot id="dot-106" x="115.7747136641975" y="15.724584749353859" />
        </line>
      </group>
      <group id="group-6" constraint="">
        <line id="line-46" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-107" x="61.1743182139209" y="10.0" />
          <dot id="dot-108" x="76.13630108155031" y="10.0" />
        </line>
        <line id="line-47" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-109" x="68.6553096477356" y="29.081949164512878" />
          <dot id="dot-110" x="68.6553096477356" y="10.0" />
        </line>
      </group>
      <group id="group-5" constraint="">
        <line id="line-48" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-111" x="10.0" y="10.0" />
          <dot id="dot-112" x="17.372571268107247" y="29.081949164512878" />
        </line>
        <line id="line-49" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-113" x="24.745142536214495" y="10.0" />
          <dot id="dot-114" x="17.372571268107247" y="29.081949164512878" />
        </line>
      </group>
      <group id="group-4" constraint="">
        <line id="line-50" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-115" x="137.39369470626497" y="10.0" />
          <dot id="dot-116" x="137.39369470626497" y="29.081949164512878" />
        </line>
        <line id="line-51" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-117" x="137.39369470626497" y="21.709377896405627" />
          <dot id="dot-118" x="148.23571127701092" y="21.709377896405627" />
        </line>
        <line id="line-52" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-119" x="137.39369470626497" y="29.081949164512878" />
          <dot id="dot-120" x="149.75359359691538" y="29.081949164512878" />
        </line>
        <line id="line-53" width="2.0" outline="navy" smooth="no" constraint="">
          <dot id="dot-121" x="137.39369470626497" y="10.0" />
          <dot id="dot-122" x="149.75359359691538" y="10.0" />
        </line>
      </group>
      <line id="line-54" width="2.0" outline="navy" smooth="no" constraint="">
        <dot id="dot-123" x="210.89371165523426" y="26.815154098595727" />
        <dot id="dot-124" x="210.89371165523426" y="29.081949164512878" />
      </line>
    </group>
  </elements>
  <stack>
    <item ref="line-12" />
    <item ref="line-13" />
    <item ref="line-14" />
    <item ref="line-15" />
    <item ref="line-16" />
    <item ref="line-17" />
    <item ref="line-18" />
    <item ref="line-19" />
    <item ref="line-20" />
    <item ref="line-21" />
    <item ref="line-22" />
    <item ref="line-23" />
    <item ref="line-24" />
    <item ref="line-25" />
    <item ref="line-26" />
    <item ref="line-29" />
    <item ref="line-28" />
    <item ref="line-27" />
    <item ref="line-30" />
    <item ref="line-31" />
    <item ref="line-32" />
    <item ref="line-34" />
    <item ref="line-33" />
    <item ref="line-35" />
    <item ref="line-36" />
    <item ref="line-37" />
    <item ref="line-38" />
    <item ref="line-39" />
    <item ref="line-40" />
    <item ref="line-41" />
    <item ref="line-42" />
    <item ref="line-43" />
    <item ref="line-45" />
    <item ref="line-44" />
    <item ref="line-46" />
    <item ref="line-47" />
    <item ref="line-48" />
    <item ref="line-49" />
    <item ref="line-50" />
    <item ref="line-53" />
    <item ref="line-52" />
    <item ref="line-51" />
    <item ref="line-54" />
    <item ref="line-55" />
    <item ref="line-56" />
    <item ref="line-57" />
    <item ref="line-58" />
    <item ref="line-59" />
    <item ref="line-60" />
    <item ref="line-61" />
    <item ref="fill-0" />
    <item ref="line-62" />
    <item ref="line-63" />
    <item ref="line-64" />
    <item ref="line-65" />
    <item ref="fill-1" />
    <item ref="line-66" />
    <item ref="line-67" />
    <item ref="line-68" />
    <item ref="line-69" />
    <item ref="line-70" />
  </stack>
</selection>}
    update
    $e buildInfoWindow
  }
} else {
  wm geometry . +0+0
  set ch [open {*}$argv r]
  $e processXML [read $ch]
  close $ch
}

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