BEGIN { push @INC, '.'; } use strict; use warnings; use Gtk2 '-init'; use Foo; my $window = Gtk2::Window->new('toplevel'); my $foo = Foo->new(); $foo->set_text ('hello world'); $window->add ($foo); $window->show_all; my $req = $foo->size_request(); print "main: size ",$req->width,"x",$req->height,"\n"; Gtk2->main(); exit 0;