aboutsummaryrefslogtreecommitdiff
path: root/body/fltk-widgets.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-29 13:38:11 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-29 13:38:11 +1300
commit82ec0d8c8d1ba164aa2d29c8f1203730aa51988c (patch)
tree5a97b24d2c1325a2563a4cff70f285fd6da34b44 /body/fltk-widgets.adb
parentdee76d5884c6f079ea3a2387d07289534a51a0c1 (diff)
Raises of Internal_FLTK_Error now come with error messages
Diffstat (limited to 'body/fltk-widgets.adb')
-rw-r--r--body/fltk-widgets.adb20
1 files changed, 14 insertions, 6 deletions
diff --git a/body/fltk-widgets.adb b/body/fltk-widgets.adb
index a312641..4518491 100644
--- a/body/fltk-widgets.adb
+++ b/body/fltk-widgets.adb
@@ -800,7 +800,8 @@ package body FLTK.Widgets is
end if;
return Actual_Parent;
exception
- when Chk.Assertion_Error => raise Internal_FLTK_Error;
+ when Chk.Assertion_Error => raise Internal_FLTK_Error with
+ "Widget returned by Fl_Widget::parent has no user_data reference back to Ada";
end Parent;
@@ -836,7 +837,8 @@ package body FLTK.Widgets is
end if;
return Actual_Window;
exception
- when Chk.Assertion_Error => raise Internal_FLTK_Error;
+ when Chk.Assertion_Error => raise Internal_FLTK_Error with
+ "Widget returned by Fl_Widget::window has no user_data reference back to Ada";
end Nearest_Window;
@@ -854,7 +856,8 @@ package body FLTK.Widgets is
end if;
return Actual_Window;
exception
- when Chk.Assertion_Error => raise Internal_FLTK_Error;
+ when Chk.Assertion_Error => raise Internal_FLTK_Error with
+ "Widget returned by Fl_Widget::top_window has no user_data reference back to Ada";
end Top_Window;
@@ -876,7 +879,8 @@ package body FLTK.Widgets is
end if;
return Actual_Window;
exception
- when Chk.Assertion_Error => raise Internal_FLTK_Error;
+ when Chk.Assertion_Error => raise Internal_FLTK_Error with
+ "Widget returned by Fl_Widget::top_window_offset has no user_data reference back to Ada";
end Top_Window_Offset;
@@ -1269,10 +1273,14 @@ package body FLTK.Widgets is
return Interfaces.C.int;
for my_handle'Address use This.Handle_Ptr;
pragma Import (Ada, my_handle);
+
+ Result : Interfaces.C.int := my_handle (This.Void_Ptr, Event_Kind'Pos (Event));
begin
- return Event_Outcome'Val (my_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
+ return Event_Outcome'Val (Result);
exception
- when Constraint_Error => raise Internal_FLTK_Error;
+ when Constraint_Error => raise Internal_FLTK_Error with
+ "Dispatched handle function returned unexpected int value of " &
+ Interfaces.C.int'Image (Result);
end Handle;