Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Messager

by TStanley (Canon)
on Sep 14, 2004 at 16:21 UTC ( [id://390894]=sourcecode: print w/replies, xml ) Need Help??
Category: Win32 Stuff
Author/Contact Info Thomas Stanley
Description: The Net::Send module wrapped with a simple Tk interface
#!perl -w
use strict;
use Tk;
use Win32::NetSend;

my $NS=Win32::NetSend->new();

my $Main=new MainWindow;
my $menu=$Main->Menubutton(-text=>'File',-menuitems=>[['command'=>'Exi
+t',-command=>\&Exit]])->grid;
my $un=$Main->Label(-text=>'User Name:');
my $user=$Main->Entry(-width=>40);
$un->grid($user);
my $MsgLbl=$Main->Label(-text=>'Message:');
my $mesg=$Main->Entry(-width=>40);
$MsgLbl->grid($mesg);
my $SndBtn=$Main->Button(-text=>'Send',-command=>sub{Send_Msg($user,$m
+esg)});
my $ClrBtn=$Main->Button(-text=>'Clear',-command=>sub{Clear()});
my $ExtBtn=$Main->Button(-text=>'Exit',-command=>sub{ Exit()});
$SndBtn->grid($ExtBtn,$ClrBtn);
MainLoop;

sub Send_Msg{
  my($user,$message)=@_;
  my $u=$user->get;
  my $m=$message->get;
  $NS->Send(to=>$u,message=>$m);
}

sub Clear{
  $user->delete(0,'end');
  $mesg->delete(0,'end');
  $user->focus;
}

sub Exit{
    exit 0;
}
Replies are listed 'Best First'.
Re: Messager
by Discipulus (Canon) on Sep 15, 2004 at 08:01 UTC
    funny but how emulate carriage return in NetSend ??

    cheers Discipulus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://390894]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found