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();

In reply to Re: GUI FEATURE by Marshall
in thread GUI FEATURE by pavunkumar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.