c++ - 如何用ncurses画一条线?

标签 c++ ncurses

我了解 C++ ncurses 的基础知识,但我不知道如何在两个坐标之间绘制一条简单的线。

示例:

2----------3

我怎样才能做到这一点?

最佳答案

   int hline(chtype ch, int n);
   int whline(WINDOW *win, chtype ch, int n);

The hline and whline functions draw a horizontal (left to right) line using ch starting at the current cursor position in the window. The current cursor position is not changed. The line is at most n characters long, or as many as fit into the window.

对于角色,您可能需要 ACS_HLINE,但 - 也可能会起作用......也许更好。

关于c++ - 如何用ncurses画一条线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52331682/

相关文章:

Ncurses 属性 A_DIM 无效

c - getch 和 putchar 没有返回就无法工作

c++ - linux上如何使用编程方式拦截正在运行的进程调用的系统调用?

c++ - 在模板类中调用静态模板方法的问题

c++ - 如何重绘 ncurses 菜单

concurrency - 向下移动 Arc Mutex Ncurses 窗口线程仍然没有实现发送

c++ - 为什么我的命令行参数处理会导致我的程序崩溃?

c++ - rapidjson cocos2d-x解析

c++ - 在基类中使用 "new this.GetType()"实例化派生类

linux - ARM 的 vim 交叉编译