Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3230
Modified Files: Tag: desiredata desire.tk Log Message: minor speedup in Observable. also, client/server socket is only logged if set debug 1
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.26 retrieving revision 1.1.2.600.2.27 diff -C2 -d -r1.1.2.600.2.26 -r1.1.2.600.2.27 *** desire.tk 6 Dec 2006 08:12:23 -0000 1.1.2.600.2.26 --- desire.tk 6 Dec 2006 19:42:17 -0000 1.1.2.600.2.27 *************** *** 31,34 **** --- 31,36 ---- # this command rebuilds the package index: echo pkg_mkIndex . | tclsh
+ set debug 0 + if {[catch {winfo children .}]} {set tk 0} {set tk 1}
*************** *** 169,177 **** if {$i>=0} {set @subscribers [lreplace $@subscribers $i $i]} } ! def Observable changed {args} { ! foreach x $@subscribers {eval [concat [list $x notice $self] $args]} ! } ! def Observable child_changed {origin args} { ! foreach x $@subscribers {eval [concat [list $x notice $origin] $args]} } def Observable subscribers {} {return $@subscribers} --- 171,181 ---- if {$i>=0} {set @subscribers [lreplace $@subscribers $i $i]} } ! ! if {$tcl_version>=8.5} { ! def Observable changed {args} {foreach x $@subscribers {$x notice $self {expand}$args]}} ! def Observable child_changed {origin args} {foreach x $@subscribers {$x notice $origin {expand}$args]}} ! } else { ! def Observable changed {args} {foreach x $@subscribers {eval [concat [list $x notice $self] $args]}} ! def Observable child_changed {origin args} {foreach x $@subscribers {eval [concat [list $x notice $origin] $args]}} } def Observable subscribers {} {return $@subscribers} *************** *** 251,255 **** } puts $sock "$message;" ! puts "<- $message;" }
--- 255,259 ---- } puts $sock "$message;" ! if {$::debug} {puts "<- $message;"} }
*************** *** 754,758 **** } if {[fblocked $sock]} {break} ! if {[string first pdtk_post $cmd]!=0} {puts "-> $cmd"} append sock_lobby "\n$cmd" if {[catch {eval $sock_lobby}]} { --- 758,762 ---- } if {[fblocked $sock]} {break} ! if {$::debug} {if {[string first pdtk_post $cmd]!=0} {puts "-> $cmd"}} append sock_lobby "\n$cmd" if {[catch {eval $sock_lobby}]} { *************** *** 1091,1102 **** }
- def View look_old {k} { - global look - if {[info exists look($@_class:$k)]} {return $look($@_class:$k)} - foreach super [$@_class ancestors] { - if {[info exists look($super:$k)]} {return $look($super:$k)} - } - } - def View init {} { super --- 1095,1098 ---- *************** *** 1112,1118 **** set canvas [$self get_canvas] if {$canvas == "none"} {return} - #set c [[$self get_canvas] widget] set c [$canvas widget] - #set zoom [$@canvas zoom] set zoom [$canvas zoom] set coords [lmap * $coords $zoom] --- 1108,1112 ---- *************** *** 1122,1126 **** set args [lreplace $args [expr $find + 1] [expr $find + 1] $new_width] } - set find [lsearch $args "-font"] if {$find >= 0} { --- 1116,1119 ---- *************** *** 1129,1133 **** set args [lreplace $args [expr $find + 1] [expr $find + 1] [lreplace $font 1 1 $new_size]] } - set tags {} foreach s $suffixes {lappend tags "$self$s"} --- 1122,1125 ---- *************** *** 2014,2018 **** if {$@edit} { set t [$@canvas widget].${self}text ! $self item text window [list [expr $x1+2] [expr $y1+2]] \ -window $t -anchor nw -tags "${self}text $self text" } { --- 2006,2010 ---- if {$@edit} { set t [$@canvas widget].${self}text ! $self item text window [list [expr {$x1+2}] [expr {$y1+2}]] \ -window $t -anchor nw -tags "${self}text $self text" } { *************** *** 2023,2028 **** } $self item TEXT text [l+ {2 2} [list $x1 $y1]] \ ! -font [$self look font] -text $text \ ! -fill [$self look fg] -anchor nw } $self update_size --- 2015,2020 ---- } $self item TEXT text [l+ {2 2} [list $x1 $y1]] \ ! -font [View_look $self font] -text $text \ ! -fill [View_look $self fg] -anchor nw } $self update_size