aboutsummaryrefslogtreecommitdiff
path: root/body/fltk-asks.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-04-13 18:48:34 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2025-04-13 18:58:07 +1200
commitd80d210d6b1418ba3e773186337c5da7ea169c4e (patch)
tree6226c1c22f62e8dbde08f118147b82c034e6c1f5 /body/fltk-asks.adb
parentfb4183c9244ee31aa5cb8bc9745c9242b1fafeeb (diff)
Proper init of Message_Icon box, some more checks added
Diffstat (limited to 'body/fltk-asks.adb')
-rw-r--r--body/fltk-asks.adb41
1 files changed, 38 insertions, 3 deletions
diff --git a/body/fltk-asks.adb b/body/fltk-asks.adb
index ee32c95..8d4f900 100644
--- a/body/fltk-asks.adb
+++ b/body/fltk-asks.adb
@@ -234,9 +234,9 @@ package body FLTK.Asks is
- ---------------
- -- Cleanup --
- ---------------
+ -------------------
+ -- Destructors --
+ -------------------
procedure Finalize
(This : in out Dialog_String_Final_Controller)
@@ -254,6 +254,21 @@ package body FLTK.Asks is
+ --------------------
+ -- Constructors --
+ --------------------
+
+ -- You can get out of a hole by digging deeper, right?
+ procedure fl_box_extra_init
+ (Ada_Obj : in Storage.Integer_Address;
+ X, Y, W, H : in Interfaces.C.int;
+ C_Str : in Interfaces.C.char_array);
+ pragma Import (C, fl_box_extra_init, "fl_box_extra_init");
+ pragma Inline (fl_box_extra_init);
+
+
+
+
-----------------------
-- API Subprograms --
-----------------------
@@ -369,6 +384,10 @@ package body FLTK.Asks is
Interfaces.C.Strings.Null_Ptr);
begin
return Choice_Result'Val (Result);
+ exception
+ when Constraint_Error => raise Internal_FLTK_Error with
+ "fl_choice returned unexpected int value of " &
+ Interfaces.C.int'Image (Result);
end Choice;
@@ -384,6 +403,10 @@ package body FLTK.Asks is
Interfaces.C.Strings.Null_Ptr);
begin
return Choice_Result'Val (Result);
+ exception
+ when Constraint_Error => raise Internal_FLTK_Error with
+ "fl_choice returned unexpected int value of " &
+ Interfaces.C.int'Image (Result);
end Choice;
@@ -400,6 +423,10 @@ package body FLTK.Asks is
Interfaces.C.Strings.To_Chars_Ptr (Str3'Unchecked_Access));
begin
return Choice_Result'Val (Result);
+ exception
+ when Constraint_Error => raise Internal_FLTK_Error with
+ "fl_choice returned unexpected int value of " &
+ Interfaces.C.int'Image (Result);
end Choice;
@@ -685,6 +712,14 @@ begin
Wrapper (Icon_Box).Void_Ptr := fl_ask_message_icon;
Wrapper (Icon_Box).Needs_Dealloc := False;
+ fl_box_extra_init
+ (Storage.To_Integer (Icon_Box'Address),
+ Interfaces.C.int (Icon_Box.Get_X),
+ Interfaces.C.int (Icon_Box.Get_Y),
+ Interfaces.C.int (Icon_Box.Get_W),
+ Interfaces.C.int (Icon_Box.Get_H),
+ Interfaces.C.To_C (Icon_Box.Get_Label));
+
fl_ask_file_chooser_callback (Storage.To_Integer (File_Chooser_Callback_Hook'Address));