| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #  You may distribute under the terms of the GNU General Public License | 
| 2 |  |  |  |  |  |  | # | 
| 3 |  |  |  |  |  |  | #  (C) Paul Evans, 2011-2015 -- leonerd@leonerd.org.uk | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | package Circle::FE::Term::Widget::Label; | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 1 |  |  | 1 |  | 1823 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 24 |  | 
| 8 | 1 |  |  | 1 |  | 5 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 23 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 1 |  |  | 1 |  | 3 | use constant type => "Label"; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 54 |  | 
| 11 |  |  |  |  |  |  |  | 
| 12 | 1 |  |  | 1 |  | 382 | use Tickit::Widget::Static; | 
|  | 0 |  |  |  |  |  |  | 
|  | 0 |  |  |  |  |  |  | 
| 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; |