From bc5e203f7787980f65f81ddbf69a619ab34fa85e Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 9 Mar 2004 12:41:22 +0000 Subject: toxy alpha6 svn path=/trunk/externals/miXed/; revision=1396 --- test/toxy/multiscale.wid | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/toxy/multiscale.wid (limited to 'test/toxy/multiscale.wid') diff --git a/test/toxy/multiscale.wid b/test/toxy/multiscale.wid new file mode 100644 index 0000000..f66ef6c --- /dev/null +++ b/test/toxy/multiscale.wid @@ -0,0 +1,39 @@ +proc ::toxy::multiscalecommand {target sel ndx v} { + pd [concat $target $sel $v $ndx \;] +} + +proc ::toxy::multiscale {path target remote count dx dy bg} { + if {[winfo exists $path.s0]} { +# puts stderr [concat $path.s0 exists] + } else { + set width [expr {$count * $dx + 10}] + set height [expr {$dy + 10}] + $path config -width $width -height $height -bg $bg + set px 5 + set py 5 + for {set ndx 0} {$ndx < $count} {incr ndx} { + scale $path.s$ndx -width $dx -length $dy \ + -from 1 -to 0 -resolution 0.01 \ + -bg $bg -highlightthickness 0 \ + -command [concat ::toxy::multiscalecommand $target _cb $ndx] + if {$dx < 50} { + $path.s$ndx config -showvalue 0 -relief flat + } else { + $path.s$ndx config -digits 3 -relief sunken + } + set id [$path create window $px $py -width $dx -height $dy \ + -anchor nw -window $path.s$ndx -tags $path.s$ndx] + ::toxy::masterinit $path.s$ndx $target $path + incr px $dx + } + } +} + +#> multiscale canvas +#. #n 3 #dx 60 #dy 90 +#. #bg yellow + +::toxy::multiscale .- .| . .#n .#dx .#dy .#bg + +# undo the "bind Canvas <1> {+focus %W}" in the setup part above +bind .- {focus .^.c} -- cgit v1.2.1