Still messing with pTk, but decided to try my hand at a simple mail client (more or less, type a message and click send, but still... ;)). Anyway, I just got the shell coded in (very basic), but ran into a problem. I can get the proper variables from the "from" and "title" lines, but I'm stuck on the message itself.
#!/usr/bin/perl use strict; use Tk; my ($from_val, $title_val); my $mail_mw = MainWindow->new(-title => 'E-mail'); # create button frame my $mail_button = $mail_mw->Frame()->pack(-side => 'bottom'); $mail_mw->Label(-text => "From:")->pack(-padx => '1c', -anchor => 'w') +; my $from = $mail_mw->Entry(-textvariable => \$from_val, -width => 32)->pack(); $mail_mw->Label(-text => "Title:")->pack(-padx => '1c', -anchor => 'w' +); my $title = $mail_mw->Entry(-textvariable => \$title_val, -width => 32)->pack(); $mail_mw->Label(-text => "Message:")->pack(-padx => '1c', -anchor => ' +w'); my $message = $mail_mw->Text(-width => 32, -height => 5)->pack(); # buttons my $send = $mail_button->Button(-text => "Send", -command => \&send )->pack(-side => 'left'); my $cancel = $mail_button->Button(-text => "Cancel", -command => sub { $mail_mw->destroy } )->pack(-side => 'left') +; MainLoop; sub send { print "From: $from_val\nTitle: $title_val"; }
The "From" and "Title", if filled out, will print what's in them. I can't however figure out how to display the contents of $message! I know it's something very stupid and obvious, but I'm killing my brain on it =/ Any advice on that?

In reply to pTk -- Text() by FireBird34

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.