772 Part VI . Programming in Linux Ncurses (Web hosting reviews)
772 Part VI . Programming in Linux Ncurses provides a simple, high-level interface for screen control and manipulation. It also contains powerful routines for handling keyboard and mouse input, creating and managing multiple windows, and using menus, forms, and panels. Ncurses works by generalizing the interface between an application program and the screen or terminal on which it is running. Given the literally hundreds of varieties of terminals, screens, and terminal emulation programs available, and the different features they possess (not to mention the different commands to use these features and capabilities), UNIX programmers quickly developed a way to abstract screen manipulation. Rather than write a lot of extra code to take into account the different terminal types, ncurses provides a uniform and generalized interface for the programmer. The ncurses API insulates the programmer from the underlying hardware. Ncurses gives to character-based applications many of the same features found in graphical X Window applications multiple windows, forms, menus, and panels. Ncurses windows can be managed independently, may contain the same or different text, scroll or not scroll, be visible or hidden. Forms enable the programmer to create easy-to-use data entry and display windows, simplifying what is usually a difficult and application-specific coding task. Panels extend ncurses capability to deal with overlapping and stacked windows. Menus provide, well, menus, again with a simpler, generalized programming interface. To give you an idea of how ncurses works and what is involved in writing code to use it, Listing 28-3 shows the readkey.c program (now named nreadkey.c) introduced in Listing 28-2, adapted here to work with ncurses. Listing 28-3: Reading Input and Writing Output with ncurses /* * nreadkey.c - reads characters from stdin */ #include
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.