diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-20 16:16:00 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-20 16:33:41 -0800 |
commit | b618bfc7cf7eb5fa498a051a17832c2cda4cca9c (patch) | |
tree | 0e5179289101da53572f9bce6c9f543d054d010a /src/lcurses/window.c | |
parent | 8a3e81b4b0d8365baa40ff1326ed4d13b34506dc (diff) | |
download | teliva-b618bfc7cf7eb5fa498a051a17832c2cda4cca9c.tar.gz |
port changes from minimal to maximal version
From lcurseslib.c to lcurses/ directory.
Diffstat (limited to 'src/lcurses/window.c')
-rw-r--r-- | src/lcurses/window.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lcurses/window.c b/src/lcurses/window.c index fd18570..9c243ea 100644 --- a/src/lcurses/window.c +++ b/src/lcurses/window.c @@ -36,8 +36,6 @@ @classmod curses.window */ -//? #include <config.h> - #include "_helpers.c" #include "chstr.c" @@ -311,10 +309,13 @@ Refresh the window terminal display from the virtual screen. @see curses.doupdate @see noutrefresh */ +extern void draw_menu (lua_State *L); static int Wrefresh(lua_State *L) { - return pushokresult(wrefresh(checkwin(L, 1))); + int result = wrefresh(checkwin(L, 1)); + draw_menu(L); + return pushokresult(result); } @@ -548,6 +549,7 @@ Wgetmaxyx(lua_State *L) WINDOW *w = checkwin(L, 1); int y, x; getmaxyx(w, y, x); + --y; // set aside space for the menu bar lua_pushinteger(L, y); lua_pushinteger(L, x); return 2; @@ -1302,6 +1304,7 @@ Read a character from the window input. @see curses.echo @see keypad */ +extern void switch_to_editor (lua_State *L, const char *message); static int Wgetch(lua_State *L) { @@ -1310,6 +1313,11 @@ Wgetch(lua_State *L) if (c == ERR) return 0; + if (c == 24) /* ctrl-x */ + exit(0); + if (c == 5) /* ctrl-e */ + switch_to_editor(L, ""); + /* handle other standard menu hotkeys here */ return pushintresult(c); } |