Skip to content
This repository
Browse code

Added test script for curses using NativeCall for later usage

  • Loading branch information...
commit 8826c466ee0e5db18316577fb43817e7ab4148cb 1 parent 3e7cba3
Ahmad M. Zawawi authored November 08, 2012

Showing 1 changed file with 21 additions and 0 deletions. Show diff stats Hide diff stats

  1. 21  test_curses.p6
21  test_curses.p6
... ...
@@ -0,0 +1,21 @@
  1
+#!/usr/bin/env perl6
  2
+use v6;
  3
+
  4
+use NativeCall;
  5
+
  6
+constant LIB = 'libncurses.so.5';
  7
+
  8
+sub initscr()        is native(LIB) { ... };
  9
+sub clear()          is native(LIB) { ... };
  10
+sub endwin()         is native(LIB) { ... };
  11
+sub printw(Str)      is native(LIB) { ... };
  12
+#sub NCURSEsrefresh() is native(LIB) { ... };
  13
+sub getch()  	     is native(LIB) { ... };
  14
+
  15
+initscr;			# Start curses mode
  16
+printw("Hello World !!!\n");	# Print Hello World
  17
+printw("Wtf\n");
  18
+printw("zzz\n");
  19
+#NCURSEsrefresh;			# Print it on to the real screen
  20
+getch;			# Wait for user input
  21
+endwin;			# End curses mode

0 notes on commit 8826c46

Please sign in to comment.
Something went wrong with that request. Please try again.