Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > ba6d2dcddc17b6fbc086f4a2ed794eee > files > 24

perl-Gtk2-Notify-0.05-11.fc15.i686.rpm

#!/usr/bin/perl

use strict;
use warnings;
use Glib qw( TRUE FALSE );
use Gtk2::Notify -init, 'Replace';

my $n = Gtk2::Notify->new('Summary', 'First message');
$n->set_timeout(0);

$n->show;

Glib::Timeout->add(3000, \&replace, $n);
Gtk2->main;

sub replace {
    my ($n) = @_;

    $n->update('Second Summary', 'First mesage was replaced');
    $n->set_timeout(-1);

    $n->show;

    Gtk2->main_quit;
}