File: demo-frame.pl

package info (click to toggle)
libtickit-widgets-perl 0.42-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 568 kB
  • sloc: perl: 5,636; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl

use v5.20;
use warnings;

use Tickit;
use Tickit::Widgets qw( Static VBox Frame );

my $vbox = Tickit::Widget::VBox->new( spacing => 1 );

my $fg = 1;
foreach my $linetype ( qw( ascii single double thick solid_inside solid_outside ) ) {
   $vbox->add(
      Tickit::Widget::Frame->new(
         style => {
            linetype => $linetype,
            frame_fg => $fg++,
         },
      )->set_child( Tickit::Widget::Static->new( text => $linetype, align => 0.5 ) )
   );
}

$vbox->add(
   Tickit::Widget::Frame->new(
      style => {
         linetype_top    => "double",
         linetype_bottom => "double",
         linetype_left   => "single",
         linetype_right  => "single",
      },
   )->set_child( Tickit::Widget::Static->new( text => "mixed lines", align => 0.5 ) )
);

$vbox->add(
   Tickit::Widget::Frame->new(
      style => {
         linetype_top    => "double",
         linetype_bottom => "single",
         linetype_left   => "solid_outside",
         linetype_right  => "solid_outside",
      },
   )->set_child( Tickit::Widget::Static->new( text => "mixed", align => 0.5 ) )
);

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