Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9404
Modified Files: Tag: devel_0_39 desire.tk Log Message: array update using "pd .$self $i $val"
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.482 retrieving revision 1.1.2.483 diff -C2 -d -r1.1.2.482 -r1.1.2.483 *** desire.tk 26 Sep 2006 06:20:53 -0000 1.1.2.482 --- desire.tk 26 Sep 2006 11:19:59 -0000 1.1.2.483 *************** *** 4540,4543 **** --- 4540,4544 ---- $self item RECT polygon [list 0 0 $c_width 0 $c_width $c_height 0 $c_height] -outline red -fill $bg foreach val $@data { + if {!$val} {set val 0.0} set y [expr $c_height - ((($val+abs($yfrom))/($yto-($yfrom)) * $c_height))] set x1 [expr $width * $i] *************** *** 4548,4555 **** incr i } - - # $self item TEXT text [list $x1 $y1] \ - # -font [$self look fontstring] -text "an array named '$@name' should appear in this patch" \ - # -fill [$self look fg] -anchor nw }
--- 4549,4552 ---- *************** *** 4560,4570 **** mset {c_width c_height} [$@canvas get_dimen] set width [expr $c_width / $@length] set i [format %d [expr int($x/$width)]] set x1 [expr $width * $i] set x2 [expr $x1 + $width] set line [list $x1 $y $x2 $y] ! ! $self item elem${i} line $line -fill [$@canvas look compfg] -width 2 -tags " $self ${self}elem${i} " ! #hack.. if {[$@canvas editmode]} {set bg [$@canvas look bgedit]} else {set bg [$@canvas look bgrun]} $self item RECT polygon [list 0 0 $c_width 0 $c_width $c_height 0 $c_height] -outline red -fill $bg --- 4557,4572 ---- mset {c_width c_height} [$@canvas get_dimen] set width [expr $c_width / $@length] + set mess [$@canvas get_mess] + set xfrom [lindex $mess 0] + set yfrom [lindex $mess 3] + set xto [lindex $mess 2] + set yto [lindex $mess 1] set i [format %d [expr int($x/$width)]] set x1 [expr $width * $i] set x2 [expr $x1 + $width] set line [list $x1 $y $x2 $y] ! set val [expr (($c_height-$y)/$c_height) * ($yto-($yfrom)) + ($yfrom)] ! pd .$self $i $val ! #.. if {[$@canvas editmode]} {set bg [$@canvas look bgedit]} else {set bg [$@canvas look bgrun]} $self item RECT polygon [list 0 0 $c_width 0 $c_width $c_height 0 $c_height] -outline red -fill $bg