]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/sample.adb
ncurses 6.1 - patch 20180707
[ncurses.git] / Ada95 / samples / sample.adb
index 962963ed1b92c02a59ca8469a0914460dbc40f3d..9b3759f0c53a478a230f4323bd6e5a47075f3529 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2008,2011 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            --
@@ -35,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.14 $
+--  $Revision: 1.18 $
+--  $Date: 2011/03/23 00:44:12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Text_IO;
@@ -110,7 +111,7 @@ package body Sample is
                if K = QUIT then
                   return True;
                elsif K = SELECT_ITEM then
-                  if Idx in 1 .. 4 then
+                  if Idx <= 4 then
                      Hide (Pan);
                      Update_Panels;
                   end if;
@@ -121,7 +122,7 @@ package body Sample is
                      when 4 => Sample.Text_IO_Demo.Demo;
                      when others => null;
                   end case;
-                  if Idx in 1 .. 4 then
+                  if Idx <= 4 then
                      Top (Pan);
                      Show (Pan);
                      Update_Panels;
@@ -142,7 +143,7 @@ package body Sample is
          Ud.Set_User_Data (M, D1);
 
          I1 := new User_Data'(Data => 1174);
-         Id.Set_User_Data (I (1), I1);
+         Id.Set_User_Data (I.all (1), I1);
 
          Set_Spacing (Men => M, Row => 2);
 
@@ -155,7 +156,7 @@ package body Sample is
          pragma Assert (D1 = D2);
          pragma Assert (D1.Data = D2.Data);
 
-         Id.Get_User_Data (I (1), I2);
+         Id.Get_User_Data (I.all (1), I2);
          pragma Assert (I1 = I2);
          pragma Assert (I1.Data = I2.Data);
 
@@ -190,7 +191,7 @@ package body Sample is
 
          Set_Soft_Label_Key_Attributes (Color => Header_Color);
          --  This propagates the attributes to the label window
-         Clear_Soft_Label_Keys; Restore_Soft_Label_Keys;
+         Refresh_Soft_Label_Keys;
       end if;
 
       Init_Keyboard_Handler;
@@ -204,6 +205,7 @@ package body Sample is
       --  We have some fixed key throughout this sample
       Main_Menu;
       End_Windows;
+      Curses_Free_All;
 
    exception
       when Event : others =>