# cscroll.tcl --
#
# This demonstration script creates a simple canvas that can be
# scrolled in two dimensions.
#
# SCCS: @(#) cscroll.tcl 1.5 96/10/04 17:09:36
catch {destroy $w}
toplevel $w
label $w.msg -font $font -wraplength 4i -justify left -text "This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas. If you click button 1 on one of the rectangles, its indices will be printed on stdout."
frame $w.grid
-xscrollcommand "$w.hscroll set" \
-yscrollcommand "$w.vscroll set"
}
}
proc scrollEnter canvas {
global oldFill
}
} else {
}
}
proc scrollLeave canvas {
global oldFill
}
}
proc scrollButton canvas {
global oldFill
}
puts stdout "You buttoned at [lindex [$canvas itemconf $id -text] 4]"
}