Monks, I am trying to create a process that receives notifications from other servers and displays them on a monitor GUI. Using a Tk GUI from within a perl script seemed the easiest way of bringing this about, so for the first cut I thought I'd try out the mediachange example given in the "Mastering Perl/Tk" O'Reilly book (Chapter 19). ( The server pops up a MessageBox on every message received. )
First, the error message :
D:\messaging>msgsrvr2.pl
xxx.xx.com (10.156.6.45) : hi
Free to wrong pool 1d1f228 not 222770 at D:/Perl/site/lib/Tk/MainWindo
+w.pm line
55, <GEN1> line 1.
The subroutine that deals with the Tk part:
sub client_connect {
# Process a client connect - send our client either an "Ok" or
# "Cancel" string, depending upon how the media change went.
my($ns, $from) = @_;
chomp( $_ = <$ns> );
my $mw = MainWindow->new;
$mw->withdraw;
$mw->bell;
$mw->repeat(15 * 1000 => sub {$mw->bell});
my $reply = $mw->messageBox(
-icon => 'info',
-type => 'OKCancel',
-message => "$from\n\n$_",
-wraplength => '6i',
-title => 'mediachanged',
-background => '#ECFFFF',
);
print $ns "$reply\n";
close $ns;
exit;
} # end client_connect
I am running WinXP. I have ActivePerl 5.8 and ActiveTcl 8.4.6.1 installations. Any ideas ? Is there another forum to pose this question ?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.