diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-11-11 10:53:05 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-11-11 10:53:05 +1100 |
commit | cb8ade55fb2f85951e53706de277261b726ecad7 (patch) | |
tree | 75d00ddf6bed9696165ebf144f31cc65064d73c1 /fltk-widgets-menus.adb | |
parent | bee437918713d9fc2213a5a554ac02f4e7af3249 (diff) |
Simplified widget callbacks
Diffstat (limited to 'fltk-widgets-menus.adb')
-rw-r--r-- | fltk-widgets-menus.adb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fltk-widgets-menus.adb b/fltk-widgets-menus.adb index 7669820..0f50fc8 100644 --- a/fltk-widgets-menus.adb +++ b/fltk-widgets-menus.adb @@ -98,16 +98,13 @@ package body FLTK.Widgets.Menus is pragma Convention (C, Item_Hook); procedure Item_Hook - (M, U : in System.Address) is - + (M, U : in System.Address) + is Ada_Widget : access Widget'Class := Widget_Convert.To_Pointer (fl_widget_get_user_data (M)); - - Action : access Widget_Callback'Class := - Callback_Convert.To_Pointer (U); - + Action : Widget_Callback := Callback_Convert.To_Pointer (U); begin - Action.Call (Ada_Widget.all); + Action.all (Ada_Widget.all); end Item_Hook; @@ -116,7 +113,7 @@ package body FLTK.Widgets.Menus is procedure Add (This : in out Menu; Text : in String; - Action : access Widget_Callback'Class := null; + Action : in Widget_Callback := null; Shortcut : in Shortcut_Key := No_Key; Flags : in Menu_Flag := Flag_Normal) is |