comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Subject: Re: Need a gotoXY consol IO procedure for Rational Apex on Sun
Date: Thu, 13 Mar 2003 13:25:29 -0500
Date: 2003-03-13T13:25:29-05:00	[thread overview]
Message-ID: <3E70CD19.2040502@cogeco.ca> (raw)
In-Reply-To: CVQba.57151$F1.1617@sccrnsc04

Jeffrey Creem wrote:
> "�rjan Leringe" <ol@mariadata.se> wrote in message
> news:VeNba.75$Du.631@newsc.telia.net...
> 
>>I need a procedure to do a little more than text_IO on Rational Apex for
>>Sun. Actually the only procedure need is
>>
>>    procedure Goto_XY (X, Y: Integer);
>>
>>which positions the cursor to pos X and row Y (Y can be backwards current
>>position).
> 
> You probably want to use something like ncurses
> 
> http://www.familiepfeifer.de/juergen/ncurses.html

If you are absolutely sure that you only need cursor positioning,
and perhaps one or two other simple functions (like clear screen),
you could get by with curs_termcap(3X) routines, of which you can
build a binding to.

A "man curs_termcap" turns up:

NAME
        tgetent,  tgetflag,  tgetnum,  tgetstr,  tgoto,  tputs  ? direct curses
        interface to the terminfo capability database

SYNOPSIS
        #include <curses.h>
        #include <term.h>
        extern char PC; extern char * UP; extern char * BC; extern unsigned int
        ospeed;
        int tgetent(char *bp, const char *name);
        int tgetflag(char *id);
        int tgetnum(char *id);
        char *tgetstr(char *id, char **area);
        char *tgoto(const char *cap, int col, int row);
        int tputs(const char *str, int affcnt, int (*putc)(int));

The tricky part about some terminal escape sequences is however,
that you need to supply parameters (move cursor is an example).
If you also need to interpret function keys etc., you will
get into even more work, which is probably more than you want.

Without just using a few routines above to control the terminal
directly, you pretty much have to go "whole hog" into [n]curses,
and call initscr() and endwin() and everything else in between.
You can't just use move() from the ncurses library, for example.

If you are doing this for Windows, then PDCurses is available, or
ncurses works (I believe) in a CYGWIN environment.

-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg




  reply	other threads:[~2003-03-13 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-12 21:01 Need a gotoXY consol IO procedure for Rational Apex on Sun �rjan Leringe
2003-03-13  1:12 ` Jeffrey Creem
2003-03-13 18:25   ` Warren W. Gay VE3WWG [this message]
2003-03-15  1:41 ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox