2 curses library IO processing-character attribute functions

Source: Internet
Author: User

2.4 character attribute functions

========================


2.4.1 chtype description

-----------------

* The chtype type contains two parts of information: one part contains the information about the character itself, and the other part contains the attributes related to the character. These attributes allow the character to be displayed in different ways, including reverse display, bold, color changing, underline, etc.

* When a character is passed as a parameter to a function, these attributes can be directly used | combined with characters, and multiple attributes can be used directly | used to combine attributes


2.4.2 character attribute list

-------------------

Attribute value description

--------------- + -----------------------------------------

A_NORMAL Standard Display Mode

A_BLANK flashes

A_BOLD bold

A_DIM translucent

A_REVERSE reverse display

A_STANDOUT highlight

A_UNDERLINE underline

A_ALTCHARSET substitution Character Set

COLOR_PAIR (n) specifies the background color and foreground color of a character.

A_CHARTEXT and chtype can be extracted with the & Operator

A_ATTRIBUTES and chtype attributes can be extracted using the & operator

A_COLOR and chtype can be extracted with the & operator symbol.



2.4.3 set/cancel character attributes

------------------------

/** @ Brief: sets the default character attribute for character output. After setting, all text characters are affected by this attribute. @ note: attrset (0) can be used) to disable all attributes */int attrset (chtype attrs);/** @ brief to open certain attributes */int attron (chtype attrs ); /** @ brief disable certain attributes */int attroff (chtype attrs);/** @ brief highlight attributes A_STANDOUT */int standout () on the current screen (); /** @ brief works the same way as attrset (0). Disable all attributes */int standend ();


This article is from the "dark day" blog, please be sure to keep this source http://darksun.blog.51cto.com/3874064/1286560

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.