[PD-cvs] pd/src desire.tk,1.1.2.64,1.1.2.65

Mathieu Bouchard matju at users.sourceforge.net
Sun Sep 18 11:58:52 CEST 2005


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
.


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.64
retrieving revision 1.1.2.65
diff -C2 -d -r1.1.2.64 -r1.1.2.65
*** desire.tk	18 Sep 2005 09:23:16 -0000	1.1.2.64
--- desire.tk	18 Sep 2005 09:58:49 -0000	1.1.2.65
***************
*** 1202,1220 ****
  class_new textbox {view}
  
! proc text_new {canvas self x y text font color} {
!     .x$canvas.c create text $x $y \
          -font [format -*-courier-medium--normal--%d-* $font] \
!         -tags "${self}TEXT $self" -text $text -fill $color  -anchor nw
!     foreach {x1 y1 x2 y2} [.x$canvas.c bbox ${self}TEXT] {}
! }
! 
! proc text_set {canvas myname text} {
!     .x$canvas.c itemconfigure $myname -text $text
!     foreach {x1 y1 x2 y2} [.x$canvas.c bbox ${myname}] {
! 	.x$canvas.c coords ${myname}_R $x1 $y1 $x2 $y2
!     }
  }
  
! def textbox edit {canvas} {
  	global look font
  	set _($canvas:obj_in_edit_old) $self
--- 1202,1213 ----
  class_new textbox {view}
  
! def textbox draw {canvas} {
!     foreach {x1 y1} [$self xy $canvas] {}
!     item $self $canvas TEXT create text $x1 $y1 \
          -font [format -*-courier-medium--normal--%d-* $font] \
!         -text $text -fill $color -anchor nw
  }
  
! def* textbox edit {canvas} {
  	global look font
  	set _($canvas:obj_in_edit_old) $self
***************
*** 1255,1258 ****
--- 1248,1252 ----
  class_new objectbox {textbox}
  def objectbox init {canvas} {
+ 	global font look
  	set @isnew 1
  	set @inlets 0
***************
*** 1261,1275 ****
  	set @class ""
  	set @text ""
  	$self add $canvas
- }
- 
- def* objectbox update_size {} {
- 	global font
- 	set @xs [expr $font(padx)+$font(width)*([expr [string length $@text]+1]+$@isnew)]
- 	set @ys [expr $font(pady)+$font(height)]
- }
- 
- def objectbox add {canvas} {
- 	global font look
  	if {[info exists _($canvas:selection)]} {
  		if {[info exists _($canvas:obj_in_edit)] && $_($canvas:obj_in_edit)} {
--- 1255,1260 ----
  	set @class ""
  	set @text ""
+ 	set @edit 0
  	$self add $canvas
  	if {[info exists _($canvas:selection)]} {
  		if {[info exists _($canvas:obj_in_edit)] && $_($canvas:obj_in_edit)} {
***************
*** 1287,1294 ****
  	$self update_size
  	$self draw $canvas
! 	$self edit $canvas
  }
  
! def objectbox unedit {canvas} {
  	set c .x$canvas.c
  	set t $c.${self}text
--- 1272,1287 ----
  	$self update_size
  	$self draw $canvas
! 	if {[string length $@text]==0} {$self edit $canvas}
  }
  
! def* objectbox update_size {} {
! 	global font
! 	set @xs [expr $font(padx)+$font(width)*([expr [string length $@text]+1]+$@isnew)]
! 	set @ys [expr $font(pady)+$font(height)]
! }
! 
! def* objectbox unedit {canvas} {
! 	if {!$@edit} {return}
! 	set @edit 0
  	set c .x$canvas.c
  	set t $c.${self}text
***************
*** 1355,1358 ****
--- 1348,1353 ----
  
  #-----------------------------------------------------------------------------------#
+ def* canvas window_title {args} {}
+ 
  def canvas delete_selection {} {
  	foreach obj $@selection {$obj erase}
***************
*** 2048,2052 ****
  	set i 1
  	set class [lindex $d $i]
! 	switch -- $class { obj { set i 4; set class [lindex $d $i] }}
  	if {![info exists _($x:_class)]} {
  		if {[info exists classinfo($class)]} {
--- 2043,2052 ----
  	set i 1
  	set class [lindex $d $i]
! 	switch -- $class {
! 	  obj {
! 		set i 4
! 		set class [lindex $d $i]
! 		set _($x:text) $d
! 	}}
  	if {![info exists _($x:_class)]} {
  		if {[info exists classinfo($class)]} {





More information about the Pd-cvs mailing list