开发者

In ncurses what does the attribute A_PROTECT do?

In ncurses:

1.What does the A_PROTECT attribute do? Everywhere on the net, the docs just say: Protected mode. What is that?

2.Also I would like to mark t开发者_如何学编程he area where the user inputs characters with an underscore, but I would like when the user deletes or backspaces to have the underscore reappear. Is there an attribute that does that, or I have to manually do that?


Protected mode may refer to a little-used feature of some DEC terminals (notably the VT220 and related), called selective erase.

The general idea is that some text can be internally marked as protected. This doesn't change the way it is rendered on the screen, but character cells so marked are not erased by the DECSEL and DECSED (Selective Erase in Line and Selective Erase Data) commands.

This would typically be used to implement something like a data entry form. Field headings and markup would be protected text, and data entered into the fields would be unprotected. You can erase the contents of the form to reset it by performing Selective Erase; thus erasing the data fields but not the headings.


Protect mode is defined by the terminal I'm not sure if it does anything on modern terminals.

There is an attribute "A_UNDERLINE" that underlines a character if your terminal supports it.

For handling input you may want to look at the form library (distributed with ncurses) or cdk (http://invisible-island.net/cdk/)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜