summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-windows.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-13 12:29:26 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-13 12:29:26 +1300
commit74cb50a7f7e14cec7195d30e50b76e17969c9e62 (patch)
tree4d3941218bb7099bb317fbbb88dfb698a990161b /src/fltk-widgets-groups-windows.adb
parent36302e60475e3531d5034fd97cc87aabb9fbd588 (diff)
Help_Dialog now has Show_With_Args
Diffstat (limited to 'src/fltk-widgets-groups-windows.adb')
-rw-r--r--src/fltk-widgets-groups-windows.adb41
1 files changed, 3 insertions, 38 deletions
diff --git a/src/fltk-widgets-groups-windows.adb b/src/fltk-widgets-groups-windows.adb
index afd17ae..b79f937 100644
--- a/src/fltk-widgets-groups-windows.adb
+++ b/src/fltk-widgets-groups-windows.adb
@@ -8,7 +8,8 @@ with
Ada.Command_Line,
Interfaces.C.Strings,
- FLTK.Images.RGB;
+ FLTK.Images.RGB,
+ FLTK.Show_Argv;
use type
@@ -299,42 +300,6 @@ package body FLTK.Widgets.Groups.Windows is
- ------------------------
- -- Internal Utility --
- ------------------------
-
- function Create_Argv
- return Interfaces.C.Strings.chars_ptr_array
- is
- package ICS renames Interfaces.C.Strings;
- package ACom renames Ada.Command_Line;
-
- Result : ICS.chars_ptr_array (0 .. Interfaces.C.size_t (ACom.Argument_Count));
- begin
- Result (0) := ICS.New_String (ACom.Command_Name);
- for Index in Integer range 1 .. ACom.Argument_Count loop
- Result (Interfaces.C.size_t (Index)) := ICS.New_String (ACom.Argument (Index));
- end loop;
- return Result;
- end Create_Argv;
-
-
- procedure Dispatch_Show_With_Args
- (Func : in Show_With_Args_Func;
- CObj : in Storage.Integer_Address)
- is
- Argv : Interfaces.C.Strings.chars_ptr_array := Create_Argv;
- begin
- Func (CObj, Interfaces.C.int (Ada.Command_Line.Argument_Count + 1),
- Storage.To_Integer (Argv (Argv'First)'Address));
- for Ptr of Argv loop
- Interfaces.C.Strings.Free (Ptr);
- end loop;
- end Dispatch_Show_With_Args;
-
-
-
-
-------------------
-- Destructors --
-------------------
@@ -432,7 +397,7 @@ package body FLTK.Widgets.Groups.Windows is
procedure Show_With_Args
(This : in out Window) is
begin
- Dispatch_Show_With_Args (fl_window_show2'Access, This.Void_Ptr);
+ FLTK.Show_Argv.Dispatch (fl_window_show2'Access, This.Void_Ptr);
end Show_With_Args;