Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17310
Modified Files: Tag: devel_0_39 desire.tk Log Message: some code for Array
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.378 retrieving revision 1.1.2.379 diff -C2 -d -r1.1.2.378 -r1.1.2.379 *** desire.tk 20 Aug 2006 01:00:44 -0000 1.1.2.378 --- desire.tk 20 Aug 2006 01:38:53 -0000 1.1.2.379 *************** *** 3021,3024 **** --- 3021,3025 ---- set fields(floatatom) {foo bar x1 y1 w min max pos lab snd rcv} set fields(symbolatom) {foo bar x1 y1 w min max pos lab snd rcv} + set fields(array) {name n elemtype flags}
proc classinfo {pdclass _class} { *************** *** 3028,3031 **** --- 3029,3033 ---- }
+ # basic patchables classinfo obj ObjectBox classinfo msg MessageBox *************** *** 3034,3037 **** --- 3036,3043 ---- classinfo text Comment
+ # non-patchables (scalars, arrays, ...) + classinfo array Array + + # GUI patchables classinfo bng Bang classinfo tgl Toggle *************** *** 3055,3058 **** --- 3061,3068 ---- # remember, _($foo:$bar) notation should die # because objects ought to be autonomous. + + # in array objects, number of inlets is bogus? + #X array array1 1 float 3; + #A 0 0; proc update_object {self e ninlets noutlets} { global _ fields classinfo canvas *************** *** 3084,3092 **** } if {$isnew} {$_class new_as $self} ! $self position= [lrange $mess 2 3] $self canvas= $canvas(current) $self pdclass= $class ! $self ninlets= $ninlets $self noutlets= $noutlets switch -- $class { obj {$self text= [join [lrange $mess 4 end]]} --- 3094,3106 ---- } if {$isnew} {$_class new_as $self} ! switch -- $class { ! array {} ! default {$self position= [lrange $mess 2 3]} ! } $self canvas= $canvas(current) $self pdclass= $class ! $self ninlets= $ninlets ;# bogus in case of array $self noutlets= $noutlets + #puts "CLASS IS $class" switch -- $class { obj {$self text= [join [lrange $mess 4 end]]} *************** *** 3094,3097 **** --- 3108,3112 ---- text {$self text= [join [lrange $mess 4 end]]} restore {$self text= [join [lrange $mess 4 end]]} + array {puts "\033[0;1;32mGOT ARRAY!"} default { set i 0; foreach f $fields($class) { *************** *** 4130,4133 **** --- 4145,4162 ---- }
+ class_new Array {Box} + + def Array init {} { + + } + + def Array draw {} { + global font + mset {x1 y1} {0 0} + $self item TEXT text [list $x1 $y1] \ + -font $font(str) -text "an array named '$@name' should appear in this patch" \ + -fill [look objectfg] -anchor nw + } + ##################################################################################### # console