#!/usr/bin/perl -w # $File: //hello_tk.pl $ $Author: mnooning $ # $Revision: #002 $ $Change: 20040303_01 $ $DateTime: 2004/03/03 15:18: ######################################################################## # Copyright 2004 by Malcolm Nooning # This program does not impose any # licensing restrictions on files generated by their execution, in # accordance with the 8th article of the Artistic License: # # "Aggregation of this Package with a commercial distribution is # always permitted provided that the use of this Package is embedded; # that is, when no overt attempt is made to make this Package's # interfaces visible to the end user of the commercial distribution. # Such use shall not be construed as a distribution of this Package." # # Therefore, you are absolutely free to place any license on the resulting # executable(s), as long as the packed 3rd-party libraries are also available # under the Artistic License. # # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # # See L # # # ######################################################################## our $VERSION = 0.01; use POSIX qw (EXIT_SUCCESS EXIT_FAILURE); use Tk; ######################################################################### sub okay_response { my ($we_top) = @_; $we_top->destroy; } ######################################################################### sub say_hello { my $message = "hello"; #............................................. my $okay_button; my $we_top = new MainWindow; $we_top->title("Hello"); $we_top->Label ( -text => $message . "\n", -justify => 'left', )->pack(); #..................................................................... $okay_button = $we_top->Button( -text => 'Okay', -command => [ \&okay_response, $we_top, ] )->pack; #..................................................................... ######### MainLoop; ######### } ######################################################################### say_hello;