Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28455
Modified Files: Tag: desiredata desire.tk Log Message: canvas evaluator now uses Class methods for completion
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.172 retrieving revision 1.1.2.600.2.173 diff -C2 -d -r1.1.2.600.2.172 -r1.1.2.600.2.173 *** desire.tk 23 Jan 2007 19:51:00 -0000 1.1.2.600.2.172 --- desire.tk 23 Jan 2007 23:35:19 -0000 1.1.2.600.2.173 *************** *** 3157,3163 **** set name [$@canvas class] set len [string length ${name}_] ! foreach def [info procs ${name}_*] { ! lappend @defs [string replace $def 0 $len-1] ! } }
--- 3157,3161 ---- set name [$@canvas class] set len [string length ${name}_] ! foreach def [$name methods] {lappend @defs $def} }
*************** *** 3174,3182 **** if {![llength $@completions]} return set def [lindex $@completions $@comp_i] ! if {[lindex $::__args(Canvas_$def) 0] == "self"} { ! set args [lreplace $::__args(Canvas_$def) 0 0] ! } else {set args $::__args(Canvas_$def)} ! if {![llength $args]} {set args "none"} ! set @comp [join [list $def ":" $args]] if {$which == "+"} { set @comp_i [expr ($@comp_i+1)%[llength $@completions]] --- 3172,3183 ---- if {![llength $@completions]} return set def [lindex $@completions $@comp_i] ! set args [$@canvas args $def] ! if {[lindex $args 0] == "self"} { ! set args2 [lreplace $args 0 0] ! } else { ! set args2 $args ! } ! if {![llength $args2]} {set args2 "none"} ! set @comp [join [list $def ":" $args2]] if {$which == "+"} { set @comp_i [expr ($@comp_i+1)%[llength $@completions]] *************** *** 3191,3194 **** --- 3192,3207 ---- }
+ def Thing args {def} { + set class [$self class] + set ancestors [$class ancestors] + set name ${class}_$def + set n 0; + foreach class $ancestors { + set name ${class}_$def + if {[info exists ::__args($name)]} {break} + } + return $::__args($name) + } + def Canvas foo {x y z} {puts " $z -- $y -- $x"} def Canvas visible_rect {} {