- labels: 104343 --> 18. [text]
- assigned_to: nobody --> cc_benny
I have come across a problem with Tk-text widgets for Tk>8.4, i.e the new improved widgets.
Up to and including 8.4.x, text widgets took a long single logical line and handled it quite gracefully. 8.5 or 8.6 gets stuck really quickly. This code snippet will illustrate:
<begin code>
package require Tk
font create dnafont -family [font actual courier -family] -size 11
text .t -yscrollcommand {.s set} -font dnafont -width 60 -wrap char -setgrid true
scrollbar .s -command {.t yview}
pack .s -side right -fill y
pack .t -side left -fill both -expand 1
set insertion "ACGT"
set data $insertion
for { set i 1 } { $i <= 5000 } { incr i } {
append data $insertion
} # create a mock sequence of 20000 bases (long, but not terribly long)
.t insert 0.0 $data
<end code>
Under 8.4 the window is reasonably responsive, under 8.5 it is a dead dog. This difference is not there under Windows.
Tested using Tcl/Tk 8.5.3 and 8.6. Have used two different Macs, both PPC, running OS X 10.4.11.
Looking at the platform-specific TkAqua code, it looks as if the whole thing is being passed off to system code in MeasureStringChars and ATSUBreakLine. I have been readin some of the old discussion on this area before posting and it seems as if there is a serious performance problem with ATSUBreakLine when faced with this kind of problem.
I posted this on tcl-mac and was asked to post it as a bug here for the attention of 'benny' (Benjamin Riefenstahl).