File: demo_inherit.pl

package info (click to toggle)
libgtk-perl 0.1.17-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,352 kB
  • ctags: 1,100
  • sloc: ansic: 4,393; perl: 3,463; makefile: 36
file content (30 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (2)
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

use Gtk;

package mywindow;

@ISA = qw(Gtk::Window);

sub new {
	my($class) = @_;
	my($self) = new Gtk::Window('toplevel');
	$self->set_title("a mywindow");
	$self->{"george"} = "bill";
	bless $self, $class;
}

package main;

init Gtk;

$window = new mywindow;

$button = new Gtk::Button "hello";
signal_connect $button "clicked", sub { print "Hello\n" };
$window->add($button);
$button->can_default(1);
$button->grab_default();
$button->show();
show $window;

main Gtk;