File: simple3.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 (33 lines) | stat: -rw-r--r-- 567 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
use Gtk;

#TITLE: Simple #3
#REQUIRES: Gtk

init Gtk;

#Gtk->timeout_add(1000, sub { Gtk->gc; return 1; });

#Gtk->gc;
                 
{
	my($window,$button);

$window = new Gtk::Widget	"GtkWindow",
		type			=>	-toplevel,
		title		=>	"hello world",
		allow_grow		=>	0,
		allow_shrink		=>	0,
		border_width	=>	10;
$window->signal_connect('destroy', sub {Gtk->main_quit});

$button = new Gtk::Widget	"Gtk::Button",
		label		=>	"hello world",
		-clicked	=>	sub { destroy $button; destroy $window; },
		parent		=>	$window,
		visible		=>	1;

show $window;
}

main Gtk;