nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: nitdoc: introduce useful services
[nit.git]
/
lib
/
curses
/
curses.nit
diff --git
a/lib/curses/curses.nit
b/lib/curses/curses.nit
index
7acc650
..
688493e
100644
(file)
--- a/
lib/curses/curses.nit
+++ b/
lib/curses/curses.nit
@@
-13,14
+13,14
@@
# limitations under the License.
# Curses for Nit
# limitations under the License.
# Curses for Nit
-module curses
+module curses is pkgconfig("ncurses")
in "C header" `{
#include <ncurses.h>
`}
# A curse windows
in "C header" `{
#include <ncurses.h>
`}
# A curse windows
-extern Window `{WINDOW *`}
+extern class Window `{WINDOW *`}
# Initialize the screen
new `{
WINDOW *res;
# Initialize the screen
new `{
WINDOW *res;
@@
-35,22
+35,29
@@
extern Window `{WINDOW *`}
return res;
`}
return res;
`}
- # print a string somewhere
+ # Move the cursor at the position (y,x) and print a string
# NOTE: as with the curses API, the position is (y,x)
# NOTE: as with the curses API, the position is (y,x)
- fun mvaddstr(y,x: Int, str: String) import String::to_cstring `{
+ fun mvaddstr(y,x: Int, str: String) import String.to_cstring `{
char *c_string = String_to_cstring( str );
mvaddstr(y, x, c_string);
`}
char *c_string = String_to_cstring( str );
mvaddstr(y, x, c_string);
`}
+ # Update the window
fun refresh `{
refresh();
`}
fun refresh `{
refresh();
`}
+
+ # Clear the entire window so it can be repainted from scratch with a refresh
fun wclear `{
fun wclear `{
- wclear(recv);
+ wclear(self);
`}
`}
+
+ # Delete the window
fun delwin `{
fun delwin `{
- delwin(recv);
+ delwin(self);
`}
`}
+
+ # Suspend the curses session and restore the previous terminal
fun endwin `{
endwin();
`}
fun endwin `{
endwin();
`}