summaryrefslogtreecommitdiff
path: root/examples/demo.pl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/demo.pl')
-rw-r--r--examples/demo.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/examples/demo.pl b/examples/demo.pl
new file mode 100644
index 0000000..30814c4
--- /dev/null
+++ b/examples/demo.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Tickit;
+use Tickit::Widget::ScrollBox;
+use Tickit::Widget::Static;
+
+use Getopt::Long;
+
+GetOptions(
+ 'lines|l=i' => \(my $LINES = 100),
+) or exit 1;
+
+my $scrollbox = Tickit::Widget::ScrollBox->new(
+ horizontal => "on_demand",
+ vertical => "on_demand",
+
+ child => Tickit::Widget::Static->new(
+ text => join( "\n", map { "The content for line $_ " x 3 } 1 .. $LINES ),
+ ),
+);
+
+Tickit->new( root => $scrollbox )->run;