comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: Line and Column size
Date: 09 Feb 2004 20:08:52 +0100
Date: 2004-02-09T20:08:52+01:00	[thread overview]
Message-ID: <m3oes8ul2z.fsf@insalien.org> (raw)
In-Reply-To: ef0e5520.0402091027.32c24f0b@posting.google.com

wjr17@attbi.com (Bill) writes:
[Calling curses' initscr() to know the terminal width and height]
> Now the C code returns the line and column numbers perfectly. However
> it seems that when curses runs, it changes the screen, or does
> something, because my TUI code no longer displays properly. The
> terminal window seems to act wierd after my program exits.
> So I was wondering if anyone knew what might be wrong or I'm not doing
> that I should be in the C code, or if there is a better way to go
> about doing what I'm doing. Maybe there is a library package for ADA95
> that already does what I want it to, but I have just not found it yet.
> Thanks for the help.

Yes, initscr() changes the screen and resets the cursor and stuff.

Maybe you should consider doing an ioctl yourself; that's what
initscr() does to get the size of the terminal:

at ncurses/tinfo/lib_setup.c:151:
ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size)

Look for documentation about ioctl.

Also, FWIW, the ncurses source tarball comes with an Ada binding.

HTH

-- 
Ludovic Brenta.



      reply	other threads:[~2004-02-09 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-09 18:27 Line and Column size Bill
2004-02-09 19:08 ` Ludovic Brenta [this message]
replies disabled

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