/usr/share/doc/libgtk2-notify-perl/examples/replace-widget.pl is in libgtk2-notify-perl 0.05-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | #!/usr/bin/perl
use strict;
use warnings;
use Gtk2::Notify -init, 'Replace Widgets';
my $win = Gtk2::Window->new;
$win->show;
$win->signal_connect(destroy => sub { Gtk2->main_quit });
my $button = Gtk2::Button->new('Click here to change notification');
$button->show;
$win->add($button);
my $n = Gtk2::Notify->new(
'Widget Attachment Test',
'Button has not been clicked yet',
'',
$button,
);
$n->set_category('presence.online');
$n->set_timeout(0);
$button->signal_connect(clicked => \&clicked_cb, $n);
my $exposed_signal_id = $button->signal_connect(expose_event => \&exposed_cb, $n);
Gtk2->main;
sub exposed_cb {
my ($button, $event, $n) = @_;
$button->signal_handler_disconnect($exposed_signal_id);
$n->show;
}
my $count = 0;
sub clicked_cb {
my ($button, $n) = @_;
$count++;
$n->update(
'Widget Attachment Test',
"You clicked the button $count times"
);
$n->show;
}
|