NAME
Chart::Clicker::Drawing::Container
DESCRIPTION
A Base 'container' for all components that want to hold other components.
SYNOPSIS
my $c = new Chart::Clicker::Drawing::Container({
width => 500, height => 350
background_color => new Chart::Clicker::Drawing::Color(),
border => new Chart::Clicker::Drawing::Border(),
insets => new Chart::Clicker::Drawing::Insets(),
});
METHODS
Constructor
- new
-
my $c = new Chart::Clicker::Drawing::Container({ width => 500, height => 350 background_color => new Chart::Clicker::Drawing::Color(), border => new Chart::Clicker::Drawing::Border(), insets => new Chart::Clicker::Drawing::Insets(), });
Creates a new Container. Width and height must be specified. Border, background_color and insets are all optional and will default to undef
Class Methods
- background_color
-
Set/Get this Container's background color.
- border
-
Set/Get this Container's border
- components
-
Get the components in this container. The return value is an arrayref of hashrefs. Each hashref has a 'component' and 'position' key.
- draw
-
Draw this container and all of it's children.
- height
-
Set/Get this Container's height
- insets
-
Set/Get this Container's insets.
- prepare
-
Prepare this container for rendering. All of it's child components will be prepared as well.
- add
-
Add a component to this container.
$cont1->add($foo); $cont2->add($cont1, $CC_TOP); $cont2->add($cont1, $CC_TOP, 1);
The first argument must be some other entity that is renderable by Chart::Clicker. The second argument is an optional position. The positioning of elements is very rudimentary. If you do not specify a position then $CC_CENTER is used. The third argument is a flag that controls whether this component will actually affect the layout of items after it. This is used to make renderers render 'over' each other. A normal use of this would be to stack the Grid and Renderer.
- width
-
Set/Get this Container's height
AUTHOR
Cory 'G' Watson <gphat@cpan.org>
SEE ALSO
perl(1)
LICENSE
You can redistribute and/or modify this code under the same terms as Perl itself.