简体   繁体   English

NCURSES:创建没有循环的标题栏

[英]NCURSES: creating a title bar without loops

I wanted to create a program where I can stop, start and monitor processes and their outputs, notifications, errors, etc. Probably has been done but I haven't found it. 我想创建一个程序,在其中可以停止,启动和监视进程及其输出,通知,错误等。可能已经完成,但没有找到。

This my first ncurses program and I'm having a styling issue. 这是我的第一个ncurses程序,我遇到了样式问题。 I'm reading in an XML file which contains all the initial layout information. 我正在阅读一个包含所有初始布局信息的XML文件。 This breaks up the terminal into a few sections. 这将终端分为几个部分。 Each section I wanted to have a title bar. 我希望每个部分都有一个标题栏。 This would simply be A_REVERSE, or a specified fg/bg color pair. 这可能只是A_REVERSE或指定的fg / bg颜色对。

I hadn't discovered the wattr_on() wattr_off() functions til a minute ago. 直到一分钟之前,我还没有发现wattr_on() wattr_off()函数。 That's a step in the right direction. 这是朝正确方向迈出的一步。 But I make a call to wborder() and I'm getting characters where I want none. 但是我打电话给wborder() ,但我却wborder()想要的字符。 Specifically: 特别:

wborder(pwin, '\\0', '\\0', ' ', '\\0', ' ', ' ', '\\0', '\\0');

I wanted the NULL s to be no character, not the default. 我希望NULL不能是字符,而不是默认字符。 I was trying to do this without loops. 我试图做到没有循环。 Is it possible? 可能吗?

Answer 回答

mvwhline(pwin,0,0,' ',xmax);
wprintw(pwin,"%s",sztitle);
mvwchgat(pwin,0,0,-1,A_REVERSE,0,0);

window borders are window borders, not a headline. 窗口边框是窗口边框,而不是标题。 If you only want that, it's probably best to just use mvwchgat() to make the headline stand out. 如果只希望这样做,最好使用mvwchgat()使标题突出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM