in reply to Re^2: Perk Tk - how to send a value from a subroutine back to the main program using Button
in thread Perk Tk - how to send a value from a subroutine back to the main program using Button

Yeah, see Re: Perk Tk - how to send a value from a subroutine back to the main program using Button (without MainLoop), see what MainLoop does is this
sub MainLoop { unless ($inMainLoop) { local $inMainLoop = 1; while (Tk::MainWindow->Count) { DoOneEvent(0); } } }

You move the mouse, its an event (a bunch)

You click a button, its an event

Nothing happens for a few miliseconds, its an event

If you use Tk::Wizard then each page you add, each wizard step, is like a separate MainLoop, and then returning a value can be possible (you can write procedural code), see the examples

  • Comment on Re^3: Perk Tk - how to send a value from a subroutine back to the main program using Button
  • Download Code

Replies are listed 'Best First'.
Re^4: Perk Tk - how to send a value from a subroutine back to the main program using Button
by jeri_rl (Initiate) on Jun 11, 2013 at 18:13 UTC

    Thanks. As you can see in the thread, I've got it working using references. However, looks like I should check out Tk::Wizard. Can you recommend an introduction or tutorial? I'm afraid I find the CPAN listings only useful if you already have an idea what you are doing.