If what you want is to put little dialogs windows in various places and then continue after they are handled, then that is easy. Here is something adapted from some code I am working on right now:
That code will run.#!/usr/bin/perl -w use strict; use warnings; use Tk; my $mw = MainWindow->new(); $mw->withdraw(); my $ftp_warn = $mw->messageBox( -title => 'Silly message', -message => "We are displaying a silly message, do you wish to conti +nue?", -type => 'YesNo', -icon => 'question', ); if ( $ftp_warn eq 'No' ) { exit; } else { my $msg2 = $mw->messageBox( -title => 'Really?', -message => "We displayed silly message and you wish to continue?" +, -type => 'OK', -icon => 'question', ); exit; }
Now if you were to replace the else clause with a call to a function, then you can execute other code. This is naturally quite trivial, because in a Tk application you will have some sort of user interface that appears in the MinWindow (the $mw that I hid with the $mw->withdraw method call) whioch will direct what is to be done.
Tk is a very useful GUI tool, there are a number of heavy Tk users here in the Monastery. You will find it explained in the docs or you could look at Mastering Perl/Tk" by Lidie and Walsh published by O'Reilly.
In reply to Re: Perl Tk-How to return from 'MainLoop'
by jdtoronto
in thread Perl Tk-How to return from 'MainLoop'
by herby1620
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |