[PD-cvs] pd/src desire.tk,1.1.2.600.2.35,1.1.2.600.2.36

Mathieu Bouchard matju at users.sourceforge.net
Thu Dec 7 20:34:24 CET 2006


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

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
added def Canvas margin, and stuff


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.35
retrieving revision 1.1.2.600.2.36
diff -C2 -d -r1.1.2.600.2.35 -r1.1.2.600.2.36
*** desire.tk	7 Dec 2006 17:55:05 -0000	1.1.2.600.2.35
--- desire.tk	7 Dec 2006 19:34:20 -0000	1.1.2.600.2.36
***************
*** 1196,1210 ****
  	if {$@canvas == ""} {return [list $@x1 $@y1]}
  	if {[$@canvas gop] && ![winfo exists .$@canvas.c]} {
! 		set mess [$@canvas get_mess]
! 		set xmargin [lindex $mess 6]
! 		set ymargin [lindex $mess 7]
  		mset {x y} [$@canvas xy]
! 		set cx [expr {($@x1-$xmargin)+$x}]
! 		set cy [expr {($@y1-$ymargin)+$y}]
  	} else {
! 		set cx $@x1
! 		set cy $@y1
  	}
- 	return [list $cx $cy]
  }
  
--- 1196,1205 ----
  	if {$@canvas == ""} {return [list $@x1 $@y1]}
  	if {[$@canvas gop] && ![winfo exists .$@canvas.c]} {
! 		mset {xmargin ymargin} [$@canvas margin]
  		mset {x y} [$@canvas xy]
! 		list [expr {($@x1-$xmargin)+$x}] [expr {($@y1-$ymargin)+$y}]
  	} else {
! 		list $@x1 $@y1
  	}
  }
  
***************
*** 1260,1263 ****
--- 1255,1259 ----
  
  def View draw_maybe {} {
+ #	if {$@canvas == "" && [winfo exists .$self.c]} {$self draw; return}
  	if {$@canvas == "" && [winfo exists .$self.c]} {$self draw; puts "   here is another draw"}
  	if {[$self class] == "Canvas" && $@canvas == ""} {return}
***************
*** 1384,1389 ****
  
  proc menu_opentext {filename} {
!     global doc_number pd_myversion
!     set w [format ".help%d" $doc_number]
      toplevel $w
      wm title $w $filename
--- 1380,1384 ----
  
  proc menu_opentext {filename} {
!     set w [format ".help%d" $::doc_number]
      toplevel $w
      wm title $w $filename
***************
*** 1400,1409 ****
      	set bigstring [read $f 1000]
  	regsub -all PD_BASEDIR $bigstring $::pd_guidir bigstring
!     	regsub -all PD_VERSION $bigstring $pd_myversion bigstring
      	$w.1.text insert end $bigstring
      }
      $w.1.text configure -state disabled
      close $f
!     incr doc_number
      return $w
  }
--- 1395,1404 ----
      	set bigstring [read $f 1000]
  	regsub -all PD_BASEDIR $bigstring $::pd_guidir bigstring
!     	regsub -all PD_VERSION $bigstring $::pd_myversion bigstring
      	$w.1.text insert end $bigstring
      }
      $w.1.text configure -state disabled
      close $f
!     incr ::doc_number
      return $w
  }
***************
*** 1571,1574 ****
--- 1566,1571 ----
  }
  
+ # doesn't this look like Canvas deconstruct ?
+ # why does @mess_len even exist ?
  def Canvas get_mess {} {
  	if {$@mess_len != 11} {
***************
*** 1580,1583 ****
--- 1577,1584 ----
  }
  
+ def Canvas margin {} {
+ 	return [list $@xmargin $@ymargin]
+ }
+ 
  def Canvas gop {} {return $@gop}
  def Canvas abs {} {return $@abs}
***************
*** 1632,1649 ****
  
  def Canvas delete_window {} {
- 	global window_list
  	set wl {}
! 	foreach w $window_list {if {$w != $self} {lappend wl $w}}
! 	set window_list $wl
  	destroy .$self
  }
  
  def Canvas delete {} {
! 	global window_list
! 	set wl {}
! 	foreach w $window_list {if {$w != $self} {lappend wl $w}}
! 	set window_list $wl
  	super
! 	destroy .$self
  	if {$@gop} {foreach x $@children {$x changed}; $self changed}
  }
--- 1633,1646 ----
  
  def Canvas delete_window {} {
  	set wl {}
! 	foreach w $::window_list {if {$w != $self} {lappend wl $w}}
! 	set ::window_list $wl
  	destroy .$self
  }
  
  def Canvas delete {} {
! 	$self delete_window
  	super
! 	# the following line doesn't make any sense, does it?
  	if {$@gop} {foreach x $@children {$x changed}; $self changed}
  }
***************
*** 4916,4921 ****
  	set @old_val $@val
  	set @mouse [list $x $y]
! 	pd .$self set $@val
! 	pd .$self bang
  	$self changed
  }
--- 4913,4917 ----
  	set @old_val $@val
  	set @mouse [list $x $y]
! 	netsend [list .$self float $@val] ;# noserial
  	$self changed
  }
***************
*** 4955,4959 ****
  	set x2 [expr $x1+$xs]
  	set y2 [expr $y1+$ys]
- 	#set c [$@canvas widget]
  	set c [[$self get_canvas] widget]
  	set ins  [expr [string compare $@rcv empty]==0]
--- 4951,4954 ----
***************
*** 5675,5685 ****
  }
  
! set dir $cmdline(icons)
! foreach icon {mode_edit mode_run pd} {
! 	image create photo icon_$icon -file $dir/$icon.gif
! }
! foreach b $butt {
! 	mset {icon name cmd} $b
! 	image create photo icon_$icon -file $dir/$icon.gif
  }
  
--- 5670,5682 ----
  }
  
! if {$tk} {
! 	set dir $cmdline(icons)
! 	foreach icon {mode_edit mode_run pd} {
! 		image create photo icon_$icon -file $dir/$icon.gif
! 	}
! 	foreach b $butt {
! 		mset {icon name cmd} $b
! 		image create photo icon_$icon -file $dir/$icon.gif
! 	}
  }
  
***************
*** 7501,7506 ****
  	#	if {![catch {load $file}]} {puts "found tclreadline !"}
  	#}
! 	#::tclreadline::Loop
! 	#proc ::tclreadline::prompt1 {} {return "desire> "}
  	#while {1} {
  	#	#set line [::tclreadline::readline read]
--- 7498,7504 ----
  	#	if {![catch {load $file}]} {puts "found tclreadline !"}
  	#}
! 	package require tclreadline
! 	proc ::tclreadline::prompt1 {} {return "desire> "}
! 	::tclreadline::Loop
  	#while {1} {
  	#	#set line [::tclreadline::readline read]





More information about the Pd-cvs mailing list