#!/usr/bin/perl -w
# $Id: swindow,v 1.4 2013/07/14 22:33:32 tom Exp $

#
# Purpose:
#	To demonstrate the Perl5 Cdk Scrolling Window Widget.

use strict;

#
# Initialize Cdk.
#
use Cdk;
Cdk::init();

# Create the scrolling window.
my $swindow = new Cdk::Swindow(
    'Title'  => "<C>Scrolling Window",
    'Lines'  => 200,
    'Height' => 20,
    'Width'  => -4
);

# Open this file and read myself in.
my @info = qx (cat $0);
chomp @info;
my $line;

$swindow->draw();

# Line by line, add the info.
foreach $line (@info) {
    $swindow->addline( 'Info' => $line );
    sleep 1;
}

# Exit Cdk.
Cdk::end();
