Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8942
Modified Files: Tag: devel_0_39 desire.tk Log Message: starting with array
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.475 retrieving revision 1.1.2.476 diff -C2 -d -r1.1.2.475 -r1.1.2.476 *** desire.tk 18 Sep 2006 13:21:30 -0000 1.1.2.475 --- desire.tk 21 Sep 2006 20:23:30 -0000 1.1.2.476 *************** *** 1294,1300 **** --- 1294,1302 ---- set @canvasys [lindex $mess 5] set args [lrange $mess 6 end] + puts " canvas args::: $args" switch [llength $args] { 1 { set @subpatch 0 + set @graph1 0 mset {@fontsize} $args set @name "" *************** *** 1302,1306 **** } 2 { ! set @subpatch 1 set @name [lindex $args 0] set @mapped [lindex $args 1] --- 1304,1315 ---- } 2 { ! if {[lindex $args 0] != "graph1"} { ! set @subpatch 1 ! set @graph1 0 ! } else { ! set @subpatch 1 ! set @graph1 1 ! } ! # set @subpatch 1 set @name [lindex $args 0] set @mapped [lindex $args 1] *************** *** 1328,1332 **** switch [llength $mess] { 8 {set @gop 0; set @goprect 0} ! 9 {set @gop [lindex $mess 8]; set @goprect 0} 11 { set @gop [lindex $mess 8] --- 1337,1353 ---- switch [llength $mess] { 8 {set @gop 0; set @goprect 0} ! 9 { ! if {$@graph1} { ! #X coords 0 5 4 0 200 140 1; ! set @xfrom [lindex $mess 2] ! set @yfrom [lindex $mess 3] ! set @xto [lindex $mess 4] ! set @yto [lindex $mess 5] ! set @xs [lindex $mess 6] ! set @ys [lindex $mess 7] ! puts " i got a graph1 for $self" ! } ! set @gop [lindex $mess 8]; set @goprect 0e ! } 11 { set @gop [lindex $mess 8] *************** *** 1632,1636 ****
def Canvas draw {} { ! if {$@subpatch && $@canvas != ""} { super} ;# is for the [pd] box if applicable if {!$@mapped} {return} if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]} --- 1653,1657 ----
def Canvas draw {} { ! if {$@subpatch && $@canvas != ""} {super} ;# is for the [pd] box if applicable if {!$@mapped} {return} if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]} *************** *** 1770,1773 **** --- 1791,1795 ---- 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]} *************** *** 3409,3413 **** if {$isnew} {$_class new_as $self $mess} else {$self reinit $mess} switch -- $class { ! array {} default {$self position= [lrange $mess 2 3]} } --- 3431,3435 ---- if {$isnew} {$_class new_as $self $mess} else {$self reinit $mess} switch -- $class { ! array {$self length= [lindex $mess 3]; $self name= [lindex $mess 2]} default {$self position= [lrange $mess 2 3]} } *************** *** 3422,3425 **** --- 3444,3448 ---- "#A" { post "#A: $mess" + $self array_set [lrange $mess 2 end] } "#V" { *************** *** 4478,4481 **** --- 4501,4512 ---- class_new Array {Box}
+ def Array init {mess} { + super $mess + set @name [lindex $mess 2] + puts " my name is :::: $@name" + set @length 0 + set @data {} + } + def Array bbox {} { return {0 0 1 1} ;# huh? *************** *** 4485,4489 **** global font mset {x1 y1} {0 0} ! set @name (unknown) #$self item TEXT text [list $x1 $y1] \ # -font $font(str) -text "an array named '$@name' should appear in this patch" \ --- 4516,4521 ---- 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" \ *************** *** 4494,4497 **** --- 4526,4544 ---- }
+ def Array length= {val} {set @length $val} + def Array name= {val} {set @name $val} + def Array array_set {data_list} { + if {[llength $data_list] == $@length} { + set @data {} + for {set i 0} {$i < $@length} {incr i} { + lappend @data [lindex $data_list $i] + } + puts " data set:::: $@data" + } else { + puts "error....." + } + + } + ##################################################################################### # console