summaryrefslogtreecommitdiff
path: root/src/fltk_binding/fltk-widgets-groups-windows.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk_binding/fltk-widgets-groups-windows.adb')
-rw-r--r--src/fltk_binding/fltk-widgets-groups-windows.adb39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/fltk_binding/fltk-widgets-groups-windows.adb b/src/fltk_binding/fltk-widgets-groups-windows.adb
index 806ebf3..c9d01f3 100644
--- a/src/fltk_binding/fltk-widgets-groups-windows.adb
+++ b/src/fltk_binding/fltk-widgets-groups-windows.adb
@@ -10,7 +10,7 @@ package body FLTK.Widgets.Groups.Windows is
function new_fl_window
(X, Y, W, H : in Interfaces.C.int;
- Label : in Interfaces.C.char_array)
+ Text : in Interfaces.C.char_array)
return System.Address;
pragma Import (C, new_fl_window, "new_fl_window");
@@ -40,8 +40,11 @@ package body FLTK.Widgets.Groups.Windows is
procedure Finalize
(This : in out Window) is
begin
- if (This.Void_Ptr /= System.Null_Address) then
- free_fl_window (This.Void_Ptr);
+ Finalize (Group (This));
+ if This.Void_Ptr /= System.Null_Address then
+ if This in Window then
+ free_fl_window (This.Void_Ptr);
+ end if;
end if;
end Finalize;
@@ -50,20 +53,18 @@ package body FLTK.Widgets.Groups.Windows is
function Create
(X, Y, W, H : in Integer;
- Label : in String)
+ Text : in String)
return Window is
-
- VP : System.Address;
-
begin
- VP := new_fl_window
+ return This : Window do
+ This.Void_Ptr := new_fl_window
(Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
- Interfaces.C.To_C (Label));
- fl_group_end (VP);
- return (Ada.Finalization.Limited_Controlled with Void_Ptr => VP);
+ Interfaces.C.To_C (Text));
+ fl_group_end (This.Void_Ptr);
+ end return;
end Create;
@@ -72,22 +73,22 @@ package body FLTK.Widgets.Groups.Windows is
function Create
(W, H : in Integer)
return Window is
-
- VP : System.Address;
-
begin
- VP := new_fl_window2 (Interfaces.C.int (W), Interfaces.C.int (H));
- fl_group_end (VP);
- return (Ada.Finalization.Limited_Controlled with Void_Ptr => VP);
+ return This : Window do
+ This.Void_Ptr := new_fl_window2
+ (Interfaces.C.int (W),
+ Interfaces.C.int (H));
+ fl_group_end (This.Void_Ptr);
+ end return;
end Create;
procedure Show
- (W : in Window) is
+ (This : in Window) is
begin
- fl_window_show (W.Void_Ptr);
+ fl_window_show (This.Void_Ptr);
end Show;