From f4b68da1d14d39ab4140d8c5e7fbbf45525e7e77 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 13 May 2017 23:05:47 +1000 Subject: Text_Editor, Text_Display, Double_Window, Single_Window, Menu_Window, Window, Group widgets all now have Handle methods --- src/fltk-widgets-groups-text_displays.adb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/fltk-widgets-groups-text_displays.adb') diff --git a/src/fltk-widgets-groups-text_displays.adb b/src/fltk-widgets-groups-text_displays.adb index 9c571d3..e805ff5 100644 --- a/src/fltk-widgets-groups-text_displays.adb +++ b/src/fltk-widgets-groups-text_displays.adb @@ -13,10 +13,20 @@ package body FLTK.Widgets.Groups.Text_Displays is (W, D : in System.Address); pragma Import (C, text_display_set_draw_hook, "text_display_set_draw_hook"); + procedure text_display_set_handle_hook + (W, H : in System.Address); + pragma Import (C, text_display_set_handle_hook, "text_display_set_handle_hook"); + procedure fl_text_display_draw (W : in System.Address); pragma Import (C, fl_text_display_draw, "fl_text_display_draw"); + function fl_text_display_handle + (W : in System.Address; + E : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, fl_text_display_handle, "fl_text_display_handle"); + function new_fl_text_display (X, Y, W, H : in Interfaces.C.int; Label : in Interfaces.C.char_array) @@ -140,6 +150,18 @@ package body FLTK.Widgets.Groups.Text_Displays is + function Handle + (This : in out Text_Display; + Event : in Event_Kind) + return Event_Outcome is + begin + return Event_Outcome'Val + (fl_text_display_handle (This.Void_Ptr, Event_Kind'Pos (Event))); + end Handle; + + + + procedure Finalize (This : in out Text_Display) is begin @@ -173,6 +195,7 @@ package body FLTK.Widgets.Groups.Text_Displays is (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); text_display_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); + text_display_set_handle_hook (This.Void_Ptr, Handle_Hook'Address); end return; end Create; -- cgit