X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=contrib%2Fluacurses%2Ftest%2Fhello.lua;fp=contrib%2Fluacurses%2Ftest%2Fhello.lua;h=6a1d28a21621b5dfafd6a75bd74852933f39a9d2;hb=df52b711a78dbe8808628ae873acc1f3edefb1cf;hp=0000000000000000000000000000000000000000;hpb=36c76090638e80d1cb9ad2dd060aae65976f24c8;p=project%2Fluci.git diff --git a/contrib/luacurses/test/hello.lua b/contrib/luacurses/test/hello.lua new file mode 100644 index 0000000000..6a1d28a216 --- /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(); +