summaryrefslogtreecommitdiffhomepage
path: root/contrib/luacurses/test/hello.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-31 11:16:52 +0000
committerSteven Barth <steven@midlink.org>2008-08-31 11:16:52 +0000
commitdf52b711a78dbe8808628ae873acc1f3edefb1cf (patch)
tree00b4c145e7ab0501a6de277478b659d51e50fc92 /contrib/luacurses/test/hello.lua
parent36c76090638e80d1cb9ad2dd060aae65976f24c8 (diff)
Reorganise luacurses
Diffstat (limited to 'contrib/luacurses/test/hello.lua')
-rw-r--r--contrib/luacurses/test/hello.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/luacurses/test/hello.lua b/contrib/luacurses/test/hello.lua
new file mode 100644
index 000000000..6a1d28a21
--- /dev/null
+++ b/contrib/luacurses/test/hello.lua
@@ -0,0 +1,20 @@
+
+require("curses");
+
+function show_message(message)
+ local width = string.len(message) + 6;
+ win = curses.newwin(5, width, (curses.LINES() - 5) / 2, (curses.COLS() - width) / 2);
+ win:box('|', '-');
+ win:mvaddstr(2, 3, message);
+ win:getch();
+ win:delwin();
+end
+
+curses.initscr();
+curses.cbreak();
+curses.mvaddstr((curses.LINES() - 5) / 2, (curses.COLS() - 10) / 2, "Hit any key");
+curses.getch();
+show_message("Hello, World!")
+
+curses.endwin();
+