Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5407
Modified Files: Tag: devel_0_39 desire.tk Log Message: fix to completionbox
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.521 retrieving revision 1.1.2.522 diff -C2 -d -r1.1.2.521 -r1.1.2.522 *** desire.tk 20 Oct 2006 00:37:01 -0000 1.1.2.521 --- desire.tk 21 Oct 2006 00:52:09 -0000 1.1.2.522 *************** *** 1907,1910 **** --- 1907,1914 ---- }
+ def TextBox text {} { + return $@text + } + def TextBox update_size {} { global font *************** *** 1921,1928 **** #set width [$self look fontwidth];set height [$self look fontheight] if {[winfo exists $c.${self}text]} { ! set height [expr [lindex [$t configure -height] 4] * \ ! [font metrics [$self look font] -linespace]] ! } else { ! set height [expr [font metrics [$self look font] -linespace] * $nl] } #set height [expr [font metrics [$self look font] -linespace] * $nl] --- 1925,1932 ---- #set width [$self look fontwidth];set height [$self look fontheight] if {[winfo exists $c.${self}text]} { ! set height [expr [lindex [$t configure -height] 4] * \ ! [font metrics [$self look font] -linespace]] ! } else { ! set height [expr [font metrics [$self look font] -linespace] * $nl] } #set height [expr [font metrics [$self look font] -linespace] * $nl] *************** *** 1932,1946 **** set textwidth [expr (($x2 - $x1)/[$@canvas zoom])+$padx] } - #if {[llength [$c gettags ${self}text]]} { catch { - #set n [expr [string length [$c.${self}text get 1.0 1.end]] -1] set n [expr [string length [$c.${self}text get $@longline.0 $@longline.end]] -1] - #mset {x1 y1 w h} [$c.${self}text bbox 1.$n] mset {x1 y1 w h} [$c.${self}text bbox $@longline.$n] set textwidth [expr ($padx + $x1 + ($w * 2)+$padx+2) / [$@canvas zoom]] ! } - #} - #set textwidth [expr $font(padx)+$font(width)*($n+$@edit)] set iowidth [$self look iowidth] set topwidth [expr (2* $@ninlets-1) * $iowidth] --- 1936,1947 ---- set textwidth [expr (($x2 - $x1)/[$@canvas zoom])+$padx] } catch { set n [expr [string length [$c.${self}text get $@longline.0 $@longline.end]] -1] mset {x1 y1 w h} [$c.${self}text bbox $@longline.$n] set textwidth [expr ($padx + $x1 + ($w * 2)+$padx+2) / [$@canvas zoom]] ! # this might work better...... ! #set textwidth [expr [string length [$c.${self}text get $@longline.0 $@longline.end]] * $w \ ! # + $padx*2] } set iowidth [$self look iowidth] set topwidth [expr (2* $@ninlets-1) * $iowidth] *************** *** 5483,5488 **** set @height [$canvas look showcomp]} else {set @height 20} listbox $f -width $@width -height $@height -relief flat \ ! -bg [$canvas look compbg] -selectbackground [$canvas look compselectbg] \ ! -activestyle dotbox -selectforeground [$canvas look compselectfg] -fg [$canvas look compfg] \ -font $look(View:font) $self adjust_box --- 5484,5489 ---- set @height [$canvas look showcomp]} else {set @height 20} listbox $f -width $@width -height $@height -relief flat \ ! -bg [$canvas look bgedit] -selectbackground [$canvas look fg] \ ! -activestyle dotbox -selectforeground [$canvas look bgedit] -fg [$canvas look fg] \ -font $look(View:font) $self adjust_box *************** *** 5575,5579 **** switch $self { browser {$self fill_box [$@textbox get]} ! completion {$self adjust_box} } } --- 5576,5580 ---- switch $self { browser {$self fill_box [$@textbox get]} ! completion {$self adjust_box; $@textself resize; $@textself changed} } } *************** *** 5605,5608 **** --- 5606,5610 ---- if {[focus] == $@textbox & $key != "Tab"} { $self adjust_box + $@textself resize #hum, no idea why i need after 1 for it to work... after 1 $@textself after_key $@textbox