in reply to Re^3: Perl Tk unable to return from MainLoop when implemented in a subroutine
in thread Perl Tk unable to return from MainLoop when implemented in a subroutine

Can you enlighten me on how I can use dialog box to do the same purpose? :P

I wanted to use dialog to do this, but could not find any code example on how :(. If can do this with dialog box it would be great!

  • Comment on Re^4: Perl Tk unable to return from MainLoop when implemented in a subroutine

Replies are listed 'Best First'.
Re^5: Perl Tk unable to return from MainLoop when implemented in a subroutine ( tk dialogbox without toplevel mainwindow mainloop)
by Anonymous Monk on Mar 24, 2016 at 01:56 UTC
    #!/usr/bin/perl -- use strict; use warnings; use Tk; my $omw = tkinit(); $omw->withdraw; ## no show my $theword ; my $mw = $omw->Dialog( -textvariable => \$theword ); $mw->transient(undef); ## let dialog show even if MainWindow withdrawn for my $ix ( 1..3 ){ $theword = "bird " x $ix; print join ' ', scalar(gmtime ), $mw->Show, ## "MainLoop" "\n"; sleep 1; }