[PD-cvs] pd/src desire.tk,1.1.2.457,1.1.2.458

chunlee chunlee at users.sourceforge.net
Tue Sep 5 18:36:40 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
attempts on fixing the subpatch window open/close. 


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.457
retrieving revision 1.1.2.458
diff -C2 -d -r1.1.2.457 -r1.1.2.458
*** desire.tk	4 Sep 2006 14:23:27 -0000	1.1.2.457
--- desire.tk	5 Sep 2006 16:36:37 -0000	1.1.2.458
***************
*** 1000,1003 ****
--- 1000,1005 ----
  def View  motion {x y f target} {}
  
+ def View subpatch {} {if {[info exists @subpatch]} {return 1} else {return 0}}
+ 
  def View look {k} {
  	global look look_cache
***************
*** 1108,1112 ****
  def View canvas  {}  {return $@canvas}
  def View canvas= {c} {set @canvas $c}
- 
  #-----------------------------------------------------------------------------------#
  
--- 1110,1113 ----
***************
*** 1114,1118 ****
  
  def Canvas close {} {
!   if {$@subpatch} {pd .$self close; return}
    switch [tk_messageBox -message [say save_changes?] -icon question -type yesnocancel -default cancel] {
      yes    {$self save; pd .$self close}
--- 1115,1119 ----
  
  def Canvas close {} {
! 	if {$@subpatch} {pd .$self close; after 10 $self delete; set @mapped 0; return}
    switch [tk_messageBox -message [say save_changes?] -icon question -type yesnocancel -default cancel] {
      yes    {$self save; pd .$self close}
***************
*** 1272,1286 ****
      set @wires {}
      set @wires_pair {} ;# stores wires in the format of {0 1 1 0} id {1 1 2 0} id
!     $self init_window
!     $self new_menubar
!     $self new_binds
      #set @wire_hilite {}
      set @history $history
!     $self update_title
      $self subscribe $manager
      $self changed
      #$self canvas= $self ;#!@#$ EEVIL
      #not sure if init should be calling pd, but it fixes the editmode bug for now -chun
!     pd .$self editmode $@editmode
      set @coords 0
      set @jump 0
--- 1273,1285 ----
      set @wires {}
      set @wires_pair {} ;# stores wires in the format of {0 1 1 0} id {1 1 2 0} id
!     if {$@mapped} { $self make_window}
      #set @wire_hilite {}
      set @history $history
!     #$self update_title
      $self subscribe $manager
      $self changed
      #$self canvas= $self ;#!@#$ EEVIL
      #not sure if init should be calling pd, but it fixes the editmode bug for now -chun
!     #pd .$self editmode $@editmode
      set @coords 0
      set @jump 0
***************
*** 1293,1299 ****
      set @keynav_tab_sel "wire"
      set @copy_count 0
!     set @crosshair [Crosshair new $self]
!     set @active [Active new $self]
!     $self editmode= 0
  }
  
--- 1292,1298 ----
      set @keynav_tab_sel "wire"
      set @copy_count 0
!     #set @crosshair [Crosshair new $self]
!     #set @active [Active new $self]
!     #$self editmode= 0
  }
  
***************
*** 1313,1319 ****
  		set @name ""
  		set @mapped 1
- 		puts "mapped = $@mapped"
  	  }
! 	  2 {set @subpatch 1; mset {@name @mapped} $args; set @fontsize "what?"}
  	  default {error "wrong number of arguments (expecting 5 or 6, got [expr 4+[llength $args]])"}
          }
--- 1312,1323 ----
  		set @name ""
  		set @mapped 1
  	  }
! 	  2 {
! 		  set @subpatch 1
! 		  set @name [lindex $args 0 ]
! 		  set @mapped [lindex $args 1]
! 		  #set @mapped $@mapped
! 		  set @fontsize "what?"
! 	  }
  	  default {error "wrong number of arguments (expecting 5 or 6, got [expr 4+[llength $args]])"}
          }
***************
*** 1344,1348 ****
--- 1348,1364 ----
  		set @ymargin [lindex $mess 10]
  	    }
+ 	    11 {
+ 		    puts "MESS ==== $mess"
+        		set @gop [lindex $mess 9]
+ 		set @goprect 1y
+ 		set @xmargin [lindex $mess 9]
+ 		set @ymargin [lindex $mess 10]
+ 		puts "$self is a gop :::: $@gop"
+ 		puts "xymargin:::: $@xmargin || $@ymargin"
+ 		puts "x1 :: $@coordsx1 y1:: $@coordsy1"
+ 		puts "x2 :: $@coordsx2 y2:: $@coordsy2"
+ 	    }
            }
+ 	  
  	}
        }
***************
*** 1354,1357 ****
--- 1370,1387 ----
  }
  
+ 
+ def Canvas make_window {} {
+     $self init_window
+     $self new_menubar
+     $self new_binds
+     $self update_title
+     set @crosshair [Crosshair new $self]
+     set @active [Active new $self]
+     $self editmode= 0
+ 
+ }
+ 
+ def Canvas getscroll {} {}
+ 
  def Canvas init_window {} {
      global bar
***************
*** 1605,1609 ****
  
  def Canvas draw {} {
! 	if {$@subpatch} {super} ;# is for the [pd] box if applicable
  	if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]}
  	[$self widget] configure -background $bg
--- 1635,1640 ----
  
  def Canvas draw {} {
! 	if {$@subpatch && $@canvas != ""} { super} ;# is for the [pd] box if applicable
! 	if {!$@mapped} {return}
  	if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]}
  	[$self widget] configure -background $bg
***************
*** 1817,1823 ****
  
  #-----------------------------------------------------------------------------------#
! def Canvas name=   {name}    {set @name   $name  ; $self update_title}
! def Canvas folder= {folder}  {set @folder $folder; $self update_title}
  def Canvas make_title {} {
  	if {$@subpatch} {
  		if {$@canvas == "" || 0==[string compare $@canvas $self]} {
--- 1848,1855 ----
  
  #-----------------------------------------------------------------------------------#
! def Canvas name=   {name}    {if {!$@mapped} {return}; set @name   $name  ; $self update_title}
! def Canvas folder= {folder}  {if {!$@mapped} {return}; set @folder $folder; $self update_title}
  def Canvas make_title {} {
+ 	if {!$@mapped} {return}
  	if {$@subpatch} {
  		if {$@canvas == "" || 0==[string compare $@canvas $self]} {
***************
*** 2456,2463 ****
  		return
  	}
  	set c [$self widget]
  	focus $c
  	set @click_at [list $x $y]
! 	mset {type id detail} $target
  	if {$f&8} {$self popup $id [winfo pointerx $c] [winfo pointery $c]; return}
  	if {!$@editmode} {if {[llength $id]} {$id click $x $y $f $target}; return}
--- 2488,2512 ----
  		return
  	}
+ 	mset {type id detail} $target
+ 	if {[info exists @subpatch]} {
+ 		if {$@subpatch} {
+ 		puts "$self is a subpatch and is mapped --> $@mapped"
+ 			if {!$@mapped} {
+ 			set @mapped 1
+ 			$self make_window
+ 			$self redraw
+ 			return
+ 			} else {
+ 				set c [$self widget]
+ 				focus $c
+ 				return
+ 			}
+ 	       	}
+ 	} else { 
  	set c [$self widget]
  	focus $c
+ 	}
  	set @click_at [list $x $y]
! 	
  	if {$f&8} {$self popup $id [winfo pointerx $c] [winfo pointery $c]; return}
  	if {!$@editmode} {if {[llength $id]} {$id click $x $y $f $target}; return}
***************
*** 2467,2471 ****
  	  outlet {set @action [FutureWire new $self $x $y $f $target]; return}
  	  inlet {}
! 	  object {$self selection+= $id; set @action edit}
  	  wire {
  	    #$self deselect_all
--- 2516,2523 ----
  	  outlet {set @action [FutureWire new $self $x $y $f $target]; return}
  	  inlet {}
! 	  object {
! 		  if {[$id subpatch]} {puts "$id could be a subpatch"}
! 		  $self selection+= $id; set @action edit
! 	  }
  	  wire {
  	    #$self deselect_all





More information about the Pd-cvs mailing list