diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-05-01 12:49:40 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-05-01 12:49:40 +1000 |
commit | e9dc75679fcac3bf2024e47641941d0a5ef0899d (patch) | |
tree | 49081bd61ecf5aa074b3a59340d9e56eb3d0a2d2 /src/fltk-widgets-inputs-int.adb | |
parent | 9348c8013431bbd5de165d8fbac13b783d983324 (diff) |
Draw method implemented for Boxes/Inputs
Diffstat (limited to 'src/fltk-widgets-inputs-int.adb')
-rw-r--r-- | src/fltk-widgets-inputs-int.adb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/fltk-widgets-inputs-int.adb b/src/fltk-widgets-inputs-int.adb index 30f3d01..42cb22b 100644 --- a/src/fltk-widgets-inputs-int.adb +++ b/src/fltk-widgets-inputs-int.adb @@ -8,6 +8,14 @@ use type System.Address; package body FLTK.Widgets.Inputs.Int is + procedure int_input_set_draw_hook + (W, D : in System.Address); + pragma Import (C, int_input_set_draw_hook, "int_input_set_draw_hook"); + + procedure fl_int_input_draw + (W : in System.Address); + pragma Import (C, fl_int_input_draw, "fl_int_input_draw"); + function new_fl_int_input (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) @@ -26,6 +34,30 @@ package body FLTK.Widgets.Inputs.Int is + procedure Draw_Hook (U : in System.Address); + pragma Convention (C, Draw_Hook); + + procedure Draw_Hook + (U : in System.Address) + is + Ada_Input : access Integer_Input'Class := + Integer_Input_Convert.To_Pointer (U); + begin + Ada_Input.Draw; + end Draw_Hook; + + + + + procedure Draw + (This : in out Integer_Input) is + begin + fl_int_input_draw (This.Void_Ptr); + end Draw; + + + + procedure Finalize (This : in out Integer_Input) is begin @@ -55,6 +87,7 @@ package body FLTK.Widgets.Inputs.Int is fl_widget_set_user_data (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); + int_input_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); end return; end Create; |