如何删除getstr后的文本()C ++的ncurses [英] How to delete text after getstr() c++ ncurses

查看:296
本文介绍了如何删除getstr后的文本()C ++的ncurses的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在学习使用ncurses库和我所遇到的getstr()。我想知道你将如何擦除在终端上getstr()文本的价值已经被存储在一个变量之后?我试图找到谷歌的答案,但没有运气!

I have been learning to use the ncurses library and I have come across getstr(). I was wondering how you would erase the text from getstr() on the terminal after the value has already been stored in a variable? I have tried to find the answer on google but no luck!

基本上我想它,以便当用户presses输入的文本会从屏幕上消失。

Basically I want it so when the user presses enter the text will be removed from the screen.

推荐答案

据我所知,ncurses的有两个功能, gotoxy() getxy(),让您跳到屏幕的每一个位置,并告诉你,你在哪里坐落知道了。

As far as I know, ncurses has two functions, gotoxy() and getxy(), which let you jump to every position of the screen and tell you where you are located right know.

跳转到previous线和呼叫 clrtobot()的前面删除光标之后的一切。

Jump to the front of the previous line and call clrtobot() to erase everything after the cursor.

编辑:

既然你说,清除整个窗口是一个选项,你可以叫清()(也ncurses库的一部分)。

Since you said that clearing the entire window is an option, you can just call clear() (also part of the ncurses library).

这篇关于如何删除getstr后的文本()C ++的ncurses的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆