Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21946
Modified Files: Tag: devel_0_39 desire.tk Log Message: array draws
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.477 retrieving revision 1.1.2.478 diff -C2 -d -r1.1.2.477 -r1.1.2.478 *** desire.tk 21 Sep 2006 22:33:28 -0000 1.1.2.477 --- desire.tk 22 Sep 2006 01:24:14 -0000 1.1.2.478 *************** *** 1298,1302 **** 1 { set @subpatch 0 - set @graph1 0 mset {@fontsize} $args set @name "" --- 1298,1301 ---- *************** *** 1348,1351 **** --- 1347,1358 ---- }
+ def Canvas get_mess {} { + return [list $@coordsx1 $@coordsy1 $@coordsx2 $@coordsy2 $@pixwidth $@pixheight] + } + + def Canvas get_dimen {} { + return [list $@canvasxs $@canvasys] + } + def Canvas getscroll {} {}
*************** *** 1772,1776 **** def TextBox update_size {} { global font ! if {[info exists @graph1]} {if {$@graph1} return} set l {};set nl 1 foreach char [split $@text ""] {lappend l [scan $char %c]} --- 1779,1783 ---- def TextBox update_size {} { global font ! if {$@gop} {set @xs $@pixwidth; set @ys $@pixheight; return} set l {};set nl 1 foreach char [split $@text ""] {lappend l [scan $char %c]} *************** *** 1937,1940 **** --- 1944,1949 ---- }
+ def Canvas mapped {} {return $@mapped} + def Canvas children {} {return $@children}
*************** *** 4497,4508 **** global font mset {x1 y1} {0 0} ! #set @name (unknown) ! puts " my name is $@name" ! #$self item TEXT text [list $x1 $y1] \ ! # -font $font(str) -text "an array named '$@name' should appear in this patch" \ ! # -fill [$self look fg] -anchor nw ! $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 }
--- 4506,4535 ---- global font mset {x1 y1} {0 0} ! puts " my canvas is: $@canvas" ! if {![$@canvas mapped]} return ! set mess [$@canvas get_mess] ! mset {c_width c_height} [$@canvas get_dimen] ! #set @width [winfo width .$@canvas.c] ! #set @height [winfo height .$@canvas.c] ! set xfrom [lindex $mess 0] ! set yfrom [lindex $mess 3] ! set xto [lindex $mess 2] ! set yto [lindex $mess 1] ! set width [expr $c_width / $@length] ! #puts "w: $width | h: $height | length: $length | xfrom: $xfrom | xto: $xto | yfrom: $yfrom | yto: $yto" ! puts "data: $@data" ! set i 0 ! foreach val $@data { ! set y [expr $c_height - (($val/$yto) * $c_height)] ! set x1 [expr $width * $i] ! set x2 [expr $x1 + $width] ! set line [list $x1 $y $x2 $y] ! set tag ${self}${i} ! $self item $tag line $line -fill [$@canvas look compfg] -width 2 ! 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 }