diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-07-15 22:20:30 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-07-15 22:20:30 +1000 |
commit | f419b275ee91792e08f211a588d891c4aa6bedac (patch) | |
tree | d882ff43970b292fc75f937c0136078f68c867a5 /fltk-widgets-groups-windows-single.adb | |
parent | f15e45791a0658fd5a062629f59c4815ce8b2489 (diff) |
Groups and Widgets should now keep track of themselves properly, also all named access types removed
Diffstat (limited to 'fltk-widgets-groups-windows-single.adb')
-rw-r--r-- | fltk-widgets-groups-windows-single.adb | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/fltk-widgets-groups-windows-single.adb b/fltk-widgets-groups-windows-single.adb index e3b6f79..7a9cd32 100644 --- a/fltk-widgets-groups-windows-single.adb +++ b/fltk-widgets-groups-windows-single.adb @@ -10,7 +10,7 @@ package body FLTK.Widgets.Groups.Windows.Single is function new_fl_single_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_single_window, "new_fl_single_window"); @@ -44,8 +44,11 @@ package body FLTK.Widgets.Groups.Windows.Single is procedure Finalize (This : in out Single_Window) is begin - if (This.Void_Ptr /= System.Null_Address) then - free_fl_single_window (This.Void_Ptr); + Finalize (Window (This)); + if This.Void_Ptr /= System.Null_Address then + if This in Single_Window then + free_fl_single_window (This.Void_Ptr); + end if; end if; end Finalize; @@ -54,20 +57,18 @@ package body FLTK.Widgets.Groups.Windows.Single is function Create (X, Y, W, H : in Integer; - Label : in String) + Text : in String) return Single_Window is - - VP : System.Address; - begin - VP := new_fl_single_window + return This : Single_Window do + This.Void_Ptr := new_fl_single_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; @@ -76,33 +77,31 @@ package body FLTK.Widgets.Groups.Windows.Single is function Create (W, H : in Integer) return Single_Window is - - VP : System.Address; - begin - VP := new_fl_single_window2 + return This : Single_Window do + This.Void_Ptr := new_fl_single_window2 (Interfaces.C.int (W), Interfaces.C.int (H)); - fl_group_end (VP); - return (Ada.Finalization.Limited_Controlled with Void_Ptr => VP); + fl_group_end (This.Void_Ptr); + end return; end Create; procedure Show - (S : in Single_Window) is + (This : in Single_Window) is begin - fl_single_window_show (S.Void_Ptr); + fl_single_window_show (This.Void_Ptr); end Show; procedure Flush - (S : in out Single_Window) is + (This : in out Single_Window) is begin - fl_single_window_flush (S.Void_Ptr); + fl_single_window_flush (This.Void_Ptr); end Flush; |