in reply to Understanding callbacks
Have a look at Tk::UserGuide for examples of how a gui uses callbacks.
The first example is this :-
#!/usr/bin/perl -w use Tk; use strict; my $mw = MainWindow->new; $mw->Label(-text => 'Hello, world!')->pack; $mw->Button( -text => 'Quit', -command => sub { exit }, )->pack; MainLoop;
The program sets up the gui then calls MainLoop and never returns, only when the user clicks on the button will the callback -command get called.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Understanding callbacks
by stevieb (Canon) on Jun 14, 2015 at 20:46 UTC |