Vacant
[mirrors/Programs.git] / perl / gtk2 / glade / builder.pl
CommitLineData
21c4e167
H
1#!/usr/bin/env perl
2# Sample Gtk2-Perl Glade app
3# check http://code.google.com/p/camelbox/ for running on windows
4
5use strict;
6use warnings;
7use utf8;
8use Gtk2 qw{ -init };
9
10my $builder = Gtk2::Builder->new();
11$builder->add_from_file( "sample.builder" );
12
13my %widgets;
14foreach my $widget qw(window1 label1 entry1)
15{
16 $widgets{$widget}=$builder->get_object($widget);
17}
18
19$builder->connect_signals( undef );
20$builder = undef;
21
22$widgets{'window1'}->show();
23
24Gtk2->main();
25exit;
26
27
28sub on_button1_clicked
29{
30 $widgets{'label1'}->set_text($widgets{'entry1'}->get_text());
31 print 'Label1 text set to: '.$widgets{'label1'}->get_text()."\n";
32}
33
34
35sub cb_destroy
36{
37 Gtk2->main_quit();
38}
This page took 0.651383 seconds and 4 git commands to generate.