File: demo-gridbox.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 (26 lines) | stat: -rw-r--r-- 556 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
26
#!/usr/bin/perl

use strict;
use warnings;

use Tickit;
use Tickit::Widget::ScrollBox;
use Tickit::Widget::GridBox;
use Tickit::Widget::Static;

my $gridbox = Tickit::Widget::GridBox->new(
   row_spacing => 1,
   col_spacing => 2,
);
foreach my $row ( 1 .. 10 ) {
   $gridbox->append_row(
      [ map { Tickit::Widget::Static->new( text => "Row $row Col $_" ) } 1 .. 10 ]
   );
}

my $scrollbox = Tickit::Widget::ScrollBox->new(
   horizontal => "on_demand",
   vertical   => "on_demand",
)->set_child( $gridbox );

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