.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Graphics::Primitive::Container 3pm" .TH Graphics::Primitive::Container 3pm "2022-06-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Graphics::Primitive::Container \- Component that holds other Components .SH "DESCRIPTION" .IX Header "DESCRIPTION" Containers are components that contain other components. They can also hold an instance of a Layout::Manager for automatic layout of their internal components. See the Component's Lifecycle Section for more information. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& my $c = Graphics::Primitive::Container\->new( \& width => 500, height => 350, \& layout_manager => Layout::Manager::Compass\->new \& ); \& $c\->add_component($comp, { meta => \*(Aqdata\*(Aq }); .Ve .SH "METHODS" .IX Header "METHODS" .SS "Constructor" .IX Subsection "Constructor" .IP "\fInew\fR" 4 .IX Item "new" Creates a new Container. .SS "Instance Methods" .IX Subsection "Instance Methods" .IP "\fIadd_component ($component, [ \f(CI$constraint\fI ])\fR" 4 .IX Item "add_component ($component, [ $constraint ])" Add a component to the container. Returns a true value if the component was added successfully. A second argument may be required, please consult the \&\s-1POD\s0 for your specific layout manager implementation. .Sp Before the component is added, it is passed to the validate_component method. If validate_component does not return a true value, then the component is not added. .IP "\fIclear_components\fR" 4 .IX Item "clear_components" Remove all components from the layout manager. .IP "\fIcomponent_count\fR" 4 .IX Item "component_count" Returns the number of components in this container. .IP "\fIcomponent_list\fR" 4 .IX Item "component_list" Returns this Container's ComponentList. .IP "\fIfind_component\fR" 4 .IX Item "find_component" Returns the index of the first component with the supplied name. Returns undef if no component with that name is found. .IP "\fIget_component\fR" 4 .IX Item "get_component" Get the component at the specified index. .IP "\fIget_constraint\fR" 4 .IX Item "get_constraint" Get the constraint at the specified index. .IP "\fIget_tree\fR" 4 .IX Item "get_tree" Returns a Forest::Tree object with this component at the root and all child components as children. Calling this from your root container will result in a tree representation of the entire scene. .IP "\fIprepare\fR" 4 .IX Item "prepare" Prepares this container. Does not mark as prepared, as that's done by the layout manager. .IP "\fIremove_component\fR" 4 .IX Item "remove_component" Removes a component. \fBComponents must have names to be removed.\fR Returns an arrayref of removed components. .IP "\fIvalidate_component\fR" 4 .IX Item "validate_component" Optionally overridden by an implementation, allows it to deem a component as invalid. If this sub returns false, the component won't be added. .SH "AUTHOR" .IX Header "AUTHOR" Cory Watson, \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \f(CW\*(C`bug\-geometry\-primitive at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2008\-2009 by Cory G Watson. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.