Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

GUI FEATURE

by pavunkumar (Scribe)
on Aug 11, 2009 at 07:59 UTC ( #787521=perlquestion: print w/ replies, xml ) Need Help??
pavunkumar has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I want to know whether perl provides GUI features to the programmers that means will I be able to create a window based application using perl .

Thanks

Comment on GUI FEATURE
Re: GUI FEATURE
by moritz (Cardinal) on Aug 11, 2009 at 08:01 UTC
    Sure it does. There are several GUI toolkits on CPAN which allow you to create GUI windows.
      Have given you a ++ for being as bad as me by actually answering the question asked rather than the extended implied question that everyone else answered ;-)
Re: GUI FEATURE
by dHarry (Abbot) on Aug 11, 2009 at 08:06 UTC
    Yes, for example Perl Tk (the Monastery is full of examples) or wxPerl, see for example Padre, a Perl IDE which makes use of it.
Re: GUI FEATURE
by Marshall (Prior) on Aug 11, 2009 at 08:56 UTC
    I wrote a very short demo for you. This only uses basic things in the Tk module which should already be installed in your Perl installation.

    Click around and you will see what this does (drop down menus that give a snarky comment that this doesn't work!)

    This is an incredibly short amount of code for a GUI!!!!

    Many GUI "builders" spew out hundreds if not thousands of lines of code. Tk can be just "hand coded", like I did below. You will have to learn about the various "geometry managers", most important of which is pack() and what a "frame" is. These placement (geometry) gizmos are basic to all GUI things, you just need to know the rules to use this. There are a number of good books on Perl Tk to get you started.

    BUT YES! Perl can do some very sophisticated GUI stuff!!!

    #!/usr/bin/perl -w use strict; use Tk; #file tkdemo.pl 11 aug 2009 # $mw is normally the variable name for "MainWindow" my $mw = MainWindow->new; $mw->configure(-title=> "Hacking..."); $mw->geometry("400x100+0+0"); my $menu_f = $mw->Frame()->pack(-side=>'top',-fill=>'x'); my $menu_file = $menu_f->Menubutton (-text=>'File',-tearoff=>'false') ->pack(-side=>'left'); my $menu_help = $menu_f->Menubutton (-text=>'Help', -tearoff=>'false', )->pack(-side=>'left'); $menu_file->command(-label=>'Open', -command=> \&you_wish); $menu_help->command(-label=>'Help??!!!', -command=> \&you_wish); sub you_wish { $mw->messageBox ( -title => "Hacking...", -message => "You wished that this option worked!!!", -type => 'Ok' ); } #This starts the GUI "waiting for event loop" MainLoop();
Re: GUI FEATURE
by vinoth.ree (Parson) on Aug 11, 2009 at 09:23 UTC

    I make use of the following link to learn perl Tk with lot of examples.

    Learn Perl Tk

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://787521]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-09-03 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls