Simple windowed application: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) (→{{header|ooRexx}}: significantly shortened) |
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Added Perl 6 implementation) |
||
Line 1,365: | Line 1,365: | ||
$ID{txt}->value = ++$clicks |
$ID{txt}->value = ++$clicks |
||
});</lang> |
});</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}}== |
=={{header|PicoLisp}}== |