Jump to content

Simple windowed application: Difference between revisions

→‎{{header|Perl 6}}: Added Perl 6 implementation
(→‎{{header|ooRexx}}: significantly shortened)
(→‎{{header|Perl 6}}: Added Perl 6 implementation)
Line 1,365:
$ID{txt}->value = ++$clicks
});</lang>
 
=={{header|Perl 6}}==
{{libheader|GTK}}
<lang perl6>use GTK::Simple;
 
my GTK::Simple::App $app .= new(title => 'Simple Windowed Application');
 
$app.size_request(350, 100);
 
$app.set_content(
GTK::Simple::VBox.new(
my $label = GTK::Simple::Label.new( text => 'There have been no clicks yet'),
my $button = GTK::Simple::Button.new(label => 'click me')
)
);
 
$app.border_width = 40;
 
$button.clicked.tap({
state $clicks += 1;
$label.text = "There has been $clicks click"
~ ($clicks > 1 ?? 's' !! '');
});
 
$app.run;</lang>
 
=={{header|PicoLisp}}==
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.