]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/ncurses2-util.adb
ncurses 5.9 - patch 20140412
[ncurses.git] / Ada95 / samples / ncurses2-util.adb
index 907dcef9c7aa846a53c9607f61c33d395321ba4b..8ae327242ba439e1d77a9735eebdc46bc4b5a36d 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.7 $
+--  $Date: 2008/07/26 18:51:20 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
-with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-
-with Ada.Text_IO;
+with Ada.Text_IO; use Ada.Text_IO;
 
-with Terminal_Interface.Curses; use Terminal_Interface.Curses;
 pragma Warnings (Off);
 with Terminal_Interface.Curses.Aux;
 pragma Warnings (On);
 
 with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace;
 
-with Ada.Text_IO; use Ada.Text_IO;
-
 with Interfaces.C;
 with Interfaces.C.Strings;
 
@@ -58,7 +54,6 @@ with Ada.Characters.Handling;
 
 with ncurses2.genericPuts;
 
-
 package body ncurses2.util is
 
    --  #defines from C
@@ -104,12 +99,12 @@ package body ncurses2.util is
    end Getchar;
 
    procedure Getchar (win : Window := Standard_Window) is
-      x : Key_Code;
    begin
-      x := Getchar (win);
+      if Getchar (win) < 0 then
+         Beep;
+      end if;
    end Getchar;
 
-
    procedure Pause is
    begin
       Move_Cursor (Line => Lines - 1, Column => 0);
@@ -117,7 +112,6 @@ package body ncurses2.util is
       Getchar;
    end Pause;
 
-
    procedure Cannot (s : String) is
       use Interfaces.C;
       use Interfaces.C.Strings;
@@ -161,8 +155,6 @@ package body ncurses2.util is
       Refresh;
    end ShellOut;
 
-
-
    function Is_Digit (c : Key_Code) return Boolean is
    begin
       if c >= 16#100# then
@@ -178,7 +170,6 @@ package body ncurses2.util is
       Add (Ch => newl);
    end P;
 
-
    function Code_To_Char (c : Key_Code) return Character is
    begin
       if c > Character'Pos (Character'Last) then