fluffyvoidwarrior has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I'm writing a win32 Tk app that loads a window and then carries out some fairly long winded processing without user interaction. I need the processing to start AFTER the gui is drawn so the user can see processing messages as they occur. I need to be able to respond to something like an onload or afterpageload event to trigger my processing subroutine after the window is drawn and not during or before. Thanks again

Replies are listed 'Best First'.
Re: Tk events
by strat (Canon) on Jan 04, 2006 at 09:18 UTC

    Tk::After might be interesting for you.

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Re: Tk events
by zentara (Cardinal) on Jan 04, 2006 at 11:31 UTC
    I think what you are looking for is waitVisibility. Try the script below, with the sleep statement in the different locations. You should see the way to go. Don't forget, that in your long-process without user interaction, you must include frequent $mw->update to update whatever display widgets you have.
    #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; #for(1..3){sleep 1}; #to wait until a $widget is visible, use waitVisibility: $mw->waitVisibility; for(1..3){sleep 1}; MainLoop;

    I'm not really a human, but I play one on earth. flash japh
      Thanks