diff options
Diffstat (limited to 'src/fltk-widgets-boxes.adb')
-rw-r--r-- | src/fltk-widgets-boxes.adb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/fltk-widgets-boxes.adb b/src/fltk-widgets-boxes.adb index ed61168..a2d2335 100644 --- a/src/fltk-widgets-boxes.adb +++ b/src/fltk-widgets-boxes.adb @@ -12,10 +12,20 @@ package body FLTK.Widgets.Boxes is (W, D : in System.Address); pragma Import (C, box_set_draw_hook, "box_set_draw_hook"); + procedure box_set_handle_hook + (W, H : in System.Address); + pragma Import (C, box_set_handle_hook, "box_set_handle_hook"); + procedure fl_box_draw (W : in System.Address); pragma Import (C, fl_box_draw, "fl_box_draw"); + function fl_box_handle + (W : in System.Address; + E : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, fl_box_handle, "fl_box_handle"); + function new_fl_box (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) @@ -55,6 +65,18 @@ package body FLTK.Widgets.Boxes is + function Handle + (This : in out Box; + Event : in Event_Kind) + return Event_Outcome is + begin + return Event_Outcome'Val + (fl_box_handle (This.Void_Ptr, Event_Kind'Pos (Event))); + end Handle; + + + + procedure Finalize (This : in out Box) is begin @@ -86,6 +108,7 @@ package body FLTK.Widgets.Boxes is (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); box_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); + box_set_handle_hook (This.Void_Ptr, Handle_Hook'Address); end return; end Create; |