| Wx-Perl-ListView documentation | Contained in the Wx-Perl-ListView distribution. |
Wx::Perl::ListView::SimpleModel - virtual list control simple model class
A simple model class for Wx::Perl::ListView.
my $model = Wx::Perl::ListView::SimpleModel->new( $data );
Where data has the form:
[ [ $item, $item, $item, ... ],
[ $item, $item, $item, ... ],
[ $item, $item, $item, ... ],
]
and each item is a valid return value for get_item.
my $data = $self->data;
Accessor for the model data.
| Wx-Perl-ListView documentation | Contained in the Wx-Perl-ListView distribution. |
package Wx::Perl::ListView::SimpleModel;
use strict; use base qw(Wx::Perl::ListView::Model);
sub new { my( $class, $data ) = @_; my $self = bless { data => $data }, $class; return $self; } sub get_item { my( $self, $row, $column ) = @_; return $self->data->[$row][$column]; } sub get_item_count { my( $self ) = @_; return scalar @{$self->data}; }
sub data { $_[0]->{data} } 1;