Rui::Event::Tree - a Tree model change event
# 5 items were added at path 0,1 my $event = Rui::Event::Tree->new( name => 'RangeAdded', source => $self, path => [0,1], size => 5, items => [@items], ); print join(',', @{$event->path}, $event->size); # 0,1,5 $event->path([1,2,3]); $event->size(2);
A change in a tree. The event is described by an path in the tree, and the number of tree items involved, starting from the last point in the path.
A path is a list of indices that start from the root tree item. So the
path 0,1,2
is pointing at: the 3rd child of the 2nd child of the 1st
item that is a child of the root tree item. The path is always expected
and returned as an array ref.
The root node is indicated by an empty path: []
.
Event name will be one of:
RangeAdded
RangeRemoved
RangeChanged
- entire tree nodes (value + children ) have been changed
RangeValueChanged
- the value of some tree nodes has changed
path - Array ref of integers. Where did the change happen.
size - Integer>0. Number of elements involved.
items - Array ref. Items removed/added/changed.
Get/set path. Array ref of integers.
Get/set size. Integer.
Get/set items. Array ref. Items removed/added/changed.