CGI-Widget
view release on metacpan or search on metacpan
Widget/HList.pm view on Meta::CPAN
return $self->{img_spacer};
}
sub img_trunk {
my($self,$val) = @_;
return $self->{img_trunk} unless defined $val;
$self->{img_trunk} = $val;
return $self->{img_trunk};
}
sub img_branch {
my($self,$val) = @_;
return $self->{img_branch} unless defined $val;
$self->{img_branch} = $val;
return $self->{img_branch};
}
sub img_corner {
my($self,$val) = @_;
return $self->{img_corner} unless defined $val;
$self->{img_corner} = $val;
return $self->{img_corner};
}
1;
__END__
# Below is stub documentation for your module. You better edit it!
=head1 NAME
CGI::Widget::HList - Create and manipulate Hierarchial List widgets
=head1 SYNOPSIS
use CGI::Widget::HList;
use CGI::Widget::HList::Node;
#create a node
my $root_node = CGI::Widget::HList::Node->new;
$root_node->name("mama");
#create an hlist to manage the node
my $hlist = CGI::Widget::HList->new(-root=>$root_node);
#create a daughter node via the hlist object
my $daughter = $hlist->node;
$daughter->name("baby");
$root_node->add_daughter($daughter);
#render the hlist
print $hlist; #not very exciting
=head1 DESCRIPTION
CGI::Widget::HList provides look-and-feel for displaying a
CGI::Widget::HList::Node tree graph. For more information,
see L<CGI::Widget::HList::Node>.
This module is where image configurations, node rendering,
and connector rendering methods are stored in the form of
callbacks.
Check ex/ for example scripts
=head2 Constuctors
CGI::Widget::HList has only one constructor: new().
For convenient access to the CGI::Widget::HList::Node
constructor, you can call the node() method.
new() accepts the following parameters, with optional leading dash.
All parameters are optional.
Parameter Purpose
-------------------------------------------------------------------
root Root node of the tree to be rendered
Images to be used in the HTML rendering of the tree:
img_open,img_close,img_leaf,img_trunk,img_branch,img_corner,img_spacer
The rendering methods themselves. All are callbacks:
render_node,render_branch,render_spacer,render_trunk
The rendering methods default to sensible code that uses the (also
default) images. This can all be over-ridden. See Methods.
=head2 Methods
Interpreted in a scalar context, the object is overloaded to return
the html for the HList. Easy!
html(), or ashtml() can also be called to produce the series html.
node() returns a CGI::Widget::HList::Node object.
root_node() returns the HList's root node.
render_*() methods allow setting/retrieving the coderefs actually
used by CGI::Widget::HList::Node objects in the rendering process.
img_*() methods allow setting/retrieving image paths or text
that will be used by the rendering coderefs.
=head1 AUTHOR
Drop me a line if you use this, I'd like to know where it ends up.
Allen Day <allenday@ucla.edu>
Copyright (c) 2001.
=head1 SEE ALSO
L<perl>.
L<CGI::Widget>.
L<CGI::Widget::HList::Node>
L<Tk::HList>.
=cut
( run in 1.389 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )