#!/usr/local/bin/perl -w
use strict;
use Tk;
my $mw = new MainWindow;
$mw->Label(-text => 'Hello World!')->pack;
$mw->Button(-text => 'Quit',
-command => sub{exit} )->pack;
MainLoop;
| [reply] [d/l] |
use Tk;
This will import nearly everything you would ever want.
If you want more information, this is a wide subject, and can't be answered in pages upon pages of threads. You will have questions -- and more questions -- and more questions, and we'll be here all week trying to answer them all. I suggest getting a good book on the subject (Mastering Perl/Tk: ISBN ISBN 1565927168) or perhaps Googling for "Perl/Tk" and reading online documentation . As with anything, Perl/Tk is really easy once you know how :)
Also, by searching the monastery, you'll find tons of Perl/Tk questions and answers already answered. Read up on them: SuperSearch
| [reply] [d/l] |
To add to that...
Once you have Tk on your machine there is a great widget demonstration program called widget that you can use. This demonstration can be usually called from the command line.
It is a great working demonstration and lets you take a look at the Perl/Tk code for many widgets.
As always, it is important to get the book and read, read, and read some more!
Have fun learning!!!!! I know I have.
| [reply] |
Check out Visual Camel on Sourceforge
Visual Camel is a WYSIWYG Perl/Tk GUI builder that allows you to create a ready to run perl script. It is pretty easy to use also! | [reply] |