Curses library--libncurses5-dev--cursor movement and display of the screen

Source: Internet
Author: User

Curses is a library of graphic functions widely used under Linux/unix., the function is to be able to draw the user interface and beautiful graphics under DOS.

Curses's name originates from "cursor optimization", which is cursor optimization. It was first written by Bill Joy and Ken Arnold of the University of Berkeley to handle a screen display of a game rogue. Later at Bell Labs, Mark Horton rewritten the curses in System III UNIX. Almost all unix/linux operating systems now have curses libraries, and curses also adds support for the mouse, some menu and panel handling. It can be said that curses is the best choice for Linux Terminal graphics programming (such as the famous text Editor VI is based on the curses series).

Install the Ubuntu installation method: sudo apt-get install Libncurses5-dev usage 1. Include header file: curses.h2. Compile with link statement-lcurses, such as: GCC temp.c-o temp-lcurses sample screen display characters in the middle
#include <curses.h>intMain () {INITSCR (); if(Start_color () = =OK) {Init_pair (1, color_red, Color_green); Attron (Color_pair (1)); Move (LINES/2, cols/2); Waddstr (STDSCR,"yet another Hello world!"); Attroff (Color_pair (1));        Refresh ();    Getch (); } Else{waddstr (STDSCR,"Can not init color");        Refresh ();    Getch ();    } endwin (); return 0;}

Reference:

1. Linux Curses Library use

2. http://tldp.org/howto/ncurses-programming-howto/--"ncurses programming HOWTO"

3. http://invisible-island.net/ncurses/man/ncurses.3x.html--ncurses

Curses library--libncurses5-dev--cursor movement and display of the screen

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.