File: demo.pl

package info (click to toggle)
libtickit-widget-scrollbox-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 868; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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",
)->set_child(
   Tickit::Widget::Static->new(
      text => join( "\n", map { "The content for line $_ " x 3 } 1 .. $LINES ),
   )
);

Tickit->new( root => $scrollbox )->run;