[PD-cvs] pd/src desire.tk,1.1.2.600.2.140,1.1.2.600.2.141
chunlee
chunlee at users.sourceforge.net
Wed Dec 27 20:07:47 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14839
Modified Files:
Tag: desiredata
desire.tk
Log Message:
sync subsequent findbar with the toplevel findbar
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.140
retrieving revision 1.1.2.600.2.141
diff -C2 -d -r1.1.2.600.2.140 -r1.1.2.600.2.141
*** desire.tk 26 Dec 2006 22:55:35 -0000 1.1.2.600.2.140
--- desire.tk 27 Dec 2006 19:07:43 -0000 1.1.2.600.2.141
***************
*** 1512,1515 ****
--- 1512,1517 ----
set @copy_count 0
set @visible_children {}
+ set @findbar ""
+ set @find_string ""
}
***************
*** 1775,1779 ****
--- 1777,1783 ----
}
}
+ def Canvas findbar {} {return $@findbar}
def Canvas find_string= {s} {set @find_string $s}
+ def Canvas find_string {} {return $@find_string}
def Canvas find_break= {i} {set @find_break $i}; #$used for find again
def Canvas find_canvas= {canvas} {set @find_canvas $canvas}; #used for find in nested [pd]
***************
*** 1931,1934 ****
--- 1935,1945 ----
}
+ def Canvas get_topcanvas {} {
+ set canvas $@canvas
+ if {$@canvas == ""} {return $self}
+ while {[$canvas canvas] != ""} {set canvas [$canvas canvas]}
+ return $canvas
+ }
+
def Canvas do_insert_obj {x y} {
if {$x == "none" && $y == "none"} {
***************
*** 2099,2102 ****
--- 2110,2114 ----
} elseif {$@subpatch || $@abs} {super}
if {!$@mapped} {return} else {if {![winfo exists [$self widget]]} {return}}
+ $self check_findbar
if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]}
[$self widget] configure -background $bg
***************
*** 2904,2909 ****
def FindBar remove {} {
! set f [$self widget]
! destroy $f
focus .$@canvas.c
}
--- 2916,2920 ----
def FindBar remove {} {
! [$@canvas get_topcanvas] remove_findbar
focus .$@canvas.c
}
***************
*** 2935,2938 ****
--- 2946,2970 ----
}
+ def Canvas remove_findbar {} {
+ set f [$@findbar widget]
+ destroy $f
+ foreach child $@children {
+ if {[$child class] == "Canvas" && [winfo exists .$child.c]} {
+ $child remove_findbar
+ }
+ }
+ }
+
+ def Canvas check_findbar {} {
+ if {$@canvas == "" || [winfo exists .$self.find]} {return}
+ set topcan [$self get_topcanvas]
+ if {[$topcan findbar] != ""} {
+ if {[winfo exists .$self.yscroll]} {set w .$self.yscroll} else {set w .$self.c}
+ set @findbar [FindBar new $self]
+ set fw [$@findbar widget]
+ ${fw}.find insert 0 [$topcan find_string]
+ pack [$@findbar widget] -side bottom -fill x -before $w
+ }
+ }
def Canvas index {child} {
# this could be O(1) if the proper database were maintained.
More information about the Pd-cvs
mailing list