[Gtk-Perl] Gtk2::SimpleList



just commited to cvs a working (with known issues) version of
Gtk2::SimpleList. for now if you want info on how to use it take a look
at t/19.GtkSimpleList.t. an example in the examples directory will be
coming shortly (this weekend) as well as first passes at documentation. 

it uses some really cool tied array stuff that muppet worked up and i
extended. thanks also go to gavin brown, for his input. 

$list = Gtk2::SimpleList->new(
'Column One'    => 'text',
'Column Two'    => 'int',
'Column Three' => 'bool',
);

@{$list->{data}} = (
        [ 'one', 1, FALSE, ],
        [ 'two', 2, TRUE, ],
);

my $ldata = $list->{data};

push @$ldata, [ 'three', 3, TRUE, ];
pop @$ldata;
unshift @$ldata, [ 'three', 3, TRUE, ];
shift @$ldata;

# in general you can use @$ldata or what i pointed it to,
@{$list->{data}}, as an array. that includes, the really cool part,
getting at the data in the list. so

$ldata->[0] would return ( 'one', 1, FALSE, )
$ldata->[0][1] would return 'one'

it also will keep up with updates, i.e. when the bool's change.

play with it and report problems. there are a few known right now, but
there are likely a lot more to be discovered.

later,
-rm




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]