Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20576
Modified Files: Tag: devel_0_39 desire.tk Log Message: added def canvas wires=
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.125 retrieving revision 1.1.2.126 diff -C2 -d -r1.1.2.125 -r1.1.2.126 *** desire.tk 17 Nov 2005 18:52:43 -0000 1.1.2.125 --- desire.tk 23 Nov 2005 16:48:51 -0000 1.1.2.126 *************** *** 36,39 **** --- 36,46 ---- }
+ proc lwithout {a b} { + set r {} + foreach x $b {set c($x) {}} + foreach x $a {if {![info exists c($x)]} {lappend r $x}} + return $r + } + #-----------------------------------------------------------------------------------# # Observer pattern *************** *** 888,899 **** def* canvas ninlets= {n} {} def* canvas noutlets= {n} {} - #how can canvas_wires= know which list in $n is new? - #i mean, new connection does not seem to be added to the end or the beginning - #of $n, but ordered according the the wire_from order id - def* canvas wires= {n} {} - #so, maybe like this would work? - def* canvas wires_new {whoout outno whoin inno} { - wire_new $@children $whoout $outno $whoin $inno - } def canvas focus {} {return $@focus}
--- 895,898 ---- *************** *** 961,965 **** def canvas new_menubar {editable} { set name .$self ! global pd_opendir pd_tearoff OS cmdline canvasmenu _ set m $name.m menu $m --- 960,964 ---- def canvas new_menubar {editable} { set name .$self ! global pd_opendir pd_tearoff OS cmdline canvasmenu set m $name.m menu $m *************** *** 1320,1336 **** #def* canvas del {i} {lset @children $i ""}
- proc lwithout {a b} { - set r {} - foreach x $b {set c($x) {}} - foreach x $a {if {![info exists c($x)]} {lappend r $x}} - return $r - } - def* canvas children= {children} { # think of the children!!! ! set born [lwithout $children $@children]; post %s "BORN: $born" ! set dead [lwithout $@children $children]; post %s "DEAD: $dead" ! foreach x $born {$x subscribe $self; $x changed; $x canvas= $self} ! foreach x $dead {$x unsubscribe $self; $x erase} set @children $children $self changed --- 1319,1326 ---- #def* canvas del {i} {lset @children $i ""}
def* canvas children= {children} { # think of the children!!! ! set born [lwithout $children $@children]; foreach x $born {$x subscribe $self; $x changed; $x canvas= $self} ! set dead [lwithout $@children $children]; foreach x $dead {$x unsubscribe $self; $x erase} set @children $children $self changed *************** *** 1350,1353 **** --- 1340,1364 ---- }
+ def* canvas wires= {wires2} { + set wires {} + set born [lwithout $wires $@wires]; foreach x $born {$x subscribe $self; $x changed; $x canvas= $self} + set dead [lwithout $@wires $wires]; foreach x $dead {$x unsubscribe $self; $x erase} + set @wires $wires + foreach x $wires2 { + if {[llength $x]==4} { + lappend wires [eval [concat [list wire_new $self] $x]] + } { + lappend wires $x + } + } + $self changed + } + + def* canvas wires_new {whoout outno whoin inno} { + # post %s BOO + } + + def* canvas wires {} {return $@wires} + def canvas delete_selection {} { foreach obj $@selection {$obj erase}