in reply to Re: Win32::SysTray Issue ( Win32::GUI::DoEvents )
in thread Win32::SysTray Issue
Hello Anon Monk
I modified your code:
This is a smaller version from the larger program...a series of user inputs etc. When I run the above code it waits for an input....while I'm waiting for the input I would like to exit the program by clicking on the icon. That's what I'm trying to do....it works fine using your random number example. Thanks in advance.#!/usr/bin/perl -- use strict; use warnings; use Win32::SysTray; sTray( @ARGV ); exit( 0 ); sub sTray { my $tray = new Win32::SysTray ( 'icon' => 'C:\images\logo.ico' , 'single' => 1, ) or exit 0; $tray->setMenu ( "> &Test" => sub { print "Hello from the Tray\n"; }, ">-" => 0, "> E&xit"=> sub { exit; }, ); begin( $tray ); } sub begin { my( $tray ) = @_; die "user quit" if -1 == Poke( $tray ); } #~ sub Win32::SysTray::Poke { sub Poke { my( $tray ) = @_; print "\nWhat is your name? "; chomp(my $name=<STDIN>); print "\nHello $name\n\n"; Win32::GUI::DoEvents(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32::SysTray Issue ( Win32::GUI::DoEvents )
by jcb (Parson) on Oct 19, 2020 at 23:46 UTC | |
by PilotinControl (Pilgrim) on Oct 21, 2020 at 01:14 UTC | |
by jcb (Parson) on Oct 21, 2020 at 01:23 UTC | |
by PilotinControl (Pilgrim) on Oct 21, 2020 at 02:15 UTC | |
by jcb (Parson) on Oct 21, 2020 at 21:08 UTC | |
by PilotinControl (Pilgrim) on Oct 20, 2020 at 02:56 UTC | |
by jcb (Parson) on Oct 21, 2020 at 01:16 UTC | |
by PilotinControl (Pilgrim) on Oct 21, 2020 at 19:36 UTC | |
|
Re^3: Win32::SysTray Issue ( readline )
by Anonymous Monk on Oct 20, 2020 at 00:13 UTC |