summaryrefslogtreecommitdiff
path: root/src/fltk_binding/fltk-widgets-buttons-radio.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk_binding/fltk-widgets-buttons-radio.adb')
-rw-r--r--src/fltk_binding/fltk-widgets-buttons-radio.adb21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/fltk_binding/fltk-widgets-buttons-radio.adb b/src/fltk_binding/fltk-widgets-buttons-radio.adb
index 4a26178..8ca6f44 100644
--- a/src/fltk_binding/fltk-widgets-buttons-radio.adb
+++ b/src/fltk_binding/fltk-widgets-buttons-radio.adb
@@ -10,7 +10,7 @@ package body FLTK.Widgets.Buttons.Radio is
function new_fl_radio_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_button, "new_fl_radio_button");
@@ -24,8 +24,11 @@ package body FLTK.Widgets.Buttons.Radio is
procedure Finalize
(This : in out Radio_Button) is
begin
- if (This.Void_Ptr /= System.Null_Address) then
- free_fl_radio_button (This.Void_Ptr);
+ Finalize (Button (This));
+ if This.Void_Ptr /= System.Null_Address then
+ if This in Radio_Button then
+ free_fl_radio_button (This.Void_Ptr);
+ end if;
end if;
end Finalize;
@@ -34,19 +37,17 @@ package body FLTK.Widgets.Buttons.Radio is
function Create
(X, Y, W, H : in Integer;
- Label : in String)
+ Text : in String)
return Radio_Button is
-
- VP : System.Address;
-
begin
- VP := new_fl_radio_button
+ return This : Radio_Button do
+ This.Void_Ptr := new_fl_radio_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;