Path: utzoo!attcan!sobeco!mfp From: mfp@sobeco.UUCP (Mark F. Proudman) Newsgroups: comp.unix.questions Subject: Re: Curses: Drawing Boxes -- sending control chars Summary: Drawing boxes with curses Message-ID: <338@sobeco.UUCP> Date: 27 Aug 88 19:28:56 GMT References: <873@wpg.UUCP> Organization: Sobeco Group - Montreal, Canada Lines: 26 In article <873@wpg.UUCP>, russ@wpg.UUCP (Russell Lawrence) writes: > > The curses box() function draws crude boxes around windows using ascii > characters like '|' and '-' that are passed to the function as > arguments. By contrast, I'd like to write a better box drawing routine > that would take advantage of box drawing graphics capabilities on some > terminals. Unfortunately, the terminfo definitions don't include any I have just written a menu handler, to run on vt[123]xx terminals. The attribute bits of each curses displayed character include one #defined as A_PROTECT. Normally useless; I changed the terminfo sgr string so that A_PROTECT (p8 I think) invokes a change to graphics character set sequence. When I want a graphic, I just addch the ascii equivalent, with A_PROTECT on. Of course, your box routine will have to know which character position each graphic is in. Possibly download a DEC compatible graphic character set, if your terminals don't have one. Or implement your idea of a database of graphic characters: Having stolen an attribute bit, you won't need escape sequences in the database. Or simply put a lot of if's in your code (gross, non portable but effective). Mark Proudman uunet!attcan!sobeco!mfp (514) 878 9090 "It is agreed that the ice is thin here" - K&R.