NAME

Rui::Event::Tree - a Tree model change event


SYNOPSIS

  # 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);


SUPERCLASS

the Rui::Event manpage


DESCRIPTION

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:


METHODS

CONSTRUCTING

new

parameters
Hash of named parameters. Keys used here:

path - Array ref of integers. Where did the change happen.

size - Integer>0. Number of elements involved.

items - Array ref. Items removed/added/changed.

ACCESSING

path

Get/set path. Array ref of integers.

size

Get/set size. Integer.

items

Get/set items. Array ref. Items removed/added/changed.