DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Other ETI routines

Routines for drawing lines and other graphics

Many terminals have an alternate character set for drawing simple graphics (or glyphs or graphic symbols). You can use this character set in ETI programs. ETI uses the same names for glyphs as the VT100 line drawing character set.

To use the alternate character set in an ETI program, you pass a set of variables whose names begin with ACS_ to the ETI routine waddch or a related routine. For example, ACS_ULCORNER is the variable for the upper left corner glyph. If a terminal has a line drawing character for this glyph, ACS_ULCORNER's value is the terminal's character for that glyph OR'd ( | ) with the bit-mask A_ALTCHARSET. If no line drawing character is available for that glyph, a standard ASCII character that approximates the glyph is stored in its place. For example, the default character for ACS_HLINE, a horizontal line, is a - (minus sign). When a close approximation is not available, a + (plus sign) is used. All the standard ACS_ names and their defaults are listed on the curses(3ocurses) manual pages.

Part of an example program that uses line drawing characters follows. The example uses the ETI routine box to draw a box around a menu on a screen. box uses the line drawing characters by default or when ``|'' (the pipe) and ``-'' are chosen. Up and down more indicators are drawn on the box border (using ACS_UARROW and ACS_DARROW) if the menu contained within the box continues above or below the screen:

   box(menuwin, ACS_VLINE, ACS_HLINE);
    ...
   

/* output the up/down arrows */ wmove(menuwin, maxy, maxx - 5);

/* output up arrow or horizontal line */ if (moreabove) waddch(menuwin, ACS_UARROW); else addch(menuwin, ACS_HLINE);

/*output down arrow or horizontal line */ if (morebelow) waddch(menuwin, ACS_DARROW); else waddch(menuwin, ACS_HLINE);

Here is another example. Because a default down arrow (like the lowercase letter v) is not very discernible on a screen with many lowercase characters on it, you can change it to an uppercase V.

   if ( ! (ACS_DARROW & A_ALTCHARSET))
      ACS_DARROW = 'V';

For more information, see the curses(3ocurses) page.


Next topic: Routines for using soft labels
Previous topic: Other ETI routines

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004