Tickit::Widget::Frame - draw a frame around another widget
Tickit::Widget::Frame
use Tickit; use Tickit::Widget::Frame; use Tickit::Widget::Static; my $tickit = Tickit->new; my $hello = Tickit::Widget::Static->new( text => "Hello, world", align => "centre", valign => "middle", ); my $frame = Tickit::Widget::Frame->new; $frame->add( $hello ); $tickit->set_root_widget( $frame ); $tickit->run;
This container widget draws a frame around a single child widget.
Constructs a new Tickit::Widget::Static object.
Tickit::Widget::Static
Takes the following named arguments in addition to those taken by the base Tickit::Widget::SingleChildWidget constructor:
Optional. Defaults to ascii if unspecified.
ascii
Optional.
Optional. Defaults to 0.0 if unspecified.
0.0
For more details see the accessors below.
Accessor for the style property, which controls the way the actual frame is drawn around the inner widget. Must be one of the following names:
style
ascii single double thick solid_inside solid_outside
The ascii style is default, and uses only the -|+ ASCII characters. Other styles use Unicode box-drawing characters. These may not be supported by all terminals or fonts.
-|+
Returns the current frame pen. Modifying an attribute of the returned object results in the widget being redrawn if the widget has a window associated.
Set a new Tickit::Pen object. This is stored by reference; changes to the pen will be reflected in the rendered look of the frame. The same pen may be shared by more than one widget; updates will affect them all.
Tickit::Pen
Accessor for the title property, a string written in the top of the frame.
title
Accessor for the title_align property. Gives a vlaue in the range 0.0 to 1.0 to align the title in the top of the frame.
title_align
1.0
The symbolic values left, centre and right can be supplied instead of 0.0, 0.5 and 1.0 respectively.
left
centre
right
0.5
Specific pen for title. Layered on top of frame pen.
Caption at the bottom of the frame as well. Identical to title.
Consider if it's useful to provide accessors to apply extra padding inside the frame, surrounding the child window.
Paul Evans <leonerd@leonerd.org.uk>
To install Tickit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tickit
CPAN shell
perl -MCPAN -e shell install Tickit
For more information on module installation, please visit the detailed CPAN module installation guide.