I was wondering how to get a file menu working, ive got the basics but cant get the new, open, save and save as working :(. Any ideas? Cheers

i need new to clear a text area, open to create a window which will allow me to open files on my computer that are pl files, and the save to save the text in my textarea on my pc. I dont know how to use gui libraries-sorry

my $mw12= $mw->configure(-menu=> my $menubar = $mw->Menu); my $file = $menubar->cascade(-label =>'~File'); my $help = $menubar->cascade(-label =>'~Help'); my $new = $file ->command(-label=>'New', -underline=>0); my $open = $file ->command(-label=>'Open', -underline=>0); my $save = $file ->command(-label=>'Save', -underline=>0); my $saveas = $file ->command(-label=>'Save As..', -<br>underline=>1); my $exit = $file ->command(-label=>'Exit', -underline=>0, -command =>\ +&exit);

janitored by ybiC: Minor format tweaks, including <code> tags around code snippet


In reply to How to write file menu by hak0983

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.