From bfcc3811a3ce55cafa6f7809d0d92c87238ea032 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 15 Sep 2016 03:41:54 +1000 Subject: Menu callbacks working, also some quick testing code that'll probably get deleted later because wynaut --- src/editors.adb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/editors.adb') diff --git a/src/editors.adb b/src/editors.adb index 3cdfa5f..9400016 100644 --- a/src/editors.adb +++ b/src/editors.adb @@ -10,8 +10,10 @@ package body Editors is begin return This : Editor_Window := (Double_Window'(Create (X, Y, W, H, Label_Text)) with - The_Editor => Text_Editor'(Create (0, 30, 640, 370, ""))) do - This.Add (This.The_Editor); + Editor => Text_Editor'(Create (0, 30, 640, 370, "")), + Bar => Menu_Bar'(Create (0, 0, 640, 30, ""))) do + This.Add (This.Editor); + This.Add (This.Bar); end return; end Create; @@ -32,7 +34,7 @@ package body Editors is (This : in Editor_Window) return Text_Buffer_Cursor is begin - return This.The_Editor.Get_Buffer; + return This.Editor.Get_Buffer; end Get_Buffer; @@ -42,9 +44,19 @@ package body Editors is (This : in out Editor_Window; Buff : in out Text_Buffer) is begin - This.The_Editor.Set_Buffer (Buff); + This.Editor.Set_Buffer (Buff); end Set_Buffer; + + + function Get_Menu + (This : in out Editor_Window) + return Menu_Cursor is + begin + return Ref : Menu_Cursor (This.Bar'Access); + end Get_Menu; + + end Editors; -- cgit