Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > need help finding a pop up example

Reply
Thread Tools

need help finding a pop up example

 
 
ToddAndMargo@gbis.com
Guest
Posts: n/a
 
      09-30-2006
Hi All,

I am a bit new to Perl. (My experience is with Modula2
and Linux bash script.)

I need to write a win32 Perl program that will 1) pop up
a windows with a message to the user, 2) only appear in the
task bar when it pops up, and 3) blink (read: annoy the user)
its block on the task bar until the user dismisses the
message.

Can some kind person point me to an appropriate
example? (I love all the examples, but am a bit
overwhelmed by the quantity of them!)


Many thanks,
--T

 
Reply With Quote
 
 
 
 
zentara
Guest
Posts: n/a
 
      09-30-2006
On 29 Sep 2006 21:34:45 -0700, wrote:

>Hi All,
>
> I am a bit new to Perl. (My experience is with Modula2
>and Linux bash script.)
>
> I need to write a win32 Perl program that will 1) pop up
>a windows with a message to the user, 2) only appear in the
>task bar when it pops up, and 3) blink (read: annoy the user)
>its block on the task bar until the user dismisses the
>message.
>
> Can some kind person point me to an appropriate
>example? (I love all the examples, but am a bit
>overwhelmed by the quantity of them!)
>Many thanks,
>--T


First, I don't use windows, but.....

Check out Win32::GUI::NotifyIcon.

Here is a script (not written by me ). I think I saw this
on http://perlmonks.org
It may help you get started.


#!/usr/bin/perl
use warnings;
use strict;

#The function name is defined as "Win32::GUI::NotifyIcon".
#You will need to be carefull about the order of your sub...
#Here a sample script to let's you see, just choose a nice win32 ico and
#name it god.ico in the same dir from where you will launch this script:
#---------------

BEGIN{
use Win32::Console;
Win32::Console::Free();
}

use Win32::GUI;
use Tk;

$mw = MainWindow -> new;
$mw -> wm('geometry', '0x0+0+0');
$mw->overrideredirect(1);
&do_win32_stuff;
MainLoop;

#--------------------------------

sub do_win32_stuff{

$mw_win32 = new Win32::GUI:ialogBox(
-width => 0,
-height => 0,
-name => 'MainWindow');

$icon = new Win32::GUI::Icon('god.ico');

new Win32::GUI::NotifyIcon(
$mw_win32,
-name => "Notify",
-id => 1,
-icon => $icon,
-tip => "I\'am in the Systray!");

$call = Win32::GUI:ialog();

$mw_win32->Notify->Delete(-id => 1);

sub Notify_Click{
&my_menu;
}
}

#--------------------------------

sub my_menu{
$popup = $mw->Menu(Name => 'popupMenu', -tearoff => 0);
$popup->command(-label => 'Number 1',-command => [\&do_label,1] );
$popup->command(-label => 'Number 2',-command => [\&do_label,2]);
$popup->separator;
$popup->command(-label => 'Number 3', -command => [\&do_label,3]);
$popup->command(-label => 'Number 4', -command => [\&do_label,4]);
$popup->command(-label => 'Number 5', -command => [\&do_label,5]);
$popup->separator;
$popup->command(-label => 'Quit', -command => [ \&stop]);
$popup->Popup(-popover => 'cursor', -popanchor => 'nw');
}

#--------------------------------

sub stop{
exit;
}

#--------------------------------

sub do_label{
if(Exists($top)){
$label-> configure(-text => "I\'am $_[0]");
} else {
$top = $mw ->Toplevel;
$top->title(" Numbers");
$top->focus;
$label = $top->Label (-text => "I\'am $_[0]",
-relief => 'groove',
-width => '24')->pack;
}
}
__END__





--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help finding a pithy corouting example Dave Thomas Ruby 2 11-09-2008 04:46 PM
Need help finding which RAM i need for my notebook Piper Computer Support 4 01-01-2007 05:31 AM
How to do server-side processing and then display pop-up with pop-up blocker enabled domtam@hotmail.com ASP .Net 2 02-04-2006 06:03 PM
pop up prevention problem; for wanted pop ups joe doe Firefox 2 03-03-2005 08:08 AM
Pop-up to Buy Pop-up software William Young Computer Support 4 01-24-2004 12:28 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57