in reply to Re: RFC: Class::Proxy::MethodChain
in thread RFC: Class::Proxy::MethodChain
Personal taste - but I'd have the sub first to keep it like map, grep, et al.
sub apply_chain (&$) { local $_ = $_[1]; $_[0]->(); $_; } my $window = apply_chain { $_->signal_connect(delete => sub { Gtk->exit(0) }); $_->set_title("Test"); $_->border_width(15); $_->add( apply_chain { $_->signal_connect(clicked => sub { Gtk->exit(0) }); $_->show; } Gtk::Button->new("Quit") ); $_->show; } Gtk::Window->new("toplevel");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: RFC: Class::Proxy::MethodChain
by Aristotle (Chancellor) on Feb 26, 2003 at 07:09 UTC | |
by adrianh (Chancellor) on Feb 26, 2003 at 10:29 UTC | |
by Aristotle (Chancellor) on Feb 27, 2003 at 19:35 UTC |
In Section
Meditations