Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10919
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
commit for nested GOPs
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.530
retrieving revision 1.1.2.531
diff -C2 -d -r1.1.2.530 -r1.1.2.531
*** desire.tk 25 Oct 2006 21:40:01 -0000 1.1.2.530
--- desire.tk 26 Oct 2006 02:42:42 -0000 1.1.2.531
***************
*** 1019,1023 ****
#set c [[$self get_canvas] widget]
set c [$canvas widget]
! set zoom [$@canvas zoom]
set coords [lmap * $coords $zoom]
#puts "coords::$coords"
--- 1019,1024 ----
#set c [[$self get_canvas] widget]
set c [$canvas widget]
! #set zoom [$@canvas zoom]
! set zoom [$canvas zoom]
set coords [lmap * $coords $zoom]
#puts "coords::$coords"
***************
*** 1038,1043 ****
foreach s $suffixes {lappend tags "$self$s"}
set ss [lindex $tags 0]
! lappend tags list $self
if {![llength [$c gettags $ss]]} {
eval [concat [list $c create $type $coords -tags $tags] $args]
} {
--- 1039,1045 ----
foreach s $suffixes {lappend tags "$self$s"}
set ss [lindex $tags 0]
! lappend tags [list $self]
if {![llength [$c gettags $ss]]} {
+ #puts " c --> $c"
eval [concat [list $c create $type $coords -tags $tags] $args]
} {
***************
*** 1130,1146 ****
}
return $canvas
-
-
- #if {[winfo exists .$(a)canvas.c]} {
- # return $@canvas
- #} else {
- # set next_canvas [$@canvas canvas]
- # if {[winfo exists .$next_canvas.c]} {
- # return $next_canvas
- # } else {
- # #puts "bug:: no canvas found..."
- # return none
- # }
- #}
}
--- 1132,1135 ----
***************
*** 1171,1174 ****
--- 1160,1166 ----
#set @inside_box 1; return
mset {x1 y1} [$@canvas xy]
+ $@canvas visible_children+= $self
+ set @inside_box 1
+ return
} else {
set x1 $@x1; set y1 $@y1
***************
*** 1208,1217 ****
if {[$self class] == "Array"} {$self draw; return}
# puts "skipping $self, don't draw it...."
- #set c [$self get_canvas]
- #if {$c != "none"} {
- # puts " ............ [$c widget] ............ $self"
- # if {[winfo exists [$c widget]]} {
- # }
- #}
$self delete
}
--- 1200,1203 ----
***************
*** 1877,1881 ****
def Canvas restack {} {
set c [$self get_canvas]
! [$c widget] lower $self [lindex [$self children] 0]
}
--- 1863,1877 ----
def Canvas restack {} {
set c [$self get_canvas]
! set stack {}
! #[$c widget] lower $self [lindex [$self visible_children] 0]
! foreach children [$self visible_children] {
! foreach i [[$c widget] find withtag $children] {
! if {$i != ""} {lappend stack $i}
! }
! }
! set stack [lsort $stack]
! set lowest [[$c widget] gettags [lindex $stack 0]]
! if {[regexp {^[xo][0-9a-f]{6,8}} $lowest id]} {set lowest $id}
! [$c widget] lower $self $lowest
}
***************
*** 2229,2232 ****
--- 2225,2238 ----
def Canvas visible_children {} {return $@visible_children}
+
+ def Canvas all_changed {} {
+ foreach x $@visible_children {
+ if {[$x class] == "Canvas"} {
+ if {$@gop} {$x all_changed}
+ }
+ $x changed
+ }
+ }
+
# for undo; calls the server
def Canvas ins {i constructor} {
***************
*** 3413,3417 ****
--- 3419,3438 ----
$spinbox set $per%
set @zoom [expr $per/100.0] ;# @zoom must be float, not int
+ $self propagate_zoom $@zoom
$self redraw
+ foreach children $@children {
+ if {[$children class] == "Canvas"} {
+ if {[$children gop]} {$children all_changed}
+ }
+ }
+ }
+
+ def Canvas propagate_zoom {zoom} {
+ foreach children $@children {
+ if {[$children class] == "Canvas"} {
+ set @zoom $zoom
+ $children propagate_zoom $zoom
+ }
+ }
}
***************
*** 3613,3617 ****
#update/move the content of gop
if {[$self class] == "Canvas"} {
! if {[$self gop] && ![winfo exists .$self.c]} {foreach x $@visible_children {$x changed}}
} else {
$self changed_wires
--- 3634,3638 ----
#update/move the content of gop
if {[$self class] == "Canvas"} {
! if {[$self gop] && ![winfo exists .$self.c]} {$self all_changed}
} else {
$self changed_wires
***************
*** 5051,5057 ****
def Array draw {} {
global font
mset {x_off y_off} [$@canvas xy]
mset {xfrom yto xto yfrom pixwidth pixheight} [$@canvas get_mess]
- puts " my canvas :::: $@canvas"
if {[winfo exists [$@canvas widget]]} {
mset {c_width c_height} [$@canvas get_dimen]
--- 5072,5078 ----
def Array draw {} {
global font
+ #set canvas [$self get_canvas]
mset {x_off y_off} [$@canvas xy]
mset {xfrom yto xto yfrom pixwidth pixheight} [$@canvas get_mess]
if {[winfo exists [$@canvas widget]]} {
mset {c_width c_height} [$@canvas get_dimen]
***************
*** 5071,5075 ****
} else {
set width [expr $pixwidth / $@length]
! set canvas [$@canvas canvas]
set i 0
foreach val $@data {
--- 5092,5098 ----
} else {
set width [expr $pixwidth / $@length]
! #set canvas [$@canvas canvas]
! set canvas [$self get_canvas]
! # puts " ....... Array: $self draw on canvas: $canvas canvas:: $@canvas width:: $width"
set i 0
foreach val $@data {
***************
*** 5079,5092 ****
set x2 [expr $x1 + $width]
set line [list $x1 $y $x2 $y]
! set c $@canvas
! #$@canvas item elem${i} line $line -fill [$@canvas look compfg] -width 2 \
! # -tags "$self ${c}elem${i}"
! $@canvas item elem${i} line $line -fill [$self look fg] -width 2 \
! -tags "$self ${c}elem${i}"
incr i
}
- # hack, need to remove this.....
- after 1 [[$@canvas get_canvas] widget] raise $@canvas
- after 1 [[$@canvas get_canvas] widget] raise $self
}
}
--- 5102,5109 ----
set x2 [expr $x1 + $width]
set line [list $x1 $y $x2 $y]
! $canvas item ${self}ELEM${i} line $line -fill [$self look fg] -width 2 \
! -tags "${self}ELEM${i} ${canvas}${self}ELEM${i} $self"
incr i
}
}
}
***************
*** 5132,5136 ****
}
}
! def Array length= {val} {set @length $val}
def Array name= {val} {set @name $val}
def Array array_set {data_list} {
--- 5149,5153 ----
}
}
! def Array length= {val} {set @length [format %f $val]}
def Array name= {val} {set @name $val}
def Array array_set {data_list} {