From Newsgroup: comp.lang.tcl
On 12/4/2025 2:28 AM, Harald Oehlmann wrote:
Am 04.12.2025 um 11:12 schrieb Mark Summerfield:
Is rtext likely to be in Tcl/Tk 9.1?
In https://core.tcl-lang.org/tips/doc/trunk/tip/466.md
the Tcl-Version is 9.1, but it also has Vote: Pending.
As Wizard Francois Vogel left, there is currently no supporter.
Francois wrote, that the implementation is "Wizard style" and to genious to understand.
Csaba tested it and was in favor.
Paul uses it in a productive manner.
The widget is ready and available as an extension.
It solves the issue, that the current text widget may freeze for a long time (10 seconds) to do eliding, e.g. if the widget is resized and there is a lot of thext in.
I often see this with the console on Windows.
If it is full and I resize it, the application freezes for around 10 seconds.
Any support is appreciated !
Harald
Hi Harald,
I am a big user of the windows console. I can't say that I've ever used the eliding attribute on text in the console, but I did some time ago find a satisfactory solution to slow output, especially if I dump a lot of debug. That's when I too would see the 10 seconds of freeze time.
The key was to optimize the code that does a .console see operation on each output. Here's my test code where I fine tuned that behavior. This also sets the maxlines to 100k and has a button to dump out 5000 lines. Initially, it will be slow, but if you check the faster checkbox it will improve quite a bit.
console eval {
set ::tk::console::maxLines 100000
set ::tk::console::toggle 1
proc ::tk::ConsoleSeeOutput {} {
.console see insert
set ::tk::console::seecount 0
}
proc ::tk::ConsoleOutput {dest string} {
set count 25
set w .console
$w insert output $string $dest
::tk::console::ConstrainBuffer $w $::tk::console::maxLines
if { $::tk::console::toggle } { ;# check button toggle for testing speed up
$w see insert ;# this is standard console
return
}
incr ::tk::console::seecount
if { $::tk::console::seecount < $count} {
$w see insert
} elseif { $::tk::console::seecount == $count } {
after 100 ::tk::ConsoleSeeOutput
}
}
}
button .b1 -command doit -text doit-5000
button .b2 -command doit10 -text doit-10
button .c -command doit2 -text goto-end
checkbutton .t -command doit3 -text faster
pack .b1 .b2 .c .t
proc doit {args} {
for {set m 0} {$m < 5000} {incr m} {
puts "[incr ::line] - [string repeat x 70]"
}
puts ""
}
proc doit10 {args} {
for {set m 0} {$m < 10} {incr m} {
puts "[incr ::line] - [string repeat x 70]"
}
puts ""
}
proc doit2 {args} {
console eval {after 250 .console see end; .console mark set insert end; after 100 {focus -force .console}}
}
proc doit3 {args} {
console eval {set ::tk::console::toggle [expr { 1-$::tk::console::toggle }]}
}
console show
-et
--- Synchronet 3.21a-Linux NewsLink 1.2