summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-buttons-enter.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-widgets-buttons-enter.adb')
-rw-r--r--src/fltk-widgets-buttons-enter.adb45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/fltk-widgets-buttons-enter.adb b/src/fltk-widgets-buttons-enter.adb
index 20ce598..0053e53 100644
--- a/src/fltk-widgets-buttons-enter.adb
+++ b/src/fltk-widgets-buttons-enter.adb
@@ -12,18 +12,9 @@ with
package body FLTK.Widgets.Buttons.Enter is
- procedure return_button_set_draw_hook
- (W, D : in Storage.Integer_Address);
- pragma Import (C, return_button_set_draw_hook, "return_button_set_draw_hook");
- pragma Inline (return_button_set_draw_hook);
-
- procedure return_button_set_handle_hook
- (W, H : in Storage.Integer_Address);
- pragma Import (C, return_button_set_handle_hook, "return_button_set_handle_hook");
- pragma Inline (return_button_set_handle_hook);
-
-
-
+ ------------------------
+ -- Functions From C --
+ ------------------------
function new_fl_return_button
(X, Y, W, H : in Interfaces.C.int;
@@ -55,6 +46,10 @@ package body FLTK.Widgets.Buttons.Enter is
+ -------------------
+ -- Destructors --
+ -------------------
+
procedure Extra_Final
(This : in out Enter_Button) is
begin
@@ -75,6 +70,10 @@ package body FLTK.Widgets.Buttons.Enter is
+ --------------------
+ -- Constructors --
+ --------------------
+
procedure Extra_Init
(This : in out Enter_Button;
X, Y, W, H : in Integer;
@@ -84,6 +83,14 @@ package body FLTK.Widgets.Buttons.Enter is
end Extra_Init;
+ procedure Initialize
+ (This : in out Enter_Button) is
+ begin
+ This.Draw_Ptr := fl_return_button_draw'Address;
+ This.Handle_Ptr := fl_return_button_handle'Address;
+ end Initialize;
+
+
package body Forge is
function Create
@@ -99,10 +106,6 @@ package body FLTK.Widgets.Buttons.Enter is
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
Extra_Init (This, X, Y, W, H, Text);
- return_button_set_draw_hook
- (This.Void_Ptr, Storage.To_Integer (Draw_Hook'Address));
- return_button_set_handle_hook
- (This.Void_Ptr, Storage.To_Integer (Handle_Hook'Address));
end return;
end Create;
@@ -111,10 +114,14 @@ package body FLTK.Widgets.Buttons.Enter is
+ -----------------------
+ -- API Subprograms --
+ -----------------------
+
procedure Draw
(This : in out Enter_Button) is
begin
- fl_return_button_draw (This.Void_Ptr);
+ Button (This).Draw;
end Draw;
@@ -123,10 +130,10 @@ package body FLTK.Widgets.Buttons.Enter is
Event : in Event_Kind)
return Event_Outcome is
begin
- return Event_Outcome'Val
- (fl_return_button_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
+ return Button (This).Handle (Event);
end Handle;
end FLTK.Widgets.Buttons.Enter;
+