From dd9d3ba0973e672dec2a8eadbc75f47e5792b92e Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Thu, 14 Dec 2023 13:35:09 -0600 Subject: fix readme and some other stuff --- src/ui/root.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/ui/root.c') diff --git a/src/ui/root.c b/src/ui/root.c index eeeb1b9..49dc6c3 100644 --- a/src/ui/root.c +++ b/src/ui/root.c @@ -110,7 +110,7 @@ void ui__update_scroll(struct ui_window_root *root) } } -void ui__root_scroll_text(struct ui_window_root *root, unsigned cursor, const char *text, size_t tlen) +void ui__root_scroll_print(struct ui_window_root *root, unsigned cursor, const char *text, size_t tlen) { if (cursor < root->menu_scroll) { size_t strend = cursor + tlen; @@ -154,9 +154,10 @@ void ui__root_draw_menu(struct ui_window_root *root) if (item == root->menu_selected) { wattroff(root->menu_cwindow, A_REVERSE); /* the coordinates of the selected menu item are here, place the window :) */ + root->menu_selected_x = getcurx(root->menu_cwindow); } - ui__root_scroll_text(root, cursor, text, tlen); + ui__root_scroll_print(root, cursor, text, tlen); wattron(root->menu_cwindow, A_REVERSE); cursor += tlen; @@ -259,6 +260,15 @@ struct ui_window_base *ui__root_control_proc(struct ui_window_base *base, ui_con return NULL; } break; + case NS('\n'): + if (root->menu_selected) { + WINDOW *win = newwin(2, 30, 5, root->menu_selected_x); + ui__call_draw_proc(ui__cast(base, ui_root)); + mvwaddstr(win, 0, 0, "this line is too long to fit in the window. this line is too long to fit in the window. this line is too long to fit in the window."); + wrefresh(win); + delwin(win); + } + break; } if (root->menu_selected) { -- cgit v1.2.3-70-g09d2