June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,8 +1,9 @@
use GTK::Simple;
use GTK::Simple::App;
my GTK::Simple::App $app .= new(title => 'GUI component interaction');
$app.set_content(
$app.set-content(
my $box = GTK::Simple::VBox.new(
my $value = GTK::Simple::Entry.new(text => '0'),
my $increment = GTK::Simple::Button.new(label => 'Increment'),
@ -10,8 +11,8 @@ $app.set_content(
)
);
$app.size_request(400, 100);
$app.border_width = 20;
$app.size-request(400, 100);
$app.border-width = 20;
$box.spacing = 10;
$value.changed.tap: {
@ -19,14 +20,14 @@ $value.changed.tap: {
}
$increment.clicked.tap: {
$value.text += 1;
my $val = $value.text; $val += 1; $value.text = $val.Str
}
$random.clicked.tap: {
# Dirty hack to work around the fact that GTK::Simple doesn't provide
# access to GTK message dialogs yet :P
if run «zenity --question --text "Reset to random value?"» {
$value.text = (^100).pick;
$value.text = (^100).pick.Str
}
}