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.adb | |
parent | 9348c8013431bbd5de165d8fbac13b783d983324 (diff) |
Draw method implemented for Boxes/Inputs
Diffstat (limited to 'src/fltk-widgets-inputs.adb')
-rw-r--r-- | src/fltk-widgets-inputs.adb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/fltk-widgets-inputs.adb b/src/fltk-widgets-inputs.adb index 9af8e87..83420ff 100644 --- a/src/fltk-widgets-inputs.adb +++ b/src/fltk-widgets-inputs.adb @@ -9,6 +9,14 @@ use type System.Address; package body FLTK.Widgets.Inputs is + procedure input_set_draw_hook + (W, D : in System.Address); + pragma Import (C, input_set_draw_hook, "input_set_draw_hook"); + + procedure fl_input_draw + (W : in System.Address); + pragma Import (C, fl_input_draw, "fl_input_draw"); + function new_fl_input (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) @@ -27,6 +35,30 @@ package body FLTK.Widgets.Inputs is + procedure Draw_Hook (U : in System.Address); + pragma Convention (C, Draw_Hook); + + procedure Draw_Hook + (U : in System.Address) + is + Ada_Input : access Input'Class := + Input_Convert.To_Pointer (U); + begin + Ada_Input.Draw; + end Draw_Hook; + + + + + procedure Draw + (This : in out Input) is + begin + fl_input_draw (This.Void_Ptr); + end Draw; + + + + procedure Finalize (This : in out Input) is begin @@ -56,6 +88,7 @@ package body FLTK.Widgets.Inputs is fl_widget_set_user_data (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); + input_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); end return; end Create; |