• rtext

    From Mark Summerfield@m.n.summerfield@gmail.com to comp.lang.tcl on Thu Dec 4 10:12:56 2025
    From Newsgroup: comp.lang.tcl

    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.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Thu Dec 4 11:28:14 2025
    From Newsgroup: comp.lang.tcl

    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
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Thu Dec 4 20:42:56 2025
    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
  • From saito@saitology9@gmail.com to comp.lang.tcl on Fri Dec 5 20:44:45 2025
    From Newsgroup: comp.lang.tcl

    On 12/4/2025 11:42 PM, et99 wrote:

    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.

    I have seen the slowdown issue as well. When you have a large string,
    the wait can easily exceed 30 seconds in some cases.

    Is your work-around applicable to text widgets too? It sounds like you
    have implemented it for the console only.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From et99@et99@rocketship1.me to comp.lang.tcl on Sat Dec 6 13:03:34 2025
    From Newsgroup: comp.lang.tcl

    On 12/5/2025 5:44 PM, saito wrote:
    On 12/4/2025 11:42 PM, et99 wrote:

    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.

    I have seen the slowdown issue as well.  When you have a large string, the wait can easily exceed 30 seconds in some cases.

    Is your work-around applicable to text widgets too?  It sounds like you have implemented it for the console only.


    Yes, this workaround is only for the console. The console does a text widget "see" operation for each line output. If you were sending lots of debug output, e.g. 100's of lines quickly, then the console text widget would get 100's of see operations. These are likely queued up somehow, perhaps as an event. This would freeze the console. By limiting the number by using an after 100, I was able to have this done at most 10 times a second.

    Another workaround that also helps is to do an update after each puts to the console.

    -e

    --- Synchronet 3.21a-Linux NewsLink 1.2