Tk Source Code

Artifact [fd375ece]
Login

Artifact fd375ecedc5a67b98fad9263a07679edd996cedd:

Attachment "test.tcl" to ticket [1055974f] added by nobody 2004-10-28 16:46:49.
# Canvas name (".c") can be changed to anything you like.  It only
# occurs in the following three lines.  The canvas size can be changed
# as well.

canvas .c -width 4.32i -height 3.31i -bg ivory
set xfigCanvas .c

$xfigCanvas config -xscrollincrement 1p -yscrollincrement 1p
# Shift canvas by lower of bounding box
$xfigCanvas xview scroll -3 u
$xfigCanvas yview scroll -5 u
pack $xfigCanvas
# If your fill-pattern bitmaps will be elsewhere,
# change the next line appropriately, and all will
# work well without further modification.

set xbmPath /usr/X11R6/lib/X11/xfig/bitmaps

# The xfig objects begin here.
$xfigCanvas create line 0.566929i 1.133858i 3.188976i 0.0i  -width 3 -tags dashed 
$xfigCanvas create line 1.566929i 2.133858i 4.188976i 1.0i  -width 3 -tags dashed2 
$xfigCanvas create line 0.035433i 0.000000i 4.216535i 0.000000i 4.216535i \
  3.188976i 0.035433i 3.188976i 0.035433i 0.000000i -width 3
focus $xfigCanvas
$xfigCanvas itemconfigure dashed -dash "8 4 2 8 4 4"
$xfigCanvas itemconfigure dashed2 -dash "_.,"
set width 100 
puts "start Loop"
update 
for {set i 1} {$i<$width} {incr i} {
#puts [expr fmod($i,254)]
$xfigCanvas itemconfigure dashed -dashoffset $i
puts "dashofset: [$xfigCanvas itemcget dashed -dashoffset]"
update 
after 10
}
puts "ready"
$xfigCanvas itemconfigure dashed -dash ,.
update idletasks
after 1000
puts "change dash"
$xfigCanvas itemconfigure dashed -dash ,
update idletasks
after 1000
puts "change dash"
$xfigCanvas itemconfigure dashed -dash _.
update idletasks