summaryrefslogtreecommitdiff
path: root/fltk-widgets.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2016-11-11 10:53:05 +1100
committerJed Barber <jjbarber@y7mail.com>2016-11-11 10:53:05 +1100
commitcb8ade55fb2f85951e53706de277261b726ecad7 (patch)
tree75d00ddf6bed9696165ebf144f31cc65064d73c1 /fltk-widgets.adb
parentbee437918713d9fc2213a5a554ac02f4e7af3249 (diff)
Simplified widget callbacks
Diffstat (limited to 'fltk-widgets.adb')
-rw-r--r--fltk-widgets.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/fltk-widgets.adb b/fltk-widgets.adb
index 256b8e6..9ec2350 100644
--- a/fltk-widgets.adb
+++ b/fltk-widgets.adb
@@ -242,7 +242,7 @@ package body FLTK.Widgets is
Ada_Widget : access Widget'Class :=
Widget_Convert.To_Pointer (U);
begin
- Ada_Widget.Callback.Call (Ada_Widget.all);
+ Ada_Widget.Callback.all (Ada_Widget.all);
end Callback_Hook;
@@ -250,10 +250,12 @@ package body FLTK.Widgets is
procedure Set_Callback
(This : in out Widget;
- Func : not null access Widget_Callback'Class) is
+ Func : in Widget_Callback) is
begin
- This.Callback := Func;
- fl_widget_set_callback (This.Void_Ptr, Callback_Hook'Address);
+ if Func /= null then
+ This.Callback := Func;
+ fl_widget_set_callback (This.Void_Ptr, Callback_Hook'Address);
+ end if;
end Set_Callback;