Printing inside window, not on borders

后端 未结 2 1506
深忆病人
深忆病人 2021-02-19 20:52

I\'m trying to write something inside a curses window, but it seems to write on borders too. How can I fix the code below?

win_self = newwin(LINES / 2, COLS, 0,          


        
2条回答
  •  借酒劲吻你
    2021-02-19 21:18

    I'd say the easiest way is to create a window inside of the window borders and print in that window.

    win_self = newwin(LINES / 2, COLS, 0, 0);
    box(win_self, 0, 0);
    derwin_self = derwin(win_self, LINES / 2 - 2, COLS - 2, 0, 0);
    wprintw(derwin_self, "foobar");
    

提交回复
热议问题