diff options
Diffstat (limited to 'lib/ui.c')
-rw-r--r-- | lib/ui.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -56,6 +56,7 @@ TEXT_BOX* new_text_box(WINDOW* scr, int length) text->current = 0; text->text = malloc(sizeof(char)*(length+1)); memset(text->text, '\0', length); + box(scr, 0,0); return text; } @@ -82,8 +83,23 @@ void get_char(TEXT_BOX* text, void (*sch)(char*, int)) wcstombs(str, text->text, sizeof(text->text)); sch(str, (int)strlen(str)); - move(0,0); - wrefresh(text->scr); + wmove(text->scr,1,1); wprintw(text->scr, "%*ls", text->current,text->text); + wrefresh(text->scr); } } + +PANEL* new_panel(WINDOW* scr) +{ + PANEL *panel = (PANEL*)malloc(sizeof(PANEL)); + panel->scr = scr; + box(scr, 0,0); + return panel; +} +void write_char(PANEL* panel, int l, char *text) +{ + int x = getmaxx(panel->scr); + wmove(panel->scr, l+1, 1); + wprintw(panel->scr, "%.*s", x-3, text); + wrefresh(panel->scr); +} |