|
|
A major feature of ETI is cursor optimization. Cursor optimization minimizes the amount a cursor has to move around a screen to update it. For example, if you designed a screen editor program with ETI routines and edited the sentence
ETI is a great package for creating forms and menus.to read
ETI is the best package for creating forms and menus.the program would change only ``the best'' in place of ``a great''. The other characters would be preserved. Because the amount of data transmitted--the output--is minimized, cursor optimization is also referred to as output optimization.
Cursor optimization takes care of updating the screen in a manner appropriate for the terminal on which an ETI program is run. This means that ETI can do whatever is required to update many different terminal types. It searches the terminfo database (described below) to find the correct description for a terminal.
How does cursor optimization help you and those who use your programs? First, it saves you time in describing in a program how you want to update screens. Second, it saves a user's time when the screen is updated. Third, it reduces the load on your UNIX system's communication lines when the updating takes place. Fourth, you do not have to worry about the myriad of terminals on which your program might be run.
Here is a simple ETI program. It uses some of the basic ETI routines to move a cursor to the middle of a terminal screen and print the character string BullsEye. Each of these routines is described in ``Basic ETI programming''. For now, just look at their names and you will get an idea of what each of them does:
#include <ocurses.h>main() { initscr();
move( LINES/2 - 1, COLS/2 - 4 ); addstr("Bulls"); refresh(); addstr("Eye"); refresh(); endwin(); }
A simple ETI program