Re: "update idletasks" doesn

Liste des GroupesRevenir à cl tcl 
Sujet : Re: "update idletasks" doesn
De : et99 (at) *nospam* rocketship1.me (et99)
Groupes : comp.lang.tcl
Date : 05. Mar 2025, 22:15:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqaetb$2jbkv$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
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.
 

Date Sujet#  Auteur
4 Mar 25 * "update idletasks" doesn't seem to do anything on macOS with tk 9.0.16Eric Brunel
5 Mar 25 +* Re: "update idletasks" doesn't seem to do anything on macOS with tk 9.0.12David Gravereaux
5 Mar 25 i`- Re: "update idletasks" doesn't seem to do anything on macOS with tk 9.0.11Eric Brunel
5 Mar 25 `* Re: "update idletasks" doesn3nab
5 Mar 25  `* Re: "update idletasks" doesn2Eric Brunel
5 Mar 25   `- Re: "update idletasks" doesn1et99

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal