1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding Samples --
5 -- Sample.Menu_Demo.Handler --
11 -- The ncurses Ada95 binding is copyrighted 1996 by --
12 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
14 -- Permission is hereby granted to reproduce and distribute this --
15 -- binding by any means and for any fee, whether alone or as part --
16 -- of a larger distribution, in source or in binary form, PROVIDED --
17 -- this notice is included with any such distribution, and is not --
18 -- removed from any of its header files. Mention of ncurses and the --
19 -- author of this binding in any applications linked with it is --
20 -- highly appreciated. --
22 -- This binding comes AS IS with no warranty, implied or expressed. --
23 ------------------------------------------------------------------------------
26 ------------------------------------------------------------------------------
27 with Sample.Menu_Demo.Aux;
28 with Sample.Explanation; use Sample.Explanation;
30 package body Sample.Menu_Demo.Handler is
32 package Aux renames Sample.Menu_Demo.Aux;
34 procedure Drive_Me (M : in Menu;
35 Title : in String := "")
42 Aux.Geometry (M, L, C, Y, X);
43 Drive_Me (M, Y, X, Title);
46 procedure Drive_Me (M : in Menu;
47 Lin : in Line_Position;
48 Col : in Column_Position;
49 Title : in String := "")
51 Pan : Panel := Aux.Create (M, Title, Lin, Col);
52 V : Cursor_Visibility := Invisible;
54 Set_Cursor_Visibility (V);
57 K : Key_Code := Aux.Get_Request (M, Pan);
58 R : Driver_Result := Driver (M, K);
62 when Unknown_Request =>
63 if My_Driver (M, K, Pan) then
70 Set_Cursor_Visibility (V);
74 end Sample.Menu_Demo.Handler;