Friday, November 24, 2006

[perl] Popup window

# written by vaibhav gupta
use Gtk2 '-init';
$x=100;$y=100; #default Cordinates
$blue = 0xffff ;
$label = "Hello there";
$label = $ARGV[0] if $ARGV[0];
$delay = 5 ;
$delay = $ARGV[1] if $ARGV[1];
$x = $ARGV[2] if $ARGV[2];
$y = $ARGV[3] if $ARGV[3];
$blue = $ARGV[4] if $ARGV[4] ;

sub usages {
        print "\n $ARGV[0] <label> <delay> <x> <y> <color>\n";

$window = Gtk2::Window->new("popup");
$window->signal_connect( destroy => sub {Gtk2->main_quit}) ;
$label = Gtk2::Label->new($label);
$label->modify_fg('normal',Gtk2::Gdk::Color->new(0,0,$blue) );
Glib::Idle->add( sub { Gtk2->main_quit; 0 } );
print `sleep $delay`;


Inder said...


I've got a quick question.

I am running Windows 7 in 64 bit mode, and I get an error when I try to run your code.

I have a bit of familiarity with Perl but I am not familiar with what does.

Could you put a bit of an explanation of your code please?

I'd really appreciate it.

guptav said...

This won't work on windows...
I suggest you to switch to Linux (ubuntu 9.10) ... you will thank me later...


cialis said...

Hello, I do not agree with the previous commentator - not so simple

Palm Pixi Plus Verizon Only Cell Phone with WebOS, Touch Screen said...

nice post