Revision 623034633066 () - Diff

Link to this snippet: https://friendpaste.com/53MKnWboUIKj7JwCqIi4tx
Embed:
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
class Term::Curses {
has $.y is rw;
has $.x is rw;

has $!stdscr;

method new(
:$cbreak = True,
:$echo = False,
:$nl = False,
:$intrflush = False,
:$keypad = True,
:$use_default_colors = True,
:$start_color = True
) {
#setlocale(0, "");

# TODO: use newterm() instead of initscr()?
my $stdscr = initscr();

cbreak() if $cbreak;
noecho() unless $echo;
nonl() unless $nl;
intrflush($stdscr, 0) unless $intrflush;
keypad($stdscr, 1) if $keypad;
if ($start_color and has_colors()) {
use_default_colors() if $use_default_colors;
start_color();
}

self.bless(*, :$stdscr);
}

submethod BUILD(:$!stdscr) {}