Skip to content

Instantly share code, notes, and snippets.

@dharmatech
Created June 6, 2016 22:17
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 dharmatech/b8e8a71da8149382f192603e1b92d9b8 to your computer and use it in GitHub Desktop.
Save dharmatech/b8e8a71da8149382f192603e1b92d9b8 to your computer and use it in GitHub Desktop.
use v6;
use lib 'lib';
use GTK::Simple;
sub cascade ($obj, &proc) { proc($obj); $obj; }
GTK::Simple::App.new(title => 'Text').&cascade:
{
my $text-view;
.set-content:
GTK::Simple::VBox.new(
GTK::Simple::CheckButton.new(label => 'Editable').&cascade:
{
.status = True;
.toggled.tap({ $text-view.editable = .status });
};
GTK::Simple::CheckButton.new(label => 'Show Cursor').&cascade:
{
.status = True;
.toggled.tap({ $text-view.cursor-visible = .status });
};
GTK::Simple::CheckButton.new(label => 'Monospaced').&cascade:
{
.status = False;
.toggled.tap({ $text-view.monospace = .status });
};
$text-view = GTK::Simple::TextView.new()
);
.run;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment