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 | b72f41264d96f6cd9333badad82f978ecdc48fc2 (patch) | |
tree | acf583ae23932244f90e0822ef989ad64d3c9426 /src/fltk_binding/fltk-widgets-buttons-light-radio.adb | |
parent | 29a95cbf34e89274d8556e6f5b9f0e8b447e94c7 (diff) |
Groups and Widgets should now keep track of themselves properly, also all named access types removed
Diffstat (limited to 'src/fltk_binding/fltk-widgets-buttons-light-radio.adb')
-rw-r--r-- | src/fltk_binding/fltk-widgets-buttons-light-radio.adb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/fltk_binding/fltk-widgets-buttons-light-radio.adb b/src/fltk_binding/fltk-widgets-buttons-light-radio.adb index 6f99f05..1c1e0da 100644 --- a/src/fltk_binding/fltk-widgets-buttons-light-radio.adb +++ b/src/fltk_binding/fltk-widgets-buttons-light-radio.adb @@ -10,7 +10,7 @@ package body FLTK.Widgets.Buttons.Light.Radio is function new_fl_radio_light_button (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_radio_light_button, "new_fl_radio_light_button"); @@ -24,8 +24,11 @@ package body FLTK.Widgets.Buttons.Light.Radio is procedure Finalize (This : in out Radio_Light_Button) is begin + Finalize (Light_Button (This)); if (This.Void_Ptr /= System.Null_Address) then - free_fl_radio_light_button (This.Void_Ptr); + if This in Radio_Light_Button then + free_fl_radio_light_button (This.Void_Ptr); + end if; end if; end Finalize; @@ -34,19 +37,17 @@ package body FLTK.Widgets.Buttons.Light.Radio is function Create (X, Y, W, H : in Integer; - Label : in String) + Text : in String) return Radio_Light_Button is - - VP : System.Address; - begin - VP := new_fl_radio_light_button + return This : Radio_Light_Button do + This.Void_Ptr := new_fl_radio_light_button (Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), Interfaces.C.int (H), - Interfaces.C.To_C (Label)); - return (Ada.Finalization.Limited_Controlled with Void_Ptr => VP); + Interfaces.C.To_C (Text)); + end return; end Create; |