summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-buttons.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-05-13 12:35:40 +1000
committerJed Barber <jjbarber@y7mail.com>2017-05-13 12:35:40 +1000
commit1c0ddbf9eeb33f6bedc1fb9156e124b3a7b17bbc (patch)
treed662c3fb080042625696734c194328a78f81de1b /src/fltk-widgets-buttons.adb
parent40d66b087fcf846c84da53c111ecbeb75bdd29ce (diff)
Handle method added for Boxes, Buttons, Widgets
Diffstat (limited to 'src/fltk-widgets-buttons.adb')
-rw-r--r--src/fltk-widgets-buttons.adb23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/fltk-widgets-buttons.adb b/src/fltk-widgets-buttons.adb
index bdc4810..aa9e7f3 100644
--- a/src/fltk-widgets-buttons.adb
+++ b/src/fltk-widgets-buttons.adb
@@ -12,10 +12,20 @@ package body FLTK.Widgets.Buttons is
(W, D : in System.Address);
pragma Import (C, button_set_draw_hook, "button_set_draw_hook");
+ procedure button_set_handle_hook
+ (W, H : in System.Address);
+ pragma Import (C, button_set_handle_hook, "button_set_handle_hook");
+
procedure fl_button_draw
(W : in System.Address);
pragma Import (C, fl_button_draw, "fl_button_draw");
+ function fl_button_handle
+ (W : in System.Address;
+ E : in Interfaces.C.int)
+ return Interfaces.C.int;
+ pragma Import (C, fl_button_handle, "fl_button_handle");
+
function new_fl_button
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
@@ -69,6 +79,18 @@ package body FLTK.Widgets.Buttons is
+ function Handle
+ (This : in out Button;
+ Event : in Event_Kind)
+ return Event_Outcome is
+ begin
+ return Event_Outcome'Val
+ (fl_button_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
+ end Handle;
+
+
+
+
procedure Finalize
(This : in out Button) is
begin
@@ -100,6 +122,7 @@ package body FLTK.Widgets.Buttons is
(This.Void_Ptr,
Widget_Convert.To_Address (This'Unchecked_Access));
button_set_draw_hook (This.Void_Ptr, Draw_Hook'Address);
+ button_set_handle_hook (This.Void_Ptr, Draw_Hook'Address);
end return;
end Create;