in reply to Give me my gui back!

I'm scratching my head wondering why nobody mentioned just replacing MainLoop() entirely? Yeah, I guess you have to sort of turn your code kind of inside out, but:
while (1) { if ($Quit) { $MW->destroy; last; } DoOneEvent($Running ? Tk::DONT_WAIT : Tk::ALL_EVENTS); iterate() if ($Running); save_is_active( 1 ) if (!$Running && !$SaveButtonActive); }
If iterate() is particularly long, you still need to spice with the occasional DoOneEvent (I did anyway). The inspiration for this came out of some of the sample code. -- Fred m3047 Morris

Replies are listed 'Best First'.
Yet another good idea.
by Bagarre (Sexton) on Nov 19, 2003 at 13:47 UTC

    This one would work well but, if I have to stick DoOneEvent's thru the routine, I'm back to putting ->update...

    I've narrowed my problem down to a few particular subroutines in particular situations and, for that, I can use fork(). Those routines only return true or false anyway so, the pipe would be simple :)

    So, I guess my problem wasnt as terrible as I thought it was.

    Thanks to all for the help with this. It's been a great learning experience for me! Not too sure if Tk is my cup of tea tho. Seems like a lot of work just for a user to click a button and watch the dancingteddy bear while the program does what it used to do from the command line ;)

    Cheers,
    -David