/usr/share/doc/libgnome2-gconf-perl/examples/simple-view.pl is in libgnome2-gconf-perl 1.044-6+b1.
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
# Copyright (C) 1999, 2000 Red Hat Inc.
# Copyright (C) 2003 Emmanuele Bassi <emmanuele.bassi@iol.it>
# A very simple program that monitors a single key for changes.
use strict;
use warnings;
use Gtk2;
use Gnome2::GConf;
Gtk2->init;
my $client = Gnome2::GConf::Client->get_default;
my $window = Gtk2::Window->new('toplevel');
$window->signal_connect(delete_event => sub { $_[0]->destroy; });
$window->signal_connect(destroy => sub { Gtk2->main_quit; });
my $str = $client->get_string("/extra/test/directory/key");
my $label = Gtk2::Label->new($str ? $str : "<unset>");
$window->add($label);
$client->add_dir("/extra/test/directory", 'preload-none');
$client->notify_add("/extra/test/directory/key", sub {
my ($client, $cnxn_id, $entry, $label) = @_;
if (not ($entry->{value}))
{
$label->set_text('<undef>');
}
elsif ($entry->{value}->{type} eq 'string')
{
$label->set_text($entry->{value}->{value});
}
else
{
$label->set_text('<wrong type>');
}
}, $label);
$window->show_all;
Gtk2->main;
0;
|