File: 07widget.t

package info (click to toggle)
libcurses-ui-perl 0.95-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 860 kB
  • ctags: 510
  • sloc: perl: 10,479; makefile: 51
file content (35 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (2)
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
# -*- perl -*-
use strict;
use Test::More tests => 6;
use FindBin;
use lib "$FindBin::RealBin/fakelib";
use lib "$FindBin::RealBin/../lib";

$ENV{LINES} = 25;
$ENV{COLUMNS} = 80;

BEGIN { use_ok( "Curses::UI"); }

my $cui = new Curses::UI("-clear_on_exit" => 0);

$cui->leave_curses();

isa_ok($cui, "Curses::UI");

my $mainw = $cui->add("testw","Window");

isa_ok($mainw, "Curses::UI::Window");

my $wid = $mainw->add("testwidget","Widget");

isa_ok($wid, "Curses::UI::Widget");

$wid->set_routine("foo", "bar");

$wid->set_binding("foo", sub { print 1; } );

ok($wid->parentwindow eq $mainw, "parentwindow()");
ok($wid->in_topwindow, "in_topwindow()");