in reply to Understanding Tk::DialogBox
What you are looking to do is create callback functions. These are subroutines that are executed when the button is pressed.
For example:
See how the function exit is the command that is executed when the button is pressed?my $button1 = $mw->Button(-text => 'Quit', -command => \&exit);
You may also supply other subroutines to be called:
my $button2 = $mw->Button(-text => 'Quit', -command => \&my_sub); sub my_sub { print "Someone clicked me!\n"; }
There's a large number of Getting Started with Perl/Tk sites out there, and a number of books, too.
Hope this helped,
|
|---|