Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9763
Modified Files: Tag: desiredata desire.tk Log Message: attempt to fix insert_object
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.83 retrieving revision 1.1.2.600.2.84 diff -C2 -d -r1.1.2.600.2.83 -r1.1.2.600.2.84 *** desire.tk 14 Dec 2006 05:12:26 -0000 1.1.2.600.2.83 --- desire.tk 14 Dec 2006 18:15:49 -0000 1.1.2.600.2.84 *************** *** 203,207 **** set o [lindex $@q $i] unset poolset($o) ! if {[catch {$o draw_maybe}]} {puts [error_dump]} if {$i == [expr [llength $@q] - 1]} {set @q {}} } --- 203,211 ---- set o [lindex $@q $i] unset poolset($o) ! if {[info exists _($o:_class)]} { ! if {[catch {$o draw_maybe}]} {puts [error_dump]} ! } else { ! puts " trys to draw ZOMBIe!!!!! $o" ! } if {$i == [expr [llength $@q] - 1]} {set @q {}} } *************** *** 227,231 **** if {[info exists _($obj:_class)]} { eval [concat $replyset($n) [list $obj]] ! } else {set future($obj) $replyset($n)} array unset replyset $n } --- 231,237 ---- if {[info exists _($obj:_class)]} { eval [concat $replyset($n) [list $obj]] ! } else { ! set future($obj) [list $replyset($n) [list $obj]] ! } array unset replyset $n } *************** *** 806,810 **** proc pd_connect {} { global sock ! if {[catch {set sock [socket localhost 13666]}]} { post "can't connect... wait a second" after 1000 pd_connect --- 812,816 ---- proc pd_connect {} { global sock ! if {[catch {set sock [socket 127.0.0.1 13666]}]} { post "can't connect... wait a second" after 1000 pd_connect *************** *** 1247,1250 **** --- 1253,1257 ----
def View draw_maybe {} { + if {$@canvas == "" && [winfo exists .$self.c]} {$self draw; return} if {[$self class] == "Canvas" && $@canvas == ""} {return} *************** *** 1838,1841 **** --- 1845,1872 ---- }
+ def Canvas new_object_insert {canvas obj} { + global future + if {[lsearch $@children $obj] < 0} { + set future($self) [list $self new_object_insert $self $obj]; return + } + set wire [$self selection_wire] + mset {obj1 outlet obj2 inlet} [$wire report] + $self disconnect [$wire connects] + set obj1_idx [$self children_idx $obj1] + set obj2_idx [$self children_idx $obj2] + set obj3_idx [$self children_idx $obj] + $self connect [list $obj1_idx $outlet $obj3_idx 0] + $self connect [list $obj3_idx 0 $obj2_idx $inlet] + $self action= none + # if {[$@canvas action] == "chain_obj"} { + # set obj1_idx [$@canvas children_idx [lindex [$@canvas selection] 0]] + # set obj2_idx [$@canvas children_idx $self] + # $@canvas connect [list $obj1_idx 0 $obj2_idx 0] + # $@canvas deselect_all + # $@canvas action= none + # after 100 $@canvas selection2= $obj2_idx + # } + } + def Canvas insertxy {} {return [list $@insert_x $@insert_y]}
*************** *** 1871,1876 **** set y [expr (abs($y2-$y1) / 2) + $y1] } ! # this should use callback... ! netsend [list .$self obj $x $y] set @action insert } --- 1902,1906 ---- set y [expr (abs($y2-$y1) / 2) + $y1] } ! netsend [list .$self obj $x $y] [list $self new_object_edit] set @action insert } *************** *** 2270,2293 **** foreach char [split $@text ""] {lappend l [scan $char %c]} $@canvas selection-= [list $self] ! netsend [list .$@canvas text_setto $self $l] [list $@canvas new_object_callback] ! if {[$@canvas action] == "insert"} { ! set wire [$@canvas selection_wire] ! mset {obj1 outlet obj2 inlet} [$wire report] ! $@canvas disconnect [$wire connects] ! set obj1_idx [$@canvas children_idx $obj1] ! set obj2_idx [$@canvas children_idx $obj2] ! set obj3_idx [$@canvas children_idx $self] ! $@canvas connect [list $obj1_idx $outlet $obj3_idx 0] ! $@canvas connect [list $obj3_idx 0 $obj2_idx $inlet] ! $@canvas action= none ! } ! if {[$@canvas action] == "chain_obj"} { ! set obj1_idx [$@canvas children_idx [lindex [$@canvas selection] 0]] ! set obj2_idx [$@canvas children_idx $self] ! $@canvas connect [list $obj1_idx 0 $obj2_idx 0] ! $@canvas deselect_all ! $@canvas action= none ! after 100 $@canvas selection2= $obj2_idx } }
--- 2300,2329 ---- foreach char [split $@text ""] {lappend l [scan $char %c]} $@canvas selection-= [list $self] ! switch [$@canvas action] { ! insert {set goto [list $@canvas new_object_insert $@canvas]} ! chain_obj {set goto [list $@canvas new_object_insert]} ! default {set goto [list $@canvas new_object_callback]} } + netsend [list .$@canvas text_setto $self $l] $goto + # netsend [list .$@canvas text_setto $self $l] [list $@canvas new_object_callback] + # if {[$@canvas action] == "insert"} { + # set wire [$@canvas selection_wire] + # mset {obj1 outlet obj2 inlet} [$wire report] + # $@canvas disconnect [$wire connects] + # set obj1_idx [$@canvas children_idx $obj1] + # set obj2_idx [$@canvas children_idx $obj2] + # set obj3_idx [$@canvas children_idx $self] + # $@canvas connect [list $obj1_idx $outlet $obj3_idx 0] + # $@canvas connect [list $obj3_idx 0 $obj2_idx $inlet] + # $@canvas action= none + # } + # if {[$@canvas action] == "chain_obj"} { + # set obj1_idx [$@canvas children_idx [lindex [$@canvas selection] 0]] + # set obj2_idx [$@canvas children_idx $self] + # $@canvas connect [list $obj1_idx 0 $obj2_idx 0] + # $@canvas deselect_all + # $@canvas action= none + # after 100 $@canvas selection2= $obj2_idx + # } }
*************** *** 4329,4334 **** $self changed if {[info exists future($self)]} { ! eval [concat $future($self)] [list $self] array unset future $self } } --- 4365,4371 ---- $self changed if {[info exists future($self)]} { ! set str [join $future($self)] array unset future $self + eval $str } }