summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-wizards.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-14 01:54:17 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-14 01:54:17 +1300
commit1ba99737bca1136170f04b3a46659deb042e3fcd (patch)
tree9b42991aa5aed8c76abcd1bf5ba980e249f0de28 /src/fltk-widgets-groups-wizards.adb
parent88ca2ea14ba6651404cd4ea347ac8f06afdd0558 (diff)
Fixed a number of issues with getting the Ada wrapper back given a C++ widget pointer
Diffstat (limited to 'src/fltk-widgets-groups-wizards.adb')
-rw-r--r--src/fltk-widgets-groups-wizards.adb19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/fltk-widgets-groups-wizards.adb b/src/fltk-widgets-groups-wizards.adb
index 658bf55..0f60c46 100644
--- a/src/fltk-widgets-groups-wizards.adb
+++ b/src/fltk-widgets-groups-wizards.adb
@@ -6,12 +6,18 @@
with
+ Ada.Assertions,
Interfaces.C;
package body FLTK.Widgets.Groups.Wizards is
+ package Chk renames Ada.Assertions;
+
+
+
+
------------------------
-- Functions From C --
------------------------
@@ -165,12 +171,17 @@ package body FLTK.Widgets.Groups.Wizards is
(This : in Wizard)
return access Widget'Class
is
- Widget_Ptr : Storage.Integer_Address :=
- fl_wizard_get_visible (This.Void_Ptr);
- Actual_Widget : access Widget'Class :=
- Widget_Convert.To_Pointer (Storage.To_Address (fl_widget_get_user_data (Widget_Ptr)));
+ Visible_Ptr : Storage.Integer_Address := fl_wizard_get_visible (This.Void_Ptr);
+ Actual_Widget : access Widget'Class;
begin
+ if Visible_Ptr /= Null_Pointer then
+ Visible_Ptr := fl_widget_get_user_data (Visible_Ptr);
+ pragma Assert (Visible_Ptr /= Null_Pointer);
+ Actual_Widget := Widget_Convert.To_Pointer (Storage.To_Address (Visible_Ptr));
+ end if;
return Actual_Widget;
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Get_Visible;