Tk Source Code

Artifact [f7d4f105]
Login

Artifact f7d4f105b8b19aa974d389c72e14f8cd007352bd0b181d38100a4384a4d73610:

Attachment "ScriptUsedForFixChecking.tcl" to ticket [3406785f] added by fvogel 2017-09-09 14:02:42.
package require Tk

canvas .c1 -bg white -width 450 -height 400 -scrollregion {-50 -200 400 200}
.c1 create text 0 0 -text "(0,0)"
grid .c1

set x1 20
set x2 22
set y2 105
for {set f 0} {$f<50} {incr f} {
    set y1 [expr {$y2-0.05*$f}]
    .c1 create rectangle $x1 $y1 $x2 $y2 -fill black -outline black
    incr x1 2
    incr x2 2
}

set x1 20
set x2 22
set y2 -105
for {set f 0} {$f<50} {incr f} {
    set y1 [expr {$y2-0.05*$f}]
    .c1 create rectangle $x1 $y1 $x2 $y2 -fill blue -outline blue
    incr x1 2
    incr x2 2
}

set x1 220
set x2 222
set y2 105
for {set f 0} {$f<50} {incr f} {
    set y1 [expr {$y2+0.05*$f}]
    .c1 create rectangle $x1 $y1 $x2 $y2 -fill red -outline red
    incr x1 2
    incr x2 2
}

set x1 220
set x2 222
set y2 -105
for {set f 0} {$f<50} {incr f} {
    set y1 [expr {$y2+0.05*$f}]
    .c1 create rectangle $x1 $y1 $x2 $y2 -fill green -outline green
    incr x1 2
    incr x2 2
}


canvas .c2 -bg white -width 400 -height 450 -scrollregion {-200 -50 200 400}
.c2 create text 0 0 -text "(0,0)"
grid .c2

set y1 20
set y2 22
set x2 105
for {set f 0} {$f<50} {incr f} {
    set x1 [expr {$x2-0.05*$f}]
    .c2 create rectangle $x1 $y1 $x2 $y2 -fill black -outline black
    incr y1 2
    incr y2 2
}

set y1 20
set y2 22
set x2 -105
for {set f 0} {$f<50} {incr f} {
    set x1 [expr {$x2-0.05*$f}]
    .c2 create rectangle $x1 $y1 $x2 $y2 -fill blue -outline blue
    incr y1 2
    incr y2 2
}

set y1 220
set y2 222
set x2 105
for {set f 0} {$f<50} {incr f} {
    set x1 [expr {$x2+0.05*$f}]
    .c2 create rectangle $x1 $y1 $x2 $y2 -fill red -outline red
    incr y1 2
    incr y2 2
}

set y1 220
set y2 222
set x2 -105
for {set f 0} {$f<50} {incr f} {
    set x1 [expr {$x2+0.05*$f}]
    .c2 create rectangle $x1 $y1 $x2 $y2 -fill green -outline green
    incr y1 2
    incr y2 2
}