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?#!/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"; }
In reply to pTk -- Text() by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |