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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.N5M2DXr2fJIsm61cKlUWUQ.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: hello world ada-ncurses new_window Date: Fri, 08 Nov 2019 09:07:08 +0000 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: N5M2DXr2fJIsm61cKlUWUQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:nee2U4zDV5yuNpByeuyJiu0e0fU= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:57520 Date: 2019-11-08T09:07:08+00:00 List-Id: Alain De Vos writes: > Exception: > raised TERMINAL_INTERFACE.CURSES.CURSES_EXCEPTION : terminal_interface-curses.adb:117 If you compile with -g (enable debug) and run under the debugger (start by saying "catch exception") you will find that the first exception is actually raised at terminal_interface-curses.adb:248, in Create: W := Newwin (C_Int (Number_Of_Lines), C_Int (Number_Of_Columns), C_Int (First_Line_Position), C_Int (First_Column_Position)); if W = Null_Window then raise Curses_Exception; end if; A couple of points: About the library: it'd have been easier on us if you'd said raise Curses_Exception with "Create: unable to create window"; About your code: when you're starting off with an experiment, why bother to catch exceptions and report them in a way that masks any attempt by the library writer to help you solve problems? Just let the exception happen. With any luck you'll get a stack trace that'll quickly lead you to the immediate cause of the problem. In your case, the exception happened at terminal_interface-curses.adb:117, in End_Windows: if Endwin = Curses_Err then raise Curses_Exception; end if; and End_Windows was called from your exception handler! doubly masking the reason for the exception. ==== As to why you're getting this problem, I don't know at all. Perhaps you need to initialize ncurses? -- just guessing.