On 11/19/25 10:59, Kirisame Marisa wrote:
...First, about the box edge.
I added a few lines to make the minimal example shown below. It
works correctly with ncurses on my Linux machine. Does it fail on your
Windows machine?
then you will only see it flash on screen and went away just in a
seconds. Then the terminal will get void. No matter whether you use new
Windows Terminal or old conhost.exe
Is it possibly receiving a mouse movement or other event that would
cause getch( ) to return? You will see that in the following, the key
hit will be printed to the screen; that may provide us with a clue,
especially if it is key
(No ideas on the menu, though; I will leave that to others.)
-- Bill
#include <curses.h>
/* Compile with cc -Wall -Wextra -o boxtest boxtest.c -lncursesw */
int main( void)
{
SCREEN *screen_pointer = newterm( NULL, stdout, stdin);
WINDOW *win1;
int c;
refresh();
win1 = newwin(10, 30, 3, 5);
box(win1, 0, 0);
mvwprintw(win1, 1, 1, "This is a subwindow");
mvwprintw(win1, 2, 1, "with a border");
wrefresh( win1);
c = getch( );
delwin(win1);
endwin( );
/* Not really needed, but ensures Valgrind */
delscreen( screen_pointer); /* says all memory was freed */
printf( "Key %d = 0x%x was hit\n", c, (unsigned)c);
return( 0);
}