File: Label.pm

package info (click to toggle)
libcircle-fe-term-perl 0.240250-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 164 kB
  • sloc: perl: 1,003; makefile: 10
file content (46 lines) | stat: -rw-r--r-- 743 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
46
#  You may distribute under the terms of the GNU General Public License
#
#  (C) Paul Evans, 2011-2023 -- leonerd@leonerd.org.uk

package Circle::FE::Term::Widget::Label 0.240250;

use v5.26;
use warnings;

use constant type => "Label";

use Tickit::Widget::Static;

sub build
{
   my $class = shift;
   my ( $obj, $tab ) = @_;

   my $widget = Tickit::Widget::Static->new(
      classes => $obj->prop( "classes" ),
      text => "",
   );

   $tab->adopt_future(
      $obj->watch_property_with_initial(
         "text",
         on_set => sub { $widget->set_text( $_[0] ) },
      )
   );

   return $widget;
}

Tickit::Style->load_style( <<'EOF' );
Static.ident {
  bg: "blue";
}

Static.transient {
  fg: "yellow";
  b: 1;
}

EOF

0x55AA;