summaryrefslogtreecommitdiff
path: root/src/adapad.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/adapad.adb')
-rw-r--r--src/adapad.adb35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/adapad.adb b/src/adapad.adb
index 7aab4af..2f4c483 100644
--- a/src/adapad.adb
+++ b/src/adapad.adb
@@ -5,19 +5,50 @@ with Editors;
use Editors;
with FLTK.Text_Buffers;
use FLTK.Text_Buffers;
--- with FLTK.Widgets.Menus.Menu_Bars;
+with FLTK.Widgets;
+use FLTK.Widgets;
+with FLTK.Widgets.Menus;
+use FLTK.Widgets.Menus;
+
+
+with Ada.Text_IO;
function AdaPad return Integer is
- Pad : Editor_Window := Create (0, 0, 640, 400, "AdaPad");
+ Pad : aliased Editor_Window := Create (0, 0, 640, 400, "AdaPad");
Buffer : Text_Buffer := Create;
+ type Editor_Callback is abstract new Widget_Callback with
+ record
+ Editor : access Editor_Window;
+ end record;
+
+
+ type Open_Callback is new Editor_Callback with null record;
+ Open_CB : aliased Open_Callback := (Editor => Pad'Access);
+
+
+ overriding procedure Call
+ (This : in Open_Callback;
+ Item : in out Widget'Class) is
+ begin
+ Ada.Text_IO.Put_Line ("Open callback executed.");
+ end Call;
+
+
begin
+ declare
+ Bar : Menu_Cursor := Pad.Get_Menu;
+ begin
+ Bar.Add ("File/Open", Open_CB'Access);
+ end;
+
+
Pad.Set_Buffer (Buffer);
Pad.Show;
return FLTK.Run;