Добавлен keypad для окон, т.к. некорректно считываются последовательности нажатых клавиш. Добавлена функция put для печати текста.

This commit is contained in:
Alexander Zhirov 2026-01-07 17:48:21 +03:00
parent 42744c6b16
commit cd4b621180
Signed by: alexander
GPG key ID: C8D8BE544A27C511

View file

@ -2,6 +2,9 @@ module ncui.core.window;
import deimos.ncurses; import deimos.ncurses;
import std.string : toStringz;
import std.conv : to;
import ncui.core.ncwin; import ncui.core.ncwin;
import ncui.lib.checks; import ncui.lib.checks;
@ -15,6 +18,7 @@ public:
this(int h, int w, int y, int x) this(int h, int w, int y, int x)
{ {
_window = ncuiNotNull!newwin(h, w, y, x); _window = ncuiNotNull!newwin(h, w, y, x);
ncuiNotErr!keypad(_window, true);
} }
int height() int height()
@ -42,6 +46,10 @@ public:
ncuiNotErr!wrefresh(_window); ncuiNotErr!wrefresh(_window);
} }
void put(int y, int x, string s) {
ncuiNotErr!mvwaddnstr(_window, y, x, s.toStringz, s.length.to!int);
}
@property NCWin handle() @property NCWin handle()
{ {
return _window; return _window;