diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-14 01:54:17 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-14 01:54:17 +1300 |
commit | 1ba99737bca1136170f04b3a46659deb042e3fcd (patch) | |
tree | 9b42991aa5aed8c76abcd1bf5ba980e249f0de28 /src/fltk-widgets-groups-text_displays-text_editors.adb | |
parent | 88ca2ea14ba6651404cd4ea347ac8f06afdd0558 (diff) |
Fixed a number of issues with getting the Ada wrapper back given a C++ widget pointer
Diffstat (limited to 'src/fltk-widgets-groups-text_displays-text_editors.adb')
-rw-r--r-- | src/fltk-widgets-groups-text_displays-text_editors.adb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fltk-widgets-groups-text_displays-text_editors.adb b/src/fltk-widgets-groups-text_displays-text_editors.adb index c3fea47..636e368 100644 --- a/src/fltk-widgets-groups-text_displays-text_editors.adb +++ b/src/fltk-widgets-groups-text_displays-text_editors.adb @@ -356,14 +356,16 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is E : in Storage.Integer_Address) return Interfaces.C.int is - Ada_Editor : access Text_Editor'Class := - Editor_Convert.To_Pointer (Storage.To_Address (fl_widget_get_user_data (E))); + Editor_Ptr : Storage.Integer_Address := fl_widget_get_user_data (E); + Ada_Editor : access Text_Editor'Class; Modi : Modifier := FLTK.Event.Last_Modifier; Actual_Key : Keypress := FLTK.Event.Last_Key; -- fuck you FLTK, give me the real code Ada_Key : Key_Combo := To_Ada (To_C (Actual_Key) + To_C (Modi)); Found_Binding : Boolean := False; begin + pragma Assert (Editor_Ptr /= Null_Pointer); + Ada_Editor := Editor_Convert.To_Pointer (Storage.To_Address (Editor_Ptr)); for B of Ada_Editor.Bindings loop if B.Key = Ada_Key then B.Func (Ada_Editor.all); |