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-windows-double-cairo.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-windows-double-cairo.adb')
-rw-r--r-- | src/fltk-widgets-groups-windows-double-cairo.adb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fltk-widgets-groups-windows-double-cairo.adb b/src/fltk-widgets-groups-windows-double-cairo.adb index 75cf50a..eedcbd1 100644 --- a/src/fltk-widgets-groups-windows-double-cairo.adb +++ b/src/fltk-widgets-groups-windows-double-cairo.adb @@ -6,6 +6,7 @@ with + Ada.Assertions, Interfaces.C, System.Address_To_Access_Conversions; @@ -13,6 +14,11 @@ with package body FLTK.Widgets.Groups.Windows.Double.Cairo is + package Chk renames Ada.Assertions; + + + + ------------------------ -- Functions From C -- ------------------------ @@ -74,9 +80,12 @@ package body FLTK.Widgets.Groups.Windows.Double.Cairo is Ada_Object : access Cairo_Window'Class := Cairo_Convert.To_Pointer (Ada_Addr); begin + pragma Assert (Ada_Object /= null); if Ada_Object.My_Func /= null then Ada_Object.My_Func (Cairo_Window (Ada_Object.all), Storage.To_Address (Cairo_Addr)); end if; + exception + when Chk.Assertion_Error => raise Internal_FLTK_Error; end Cairo_Draw_Hook; |