File: simple7.pl

package info (click to toggle)
libgtk-perl 0.7009-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,956 kB
  • ctags: 2,260
  • sloc: perl: 13,998; xml: 9,919; ansic: 2,894; makefile: 64; cpp: 45
file content (47 lines) | stat: -rw-r--r-- 784 bytes parent folder | download
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

use Gnome;

init Gnome "App_id";

#TITLE: Simple #7
#REQUIRES: Gtk Gnome

$app = new Gnome::App "appname", "title";
$app->signal_connect('destroy', sub {Gtk->main_quit});

$button = new Gtk::Button "button";

$button->signal_connect (clicked => sub {
	my($w) = new Gnome::MessageBox "message", "messagebox_type", "button1", "button2";
	$w->signal_connect(clicked => sub {
		print "Button $_[1] clicked\n";
	});
	#$w->set_modal;
	show $w;
});

show $button;

$vbox = new Gtk::VBox 0, 1;
show $vbox;

$vbox->pack_start($button, 1, 1, 1);

eval {
	$calc = new Gnome::Calculator;
	show $calc;
	$vbox->pack_start($calc, 1, 1, 1);
};

eval {
	$date = new Gnome::DateEdit time(), 1, 0;
	show $date;
	$vbox->pack_start($date, 1, 1, 1);
};

$app->set_contents($vbox);

show $app;

main Gtk;