【问题标题】:ncurses can't find any documentation on cchar_tncurses 在 cchar_t 上找不到任何文档
【发布时间】:2019-02-14 07:45:35
【问题描述】:

我正在尝试使用 mvin_wch() 从我的 ncurses 终端读取一个字符,它返回一个 cchar_t,我知道这是一个包含颜色信息和 wchar_t 等内容的结构。我似乎找不到有关此 cchar_t 的任何信息。我只是想知道它的成员叫什么名字。我不明白为什么 ncursesw 库中如此重要的部分没有在任何地方记录。

【问题讨论】:

标签: c++ c unicode ncurses


【解决方案1】:

如果您知道,请阅读 curses.h,但如上所述,您应该操纵 cchar_t 使用库调用,例如setcchargetcchar。 curses 的每个实现都为此结构使用不同的细节。 ncurses manual page 告诉您需要了解的所有内容:

           cchar_t
                corresponds to chtype.  However it is a structure, because
                more data is stored than can fit  into  an  integer.   The
                characters  are  large  enough  to  require a full integer
                value - and there may be more than one character per cell.
                The  video  attributes  and  color  are stored in separate
                fields of the structure.

                Each cell (row and column) in a  WINDOW  is  stored  as  a
                cchar_t.

关于视频属性,请注意属性手册页的PORTABILITY部分。

在 cmets 中,有一个指向 datatypes 上的 X/Open Curses 页面。其中cchar_t的描述不准确:

cchar_t
引用一串宽字符

(它不是对字符串的引用,而是一个完整的“宽”字符本身)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 2017-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多