in reply to multiple method calls against the same object, revisited
In Perl 6 that's probably written like this:
Though I could see extending the but operator to take a topicalized closure so we don't have to put the ugly $_ at the end:given Gtk2::Window.new( "toplevel" ) { .signal_connect( :delete{ Gtk2.main_quit } ); .set_title( "Test" ); .border_width( 15 ); .add( given Gtk2::Button.new( "Quit" ) { .signal_connect( :clicked{ Gtk2.main_quit } ); $_; } ); .show_all; }
Merry Christmas!!!Gtk2::Window.new( "toplevel" ) but { .signal_connect( :delete{ Gtk2.main_quit } ); .set_title( "Test" ); .border_width( 15 ); .add( Gtk2::Button.new( "Quit" ) but { .signal_connect( :clicked{ Gtk2.main_quit } ); } ); .show_all; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: multiple method calls against the same object, revisited
by Aristotle (Chancellor) on Dec 25, 2004 at 23:26 UTC | |
Re^2: multiple method calls against the same object, revisited
by gaal (Parson) on Dec 25, 2004 at 19:27 UTC | |
by Aristotle (Chancellor) on Dec 28, 2004 at 09:57 UTC |
In Section
Snippets Section