[PD-cvs] pd/src desire.tk,1.1.2.529,1.1.2.530
chunlee
chunlee at users.sourceforge.net
Wed Oct 25 23:40:05 CEST 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29135
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
some more works on gop/abs/[pd]
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.529
retrieving revision 1.1.2.530
diff -C2 -d -r1.1.2.529 -r1.1.2.530
*** desire.tk 25 Oct 2006 15:56:48 -0000 1.1.2.529
--- desire.tk 25 Oct 2006 21:40:01 -0000 1.1.2.530
***************
*** 1015,1020 ****
def View item {suffixes type coords args} {
global font
! set c [[$self get_canvas] widget]
! #set c [$@canvas widget]
set zoom [$@canvas zoom]
set coords [lmap * $coords $zoom]
--- 1015,1022 ----
def View item {suffixes type coords args} {
global font
! set canvas [$self get_canvas]
! if {$canvas == "none"} {return}
! #set c [[$self get_canvas] widget]
! set c [$canvas widget]
set zoom [$@canvas zoom]
set coords [lmap * $coords $zoom]
***************
*** 1108,1112 ****
--- 1110,1151 ----
# this returns the canvas actually exists/drawn
def View get_canvas {} {
+ if {[info exists @gop]} {
+ if {$@gop} {
+ set canvas $@canvas
+ while {![winfo exists [$canvas widget]]} {
+ set canvas [$canvas canvas]
+ }
+ return $canvas
+ }
+ }
+
+ if {[info exists @subpatch]} {
+ if {$@subpatch} {return [$self canvas]}
+ }
+ if {[info exists @abs]} {if {$@abs} {return [$self canvas]}}
+ if {[winfo exists .$self.c]} {return $self}
+ set canvas $@canvas
+ while {![winfo exists [$canvas widget]]} {
+ set canvas [$canvas canvas]
+ }
+ return $canvas
+
+
+ #if {[winfo exists .$@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
+ # }
+ #}
+ }
+
+ def View get_canvas2 {} {
if {[info exists @subpatch]} {if {$@subpatch} {return [$self canvas]}}
+ if {[info exists @abs]} {if {$@abs} {return [$self canvas]}}
if {[winfo exists .$self.c]} {return $self}
if {[winfo exists .$@canvas.c]} {
***************
*** 1123,1126 ****
--- 1162,1166 ----
}
+
def View outside_of_the_box {} {
# always hide these things
***************
*** 1160,1164 ****
if {[$self class] == "Canvas" && $@canvas == ""} {return}
if {$@inside_box} {
! if {[$@canvas mapped]} {$self draw}
} else {
# for drawing opened gop
--- 1200,1204 ----
if {[$self class] == "Canvas" && $@canvas == ""} {return}
if {$@inside_box} {
! if {[$@canvas mapped]} {if {![$@canvas abs]} {$self draw}}
} else {
# for drawing opened gop
***************
*** 1168,1171 ****
--- 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
}
***************
*** 1410,1414 ****
if {$@mapped && !$@gop} {
if {!$@subpatch && !$@gop && $@text != ""} {
- puts " I THINK I AM A ABSTRACTION $self"
set @abs 1
return
--- 1456,1459 ----
***************
*** 1461,1464 ****
--- 1506,1510 ----
def Canvas gop {} {return $@gop}
+ def Canvas abs {} {return $@abs}
def Canvas subpatch {} {return $@subpatch}
def Canvas get_dimen {} {
***************
*** 1814,1818 ****
#if {$@subpatch && $@canvas != "" && !$@gop} {if {![winfo exists [$self widget]]} {super}} ;# is for the [pd] box if applicable
if {$@subpatch && $@canvas != "" && !$@gop} {super} ;# is for the [pd] box if applicable
! if {$@gop && ![winfo exists [$self widget]]} {super; return}
if {$@abs} {super; return}
if {!$@mapped} {return}
--- 1860,1864 ----
#if {$@subpatch && $@canvas != "" && !$@gop} {if {![winfo exists [$self widget]]} {super}} ;# is for the [pd] box if applicable
if {$@subpatch && $@canvas != "" && !$@gop} {super} ;# is for the [pd] box if applicable
! if {$@gop && ![winfo exists [$self widget]]} {super; $self restack; return}
if {$@abs} {super; return}
if {!$@mapped} {return}
***************
*** 1828,1831 ****
--- 1874,1883 ----
}
+
+ def Canvas restack {} {
+ set c [$self get_canvas]
+ [$c widget] lower $self [lindex [$self children] 0]
+ }
+
def Canvas popup_properties {} {CanvasPropertiesDialog new $self}
***************
*** 2218,2222 ****
set find [lsearch $@wires_pair $x]
set @wires_pair [lreplace $@wires_pair [expr $find -1] $find]
! $x unsubscribe $self; $x erase
}
set @wires $wires
--- 2270,2274 ----
set find [lsearch $@wires_pair $x]
set @wires_pair [lreplace $@wires_pair [expr $find -1] $find]
! $x unsubscribe $self; $x delete
}
set @wires $wires
***************
*** 2997,3000 ****
--- 3049,3055 ----
set c [$self widget]
set @insert_x $x; set @insert_y $y
+ if {[$id class] != "Canvas"} {
+ if {![winfo exists [[$id canvas] widget]]} {set id [$id canvas]}
+ }
$self popup $id [winfo pointerx $c] [winfo pointery $c]
}
***************
*** 3506,3510 ****
def Box connect_in {} {}
! def Box draw {} {$self draw_box}
def Box draw_box {} {}
def Box edit {} {}
--- 3561,3568 ----
def Box connect_in {} {}
! def Box draw {} {
! $self draw_box
! # if {[$self class] == "Canvas"} {$self restack}
! }
def Box draw_box {} {}
def Box edit {} {}
***************
*** 3735,3738 ****
--- 3793,3797 ----
def Wire delete {} {
+ if {![winfo exists .$@canvas.c]} {return}
$@obj1 delete_wire $self
$@obj2 delete_wire $self
More information about the Pd-cvs
mailing list