• "update idletasks" doesn't seem to do anything on macOS with tk 9.0.1

    From Eric Brunel@21:1/5 to All on Tue Mar 4 14:58:14 2025
    Hello all,

    I have an installation of tcl/tk 9.0.1 compiled from source on a mac mini
    with macOS 13.2, and I found out something quite weird: it seems that
    "update idletasks" has no effect at all on this platform, when it works as expected on Windows and Linux.

    Here is a script showing the problem:

    -----------------------------------
    ttk::progressbar .pbar -mode determinate -value 0 -length 300
    pack .pbar -side top -padx 8 -pady 8

    proc compute { x0 } {
    set x $x0
    while { $x > 1 } {
    if { $x % 2 == 0 } {
    set x [expr $x / 2]
    } else {
    set x [expr 3 * $x + 1]
    }
    }
    }

    proc run {} {
    . configure -cursor watch
    update idletasks
    for { set i 0 } { $i < 100 } { incr i } {
    for { set j 0 } { $j < 500 } { incr j } {
    compute [expr $i + 1000]
    }
    .pbar configure -value $i
    update idletasks
    }
    . configure -cursor ""
    }

    ttk::button .btn -text "Go!" -command run
    pack .btn -side bottom -padx 8 -pady 8
    -----------------------------------

    If I run this on Windows or Linux, I can see the progress bar being
    updated after I click the "Go!" button. If I do the same on macOS, the
    window is stuck in its initial state, and the display is updated only when everything is finished.

    Note that the problem strangely does not happen when the computation is replaced by a "after 100" for example. In this case, the display is
    updated. But the script is actually doing something, it doesn't seem to
    work. Replacing "update idletasks" with just "update" works, but
    sometimes, you just don't want to handle pending events.

    Can anybody confirm they have the same issue? I'd like to be sure it's not something in my build that causes the problem before creating a ticket.

    Thanks!
    --
    Eric

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Gravereaux@21:1/5 to All on Wed Mar 5 05:58:45 2025
    That's a nice find. I wish I has something constructive to say. Do
    make a ticket


    --
    David Gravereaux <davygrvy@pobox.com>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nab@21:1/5 to All on Wed Mar 5 15:21:31 2025
    Eric Brunel <eric.brunel@pragmadev.com> posted:

    Hello all,

    I have an installation of tcl/tk 9.0.1 compiled from source on a mac mini with macOS 13.2, and I found out something quite weird: it seems that
    "update idletasks" has no effect at all on this platform, when it works as expected on Windows and Linux.

    Here is a script showing the problem:

    -----------------------------------
    ttk::progressbar .pbar -mode determinate -value 0 -length 300
    pack .pbar -side top -padx 8 -pady 8

    proc compute { x0 } {
    set x $x0
    while { $x > 1 } {
    if { $x % 2 == 0 } {
    set x [expr $x / 2]
    } else {
    set x [expr 3 * $x + 1]
    }
    }
    }

    proc run {} {
    . configure -cursor watch
    update idletasks
    for { set i 0 } { $i < 100 } { incr i } {
    for { set j 0 } { $j < 500 } { incr j } {
    compute [expr $i + 1000]
    }
    .pbar configure -value $i
    update idletasks
    }
    . configure -cursor ""
    }

    ttk::button .btn -text "Go!" -command run
    pack .btn -side bottom -padx 8 -pady 8
    -----------------------------------

    If I run this on Windows or Linux, I can see the progress bar being
    updated after I click the "Go!" button. If I do the same on macOS, the
    window is stuck in its initial state, and the display is updated only when everything is finished.

    Note that the problem strangely does not happen when the computation is replaced by a "after 100" for example. In this case, the display is
    updated. But the script is actually doing something, it doesn't seem to
    work. Replacing "update idletasks" with just "update" works, but
    sometimes, you just don't want to handle pending events.

    Can anybody confirm they have the same issue? I'd like to be sure it's not something in my build that causes the problem before creating a ticket.

    Thanks!

    Hi,
    according to the doc there's no -configure option for ttk::progressbar

    ++

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric Brunel@21:1/5 to nab on Wed Mar 5 16:04:16 2025
    On Wed, 05 Mar 2025 15:21:31 GMT, nab wrote:

    Eric Brunel <eric.brunel@pragmadev.com> posted:

    Hello all,

    I have an installation of tcl/tk 9.0.1 compiled from source on a mac
    mini with macOS 13.2, and I found out something quite weird: it seems
    that "update idletasks" has no effect at all on this platform, when it
    works as expected on Windows and Linux.

    Here is a script showing the problem:

    -----------------------------------
    ttk::progressbar .pbar -mode determinate -value 0 -length 300 pack
    .pbar -side top -padx 8 -pady 8

    proc compute { x0 } {
    set x $x0 while { $x > 1 } {
    if { $x % 2 == 0 } {
    set x [expr $x / 2]
    } else {
    set x [expr 3 * $x + 1]
    }
    }
    }

    proc run {} {
    . configure -cursor watch update idletasks for { set i 0 } { $i < 100
    } { incr i } {
    for { set j 0 } { $j < 500 } { incr j } {
    compute [expr $i + 1000]
    }
    .pbar configure -value $i update idletasks
    }
    . configure -cursor ""
    }

    ttk::button .btn -text "Go!" -command run pack .btn -side bottom -padx
    8 -pady 8 -----------------------------------

    If I run this on Windows or Linux, I can see the progress bar being
    updated after I click the "Go!" button. If I do the same on macOS, the
    window is stuck in its initial state, and the display is updated only
    when everything is finished.

    Note that the problem strangely does not happen when the computation is
    replaced by a "after 100" for example. In this case, the display is
    updated. But the script is actually doing something, it doesn't seem to
    work. Replacing "update idletasks" with just "update" works, but
    sometimes, you just don't want to handle pending events.

    Can anybody confirm they have the same issue? I'd like to be sure it's
    not something in my build that causes the problem before creating a
    ticket.

    Thanks!

    Hi,
    according to the doc there's no -configure option for ttk::progressbar

    ++

    I'm using the "configure" sub-command on the progress bar to change its
    value, I'm not using a "-configure" option... And I did test the script
    several times, on 2 versions of macOS as well as on Windows and Linux, it
    does work, and shows the problem on macOS.

    If you just copy and paste the code from my original post, I'm sure you'll
    see that it does work.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric Brunel@21:1/5 to David Gravereaux on Wed Mar 5 15:56:48 2025
    On Wed, 5 Mar 2025 05:58:45 -0800, David Gravereaux wrote:

    That's a nice find. I wish I has something constructive to say. Do
    make a ticket

    Done. Thanks for the confirmation!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Eric Brunel on Wed Mar 5 13:15:22 2025
    FWIW, on my windows 8.6.9 when I copy/paste it into a console it works, except that the cursor doesn't change to the watch. If I change the update idletasks to just update, then that works as well.




    On 3/5/2025 8:04 AM, Eric Brunel wrote:
    On Wed, 05 Mar 2025 15:21:31 GMT, nab wrote:

    Eric Brunel <eric.brunel@pragmadev.com> posted:

    Hello all,

    I have an installation of tcl/tk 9.0.1 compiled from source on a mac
    mini with macOS 13.2, and I found out something quite weird: it seems
    that "update idletasks" has no effect at all on this platform, when it
    works as expected on Windows and Linux.

    Here is a script showing the problem:

    -----------------------------------
    ttk::progressbar .pbar -mode determinate -value 0 -length 300 pack
    .pbar -side top -padx 8 -pady 8

    proc compute { x0 } {
    set x $x0 while { $x > 1 } {
    if { $x % 2 == 0 } {
    set x [expr $x / 2]
    } else {
    set x [expr 3 * $x + 1]
    }
    }
    }

    proc run {} {
    . configure -cursor watch update idletasks for { set i 0 } { $i < 100 >>> } { incr i } {
    for { set j 0 } { $j < 500 } { incr j } {
    compute [expr $i + 1000]
    }
    .pbar configure -value $i update idletasks
    }
    . configure -cursor ""
    }

    ttk::button .btn -text "Go!" -command run pack .btn -side bottom -padx
    8 -pady 8 -----------------------------------

    If I run this on Windows or Linux, I can see the progress bar being
    updated after I click the "Go!" button. If I do the same on macOS, the
    window is stuck in its initial state, and the display is updated only
    when everything is finished.

    Note that the problem strangely does not happen when the computation is
    replaced by a "after 100" for example. In this case, the display is
    updated. But the script is actually doing something, it doesn't seem to
    work. Replacing "update idletasks" with just "update" works, but
    sometimes, you just don't want to handle pending events.

    Can anybody confirm they have the same issue? I'd like to be sure it's
    not something in my build that causes the problem before creating a
    ticket.

    Thanks!

    Hi,
    according to the doc there's no -configure option for ttk::progressbar

    ++

    I'm using the "configure" sub-command on the progress bar to change its value, I'm not using a "-configure" option... And I did test the script several times, on 2 versions of macOS as well as on Windows and Linux, it does work, and shows the problem on macOS.

    If you just copy and paste the code from my original post, I'm sure you'll see that it does work.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)