From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6842d1c8d79ec39 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-09 11:09:45 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!petbe.visi.com!news.octanews.net!news.maxwell.syr.edu!newspeer1.nwr.nac.net!news.worldonline.be!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Line and Column size Date: 09 Feb 2004 20:08:52 +0100 Organization: Worldonline Belgium Sender: lbrenta@lbrenta Message-ID: References: NNTP-Posting-Host: ppp-62-235-82-24.tiscali.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.worldonline.be 1076353781 16893 62.235.82.24 (9 Feb 2004 19:09:41 GMT) X-Complaints-To: abuse@worldonline.be NNTP-Posting-Date: Mon, 9 Feb 2004 19:09:41 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:5373 Date: 2004-02-09T20:08:52+01:00 List-Id: 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.