File: swindow

package info (click to toggle)
libcdk-perl 20130816-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,284 kB
  • ctags: 430
  • sloc: perl: 6,151; sh: 2,997; makefile: 24
file content (38 lines) | stat: -rwxr-xr-x 609 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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></U>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();