Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2923
Modified Files: Tag: devel_0_39 desire.tk Log Message: fixed object text entry bug
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.391 retrieving revision 1.1.2.392 diff -C2 -d -r1.1.2.391 -r1.1.2.392 *** desire.tk 21 Aug 2006 11:20:52 -0000 1.1.2.391 --- desire.tk 21 Aug 2006 17:21:35 -0000 1.1.2.392 *************** *** 1638,1642 **** if {$@edit} { set t .$@canvas.c.${self}text ! $t configure -width [expr [string length [$t get 0.0 end]]+1] } { $self item TEXT text [l+ {2 2} [list $x1 $y1]] \ --- 1638,1642 ---- if {$@edit} { set t .$@canvas.c.${self}text ! $t configure -width [string length [$t get 0.0 end]] } { $self item TEXT text [l+ {2 2} [list $x1 $y1]] \ *************** *** 1688,1692 **** def TextBox after_key {widget} { $widget configure -state normal - #set @text [$widget get 1.0 1.end] $self update_size $self changed --- 1688,1691 ---- *************** *** 1696,1702 **** global font set n [string length $@text] - catch {set n [string length [.$@canvas.c.${self}text get 1.0 1.end]]} set textwidth [expr $font(padx)+$font(width)*($n+$@edit)] ! #set textwidth [expr $font(padx)+$font(width)*([string length $@text]+$@edit)] set topwidth [expr (2* $@ninlets-1) * [look iowidth]] set bottomwidth [expr (2*$@noutlets-1) * [look iowidth]] --- 1695,1705 ---- global font set n [string length $@text] set textwidth [expr $font(padx)+$font(width)*($n+$@edit)] ! catch { ! set n [expr [string length [.$@canvas.c.${self}text get 1.0 1.end]] -1] ! mset {x1 y1 w h} [.$@canvas.c.${self}text bbox 1.$n] ! set textwidth [expr ($font(padx) + $x1 + ($w * 2)) / [$@canvas scale]] ! } ! #set textwidth [expr $font(padx)+$font(width)*($n+$@edit)] set topwidth [expr (2* $@ninlets-1) * [look iowidth]] set bottomwidth [expr (2*$@noutlets-1) * [look iowidth]] *************** *** 1704,1719 **** set @ys [expr $font(pady)+$font(height)] } - - def* TextBox update_size2 {} { - global font - set @textwidth [expr $font(padx)+$font(width)*([string length $@text]+$@edit)] - set @topwidth [expr (2* $@ninlets-1) * [look iowidth]] - set @bottomwidth [expr (2*$@noutlets-1) * [look iowidth]] - set @xs [max [look minobjwidth] [max $@bottomwidth [max $@topwidth $@textwidth]]] - set @ys [expr $font(pady)+$font(height)] - } - - - #-----------------------------------------------------------------------------------
--- 1707,1710 ----