How to clear a specific line with NCurses?

二次信任 提交于 2020-01-09 07:56:48

问题


How to clear a specific line with NCurses?

I need to wipe a line on the screen without redrawing the whole thing. How do I do that?


回答1:


You can position on the line you want to clear and then call clrtoeol function.




回答2:


This is how I ended up doing it for my purposes.

int y, x;            // to store where you are
getyx(stdscr, y, x); // save current pos
move(y, 0);          // move to begining of line
clrtoeol();          // clear line
move(y, x);          // move back to where you were



回答3:


maybe crltoeol would do the trick




回答4:


If you want to clear all lines from the cursor until the last line, you can call clrtobot()



来源:https://stackoverflow.com/questions/5072881/how-to-clear-a-specific-line-with-ncurses

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!