| 1 | # You may distribute under the terms of the GNU General Public License | ||
| 2 | # | ||
| 3 | # (C) Paul Evans, 2008-2010 -- leonerd@leonerd.org.uk | ||
| 4 | |||
| 5 | package Circle::FE::Gtk::Widget::Label; | ||
| 6 | |||
| 7 | use strict; | ||
| 8 | use warnings; | ||
| 9 | |||
| 10 | use constant type => "Label"; | ||
| 11 | use Variable::Disposition qw( retain_future ); | ||
| 12 | |||
| 13 | sub build | ||
| 14 | { | ||
| 15 | my $class = shift; | ||
| 16 | my ( $obj, $tab ) = @_; | ||
| 17 | |||
| 18 | my $widget = Gtk2::Label->new(""); | ||
| 19 | retain_future $obj->watch_property_with_initial( | ||
| 20 | "text", | ||
| 21 | on_set => sub { $widget->set_text( $_[0] ) }, | ||
| 22 | ); | ||
| 23 | |||
| 24 | return $widget; | ||
| 25 | } | ||
| 26 | |||
| 27 | 1; |