From 157f44ff7034212a29696c5bb2b87e4f6f20d625 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Thu, 16 Jan 2025 23:44:10 +1300 Subject: Added convenience widget constructors that specify the parent group to add to --- src/fltk-widgets-boxes.adb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/fltk-widgets-boxes.adb') diff --git a/src/fltk-widgets-boxes.adb b/src/fltk-widgets-boxes.adb index 7b4c848..e412131 100644 --- a/src/fltk-widgets-boxes.adb +++ b/src/fltk-widgets-boxes.adb @@ -6,6 +6,7 @@ with + FLTK.Widgets.Groups, Interfaces.C; @@ -117,6 +118,18 @@ package body FLTK.Widgets.Boxes is end Create; + function Create + (Parent : in out FLTK.Widgets.Groups.Group'Class; + X, Y, W, H : in Integer; + Text : in String := "") + return Box is + begin + return This : Box := Create (X, Y, W, H, Text) do + Parent.Add (This); + end return; + end Create; + + function Create (Kind : in Box_Kind; X, Y, W, H : in Integer; @@ -135,6 +148,19 @@ package body FLTK.Widgets.Boxes is end return; end Create; + + function Create + (Parent : in out FLTK.Widgets.Groups.Group'Class; + Kind : in Box_Kind; + X, Y, W, H : in Integer; + Text : in String := "") + return Box is + begin + return This : Box := Create (Kind, X, Y, W, H, Text) do + Parent.Add (This); + end return; + end Create; + end Forge; -- cgit