artist has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks
This is not exactly perl question per se, but it will involve perl as that is my language.
I like to design something similar to MSNBC newsalert and like to supply my own data from various sources. The part of the application that I am looking for is flashing system try icon or a small pop-up window which can inform me about various alerts such as 'server down' or 'email received from the boss' or 'new node on perlmonks matching this regex'.

I see lot of usefulness in this application. Looking for design issues in terms of framework and technology, and which modules from CPAN can be useful etc..

Thanks
artist

ps. If this is not the right forum to ask, I would suggest the "Application Design" section on perlmonks.

Replies are listed 'Best First'.
Re: Alerts Display
by zentara (Cardinal) on Jan 20, 2003 at 13:47 UTC
    Here is a nice tk popup that might fit the situation.
    #!/usr/bin/perl # test prg for notifiction window use Tk; use strict; my $mw_bdw = 2; #mainwindow border width ### Create a Mainwindow ### my $main = new MainWindow(-borderwidth=>$mw_bdw, -relief=>'ridge', -bg => "#0000FF"); $main->geometry("150x100+0+0"); # displaying at top left on any resolu +tion $main->overrideredirect(1); # Remove window decorations ### create a text widget ### my $imstr = "THIS IS A TEST NOTIFICTION LONG ENOUGH TO WRAP"; my $TEXT = $main->Text( -foreground=> 'white', -background=> '#0000FF', -wrap => 'word', -height => 7, -width => 50)->pack; $TEXT->insert('end', "$imstr", ); $main-> after(5000, \&exitprg); # autoclose in 5000 milisecs MainLoop; # for continuos display of window #### FUNCTIONS #### sub exitprg { print STDERR "CALLED EXIT\n"; $main-> destroy; # to kill the window and exit from prog }
Re: Alerts Display
by dbush (Deacon) on Jan 20, 2003 at 10:13 UTC

    If the platform is Windows, ActiveState have something called PerlTray which might be useful. They describe it as:

    The PerlTray utility converts a Perl program to a native Windows system tray application. It runs as an icon in the system tray and responds to external events. It displays a tooltip when the mouse hovers over the icon and displays a popup menu when the user clicks on the icon. PerlTray features tray icon animation, timer callbacks and asynchronous file download and application execution.

    The only problem is that you will need to buy the Perl Dev Kit.

    Cheers,
    Dom.

      No need to buy anything. wxPerl has support for trayicons on windows (although somewhat limited it's got all you want).

      If that's not good enough, such an application is somewhat trivial to create, so we can always roll a open source solution (1).

      update: How do you toggle the system tray icon using Win32::Gui? is yet another perl way of doing something like that.


      MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
      ** The Third rule of perl club is a statement of fact: pod is sexy.

Re: Alerts Display
by Louis_Wu (Chaplain) on Jan 20, 2003 at 07:46 UTC

    Question: what Operating System? If it's Mac OS X, you might want to look at Elian's Chatter Box client, which "properly bounces when your username is mentioned" - it uses Camel Bones. If it's not Mac OS X, I don't know where to point you, sorry.