[PD-cvs] pd/src desire.tk,1.1.2.600.2.295,1.1.2.600.2.296

Mathieu Bouchard matju at users.sourceforge.net
Mon Aug 6 23:57:24 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17544

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
more $@children stuff


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.295
retrieving revision 1.1.2.600.2.296
diff -C2 -d -r1.1.2.600.2.295 -r1.1.2.600.2.296
*** desire.tk	6 Aug 2007 19:24:21 -0000	1.1.2.600.2.295
--- desire.tk	6 Aug 2007 21:57:20 -0000	1.1.2.600.2.296
***************
*** 2648,2654 ****
--- 2648,2656 ----
  def Canvas children_idx {obj} {return [lsearch $@children $obj]}
  def Canvas child_by_idx {obj} {return [lindex  $@children $obj]}
+ def Canvas children_each {var code} {uplevel 2 [list foreach $var [$self children] $code]}
  
  def Canvas havewindow= {flag} {
  	global subpatcherize
+ 	# race condition!
  	if {$::subpatcherize(future_sub) != ""} {
  		$::subpatcherize(future_sub) subpatcherize_paste
***************
*** 2658,2671 ****
  	#if {$flag && $was && [$self gop]} {$self redraw}
  	if {$flag && $was} {$self raise}
! 	if {$flag && !$was} {
! 		#if {!$subpatcherize(paste) && !$subpatcherize(edit)} {
! 		#	netsend [list .$self map 1]
! 		#	$self init_window
! 		#} else {
! 		#	if {$subpatcherize(paste)} {set subpatherize(paste) 0}
! 		#	if {$subpatcherize(edit)} {set subpatherize(edit) 0; $self draw_wires}
! 		#}
! 	}   ;#???
!     if {!$flag && $was} {$self delete_window} ;#???
  }
  
--- 2660,2664 ----
  	#if {$flag && $was && [$self gop]} {$self redraw}
  	if {$flag && $was} {$self raise}
! 	if {!$flag && $was} {$self delete_window}
  }
  
***************
*** 2765,2769 ****
  		#HACK: check for >=0 because object not deleted properly.
  		#set i [$self index $obj]; if {$i>=0} {$self del $i}
! 		$self del [$self index $obj]
  	}
  	foreach x $@selection_wire {
--- 2758,2762 ----
  		#HACK: check for >=0 because object not deleted properly.
  		#set i [$self index $obj]; if {$i>=0} {$self del $i}
! 		$self del [$self children_idx $obj]
  	}
  	foreach x $@selection_wire {
***************
*** 2834,2838 ****
  
  def Canvas quadrant {du dv array} {
! 	switch $@keynav_current { 0 {set @keynav_current [lindex $@children 0]}}
  	set foo {}
  	set bar {}
--- 2827,2831 ----
  
  def Canvas quadrant {du dv array} {
! 	if {!$@keynav_current} {set @keynav_current [lindex $@children 0]}
  	set foo {}
  	set bar {}
***************
*** 3343,3357 ****
  def Canvas get_childcanvas {} {
  	set canvases {}
! 	foreach child $@children {if {[$child class] == "Canvas"} {lappend canvases $child}}
  	return $canvases
  }
  
- def Canvas index {child} {
- 	# this could be O(1) if the proper database were maintained.
- 	set n [lsearch $@children $child]
- 	if {$n<0} {puts "Canvas index $child == -1 !!!"}
- 	return $n
- }
- 
  def Canvas runcommand {} {$@runcommand pack_prompt}
  
--- 3336,3343 ----
  def Canvas get_childcanvas {} {
  	set canvases {}
! 	foreach child [$self children] {if {[$child class] == "Canvas"} {lappend canvases $child}}
  	return $canvases
  }
  
  def Canvas runcommand {} {$@runcommand pack_prompt}
  
***************
*** 5497,5508 ****
  	set @properties [list "gop" "xfrom" "xto" "yfrom" "yto" "width" "height" "xmargin" "ymargin"]
  	set mess [$of get_mess]
! 	set @xfrom   [lindex $mess 0]
! 	set @xto     [lindex $mess 2]
! 	set @yfrom   [lindex $mess 1]
! 	set @yto     [lindex $mess 3]
! 	set @width   [lindex $mess 4]
! 	set @height  [lindex $mess 5]
! 	set @xmargin [lindex $mess 6]
! 	set @ymargin [lindex $mess 7]
  	if {!$@width} {set @width 85}; if {!$@height} {set @height 60}
  	$self add .$self [list gop toggle -command "$self gop_setting"]
--- 5483,5487 ----
  	set @properties [list "gop" "xfrom" "xto" "yfrom" "yto" "width" "height" "xmargin" "ymargin"]
  	set mess [$of get_mess]
! 	mset [list @xfrom @yfrom @xto @yto @width @height @xmargin @ymargin] $mess
  	if {!$@width} {set @width 85}; if {!$@height} {set @height 60}
  	$self add .$self [list gop toggle -command "$self gop_setting"]
***************
*** 8386,8391 ****
  	if {$selcanvas == ""} {
  		list #X connect \
! 		    [$@canvas index $@from] $@outlet \
! 		    [$@canvas index $@to]   $@inlet
  	} {
  		list #X connect \
--- 8365,8370 ----
  	if {$selcanvas == ""} {
  		list #X connect \
! 		    [$@canvas children_idx $@from] $@outlet \
! 		    [$@canvas children_idx   $@to]  $@inlet
  	} {
  		list #X connect \





More information about the Pd-cvs mailing list