FireBird34 has asked for the wisdom of the Perl Monks concerning the following question:
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pTk -- Text()
by pg (Canon) on Apr 03, 2003 at 04:55 UTC |