| 1 | # You may distribute under the terms of the GNU General Public License | ||
| 2 | # | ||
| 3 | # (C) Paul Evans, 2011-2023 -- leonerd@leonerd.org.uk | ||
| 4 | |||
| 5 | package Circle::FE::Term::Widget::Label 0.240250; | ||
| 6 | |||
| 7 | 1 | ▶ | use v5.26; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | use constant type => "Label"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 0 | ▶ | use Tickit::Widget::Static; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 13 | |||
| 14 | sub build | ||
| 15 | { | ||
| 16 | my $class = shift; | ||
| 17 | my ( $obj, $tab ) = @_; | ||
| 18 | |||
| 19 | my $widget = Tickit::Widget::Static->new( | ||
| 20 | classes => $obj->prop( "classes" ), | ||
| 21 | text => "", | ||
| 22 | ); | ||
| 23 | |||
| 24 | $tab->adopt_future( | ||
| 25 | $obj->watch_property_with_initial( | ||
| 26 | "text", | ||
| 27 | on_set => sub { $widget->set_text( $_[0] ) }, | ||
| 28 | ) | ||
| 29 | ); | ||
| 30 | |||
| 31 | return $widget; | ||
| 32 | } | ||
| 33 | |||
| 34 | Tickit::Style->load_style( <<'EOF' ); | ||
| 35 | Static.ident { | ||
| 36 | bg: "blue"; | ||
| 37 | } | ||
| 38 | |||
| 39 | Static.transient { | ||
| 40 | fg: "yellow"; | ||
| 41 | b: 1; | ||
| 42 | } | ||
| 43 | |||
| 44 | EOF | ||
| 45 | |||
| 46 | 0x55AA; | ||