in reply to Updating perl/Tk fluid-like

Spawning events in Perl::Tk is probably better done with Tk::after. This allows them to be spawned at the top of the event loop, avoiding calls like sleep() that will block user input and screen updates to the gui.

For recurring calls, Tk::after offers repeat().

In your case, something like:

$frame->repeat(30000,\&doit); sub doit { &disk_space; &refresh_tally; }
You may also want to offer a refresh button if the user wishes to get the latest stats.

See "perldoc Tk::callbacks" and "perldoc Tk::after" for more info.

Replies are listed 'Best First'.
Re: Re: Updating perl/Tk fluid-like
by Anonymous Monk on May 19, 2001 at 23:18 UTC
    That is exactly what I was after! Thankyou.... Regards, Stacy.