Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14496
Modified Files: Tag: devel_0_39 desire.tk Log Message: simplified observers (part three), etc
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.84 retrieving revision 1.1.2.85 diff -C2 -d -r1.1.2.84 -r1.1.2.85 *** desire.tk 13 Oct 2005 08:17:51 -0000 1.1.2.84 --- desire.tk 21 Oct 2005 13:47:09 -0000 1.1.2.85 *************** *** 47,51 **** def observable init {observer} { set @subscribers {} - set @dirty {} }
--- 47,50 ---- *************** *** 60,75 **** }
! def observable changed {{k "(all)"}} { ! if {$k == "(all)" && $@dirty != "(all)"} {set @dirty $k} {lappend @dirty $k} ! } ! ! def observable notify {} { ! set dirty [lsort -uniq $@dirty] ! if {$dirty == "(all)"} { ! foreach x $@subscribers {$x notice $self} ! } { ! foreach x $@subscribers {foreach k $dirty {$x notice $self $k}} ! } ! set @dirty {} }
--- 59,64 ---- }
! def observable changed {args} { ! foreach x $@subscribers {eval [concat [list $x notice $self] $args]} }
*************** *** 902,925 **** if {[info exists focus(createdby)]} { switch $focus(createdby) { ! butt { set @cx 40 set @cy 40 ! } ! ctrl { ! if {[string length $focus(objname)] > 0} { set @cx $focus(old_cx) set @cy $focus(old_cy) ! ! } else { set @cx $_($canvas:current_x) set @cy $_($canvas:current_y) set focus(old_cx) $@cx set focus(old_cy) $@cy ! } ! } ! } ! } } - return [list $@cx $@cy] } --- 891,911 ---- if {[info exists focus(createdby)]} { switch $focus(createdby) { ! butt { set @cx 40 set @cy 40 ! } ! ctrl { ! if {[string length $focus(objname)] > 0} { set @cx $focus(old_cx) set @cy $focus(old_cy) ! } else { set @cx $_($canvas:current_x) set @cy $_($canvas:current_y) set focus(old_cx) $@cx set focus(old_cy) $@cy ! } ! } ! }} } return [list $@cx $@cy] } *************** *** 1395,1400 **** pd "$self select-object x$id ;" } elseif {!$already} { - #switch $_($id:class) { - #objectbox { # may need to call canvas_select_object here to work out # the shift+click selection --- 1381,1384 ---- *************** *** 1419,1424 **** } set @select_by "click" - #} - #} } set @action move --- 1403,1406 ---- *************** *** 1453,1457 **** default { if {$@editmode} { ! puts "clicked on black space and in edit mode" # my object edit mode code begins --chun if {[llength $@obj_in_edit]} { --- 1435,1439 ---- default { if {$@editmode} { ! puts "clicked on blank space and in edit mode" # my object edit mode code begins --chun if {[llength $@obj_in_edit]} { *************** *** 2267,2290 ****
class_new bang {view} ! def bang init {} { ! global offset _ ! set offset [expr $offset + 1] ! set bang_id [format %x [expr 0x81168b0 - $offset]] ! #puts "new object id -> $bang_id" ! ! set _($bang_id:w) 15 ! set _($bang_id:rcv) 1 ! set _($bang_id:snd) 1 ! set _($bang_id:bcol) 20 ! set _($bang_id:fcol) 5 ! set _($bang_id:ldx) 17 ! set _($bang_id:ldy) 0 ! set _($bang_id:lab) bang ! set _($bang_id:fstyle) 0 ! set _($bang_id:fs) 10 ! set _($bang_id:lcol) 13 ! set _($bang_id:class) bang ! bang_draw $bang_id $canvas ! }
def bang draw {canvas} { --- 2249,2253 ----
class_new bang {view} ! #def bang init {} {}
def bang draw {canvas} {