#!/usr/bin/perl -w
use strict;
use Gtk2 -init;

sub callback { my ($widget) = @_;
	print 'Hello again - '.$widget->get_label."($widget) was pressed.\n";
}

my $window = Gtk2::Window->new;
$window->set_title('Hello Buttons');
$window->set_border_width(10);

$window->signal_connect(delete_event => sub {
	Gtk2->main_quit;
	return 0;
});

my $box = Gtk2::HBox->new(0, 0);
$window->add($box);

my $button1 = Gtk2::Button->new('Button1');
$button1->signal_connect(clicked => sub { callback @_ });
$box->pack_start($button1, 1, 1, 0);

my $button2 = Gtk2::Button->new('Button2');
$button2->signal_connect(clicked => sub { callback @_ });
$box->pack_start($button2, 1, 1, 0);

$window->show_all;

Gtk2->main;
