diff options
| author | 2023-12-14 13:35:09 -0600 | |
|---|---|---|
| committer | 2023-12-14 13:35:09 -0600 | |
| commit | dd9d3ba0973e672dec2a8eadbc75f47e5792b92e (patch) | |
| tree | 02f5dc32cfe9db93c538f8e46755a76df83d27bb /src/ui/root.c | |
| parent | readme (diff) | |
Diffstat (limited to 'src/ui/root.c')
| -rw-r--r-- | src/ui/root.c | 14 |
1 files changed, 12 insertions, 2 deletions
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) { |
