The changes I made based on your suggestions did not work...I do have the changes in the correct places right? Thanks for the help.
::ANSIScreen;
use Win32::Console;
use Win32::SysTray;
no warnings 'numeric';
$| = 1; # ADDED
tray();
begin();
sub begin { # START BEGIN
print "-------------------------------------------\n";
print "Please Choose One of the Following Options:\n";
print "-------------------------------------------\n\n\n";
print "(1) EMPLOYEE MANAGEMENT \n\n";
print "(Q) QUIT \n\n";
print " \n\n\n\n";
my $input = Prompt("? "); # ADDED
if ($input){
if ( $input == 1 ){
sleep(3);
begin();
}
if ( $input eq "q" ) {
sleep 3;
exit;
}
} # END INPUT
} # END BEGIN
sub tray {
my $stray = new Win32::SysTray (
'name' => 'TEST',
'icon' => 'C:\images\logo.ico',
'single' => 1,
) or exit 0;
$stray->setMenu (
"> &Test" => sub { print "Hello from the Tray\n"; },
">-" => 0,
"> E&xit" => sub { exit; },
);
}
sub Prompt {
my $prompt = shift;
print "\n$prompt ";
my $response = '';
my $rsel = ''; my $rrdy;
vec($rsel,fileno(STDIN),1) = 1;
CHAR: while (1) {
die "user quit" if -1 == Win32::GUI::DoEvents();
while (select($rrdy=$rsel, undef, undef, 0.10)) {
sysread(STDIN, $response, 1, length $response)
== 1 or die "read error";
}
last CHAR if chomp($response);
}
return $response;
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|