#!/usr/bin/perl
use strict;
use warnings;

use Gtk2 -init;
use Gtk2::SimpleList;

my $window = Gtk2::Window -> new();
my $scrolled = Gtk2::ScrolledWindow -> new();
my $list = Gtk2::SimpleList -> new(Test => "text");

@{$list -> { data }} = (["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"],
                        ["Bla"]);

$scrolled -> set_policy("automatic", "automatic");
$scrolled -> add($list);

$window -> signal_connect(key_press_event => sub {
  foreach (0 .. 9) {
    warn $list -> row_visible($_);
  }
});

$window -> set_default_size(100, 100);
$window -> add($scrolled);
$window -> show_all();

Gtk2 -> main();
