Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Last active June 30, 2018 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/78914f5253e0dac19eef5418074315bf to your computer and use it in GitHub Desktop.
Save zoffixznet/78914f5253e0dac19eef5418074315bf to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use GTK::Simple;
use GTK::Simple::App;
my \app := GTK::Simple::App.new: title => 'ZofVLC';
my \b := {};
app.set-content:
GTK::Simple::VBox.new:
(b<hello> := GTK::Simple::Button.new: label => "Hello World!"),
(b<exit> := GTK::Simple::Button.new: label => "Goodbye!");
app.border-width = 20;
b<exit>.sensitive = False;
react {
whenever b<hello>.clicked {
say "O hai";
b<exit>.sensitive = True;
}
whenever b<exit>.clicked {
app.exit
}
start {
app.run;
exit;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment