#1571 Update idletasks does not redraw labels, Mac Aqua

obsolete: 8.4.4
closed-fixed
7
2004-03-31
2003-09-29
Tom Goddard
No

The "update idletasks" command does not redraw changed
label
text in Aqua Tk 8.4.4. Although this is not required
behaviour it
is the suggested use of "update idletasks" described in
the Tcl
update manual page.

"If the idletasks keyword is specified as an argument
to the command, then no new events or errors are
processed; only idle callbacks are invoked. This causes
operations that are normally deferred, such as display
updates and window layout calculations, to be performed
immediately.

The update idletasks command is useful in scripts where
changes have been made to the application's state and
you want those changes to appear on the display
immediately, rather than waiting for the script to
complete. Most display updates are performed as idle
callbacks, so update idletasks will cause them to run."

The following example,

label .l -text "hello"
.l configure -text {making progress} ; update idletasks
; for {set i 0} {$i<10000000} {incr i} {}

does not redraw the label under Aqua Tk until after the
for loop
terminates. On Linux, Windows, SGI and HP Alpha the redraw
occurs before the for loop terminates. We use "update
idletasks"
to provide progress messages during time consuming
operations.

Discussion

  • Donal K. Fellows

    • priority: 5 --> 7
     
  • Jim Ingham

    Jim Ingham - 2003-09-30
    • status: open --> open-fixed
     
  • Jim Ingham

    Jim Ingham - 2003-09-30

    Logged In: YES
    user_id=169107

    On Mac OS 9 we didn't implement XSync - it was not needed since
    drawing was not buffered. On MacOS X we need to implement the
    sync because the windows ARE all double-buffered, and without it
    the window buffers aren't flushed till we run the event loop.

    I just checked in a simple XSync that loops over the Tk windows
    and flushes them all. With this, update idletasks works properly.

     
  • Jim Ingham

    Jim Ingham - 2003-10-24
    • status: open-fixed --> closed-fixed
     
  • Nobody/Anonymous

    Logged In: NO

    The example needs a "pack .l" right after the label is created.

    With that change, the bug still exists in 8.4.5.
    The toplevel window does resize immediately to fit the new text
    but the new text is not drawn until the for loop ends.

    Tom Goddard

     
  • Don Porter

    Don Porter - 2004-03-31
    • labels: 394429 --> 66. Aqua Window Operations
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks