-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuilder.pl
More file actions
43 lines (33 loc) · 1.13 KB
/
Copy pathbuilder.pl
File metadata and controls
43 lines (33 loc) · 1.13 KB
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
#!/usr/bin/perl
#
# Builder
# Demonstrates an interface loaded from a XML description.
#
# Perl version by Dave M <dave.nerd@gmail.com>
# with patches from Thierry Vignaud <thierry.vignaud@gmail.com>
use strict;
use warnings;
use Gtk3 '-init';
use File::Basename 'dirname';
my $builder = Gtk3::Builder->new();
$builder->add_from_file(dirname($0) . '/demo.ui');
my $window = $builder->get_object('window1');
$builder->connect_signals(undef);
$window->set_screen( $window->get_screen() );
$window->signal_connect( destroy => sub { Gtk3->main_quit } );
$window->show_all();
Gtk3->main();
sub about_activate {
my $about_dialog = $builder->get_object('aboutdialog1');
$about_dialog->run();
$about_dialog->hide();
}
sub quit_activate {
my $action = shift;
my $window = $builder->get_object('window1');
$window->destroy;
}
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.