From 6c61d634be9aa3cd30c1bf0254eee5d36a37eeb5 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 11 Sep 2016 01:40:45 +1000 Subject: WIDGET CALLBACKS!!! --- src/fltk_binding/fltk-widgets.ads | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/fltk_binding/fltk-widgets.ads') diff --git a/src/fltk_binding/fltk-widgets.ads b/src/fltk_binding/fltk-widgets.ads index 3f02302..1c21ca4 100644 --- a/src/fltk_binding/fltk-widgets.ads +++ b/src/fltk_binding/fltk-widgets.ads @@ -14,6 +14,12 @@ package FLTK.Widgets is with Implicit_Dereference => Data; + type Widget_Callback is interface; + procedure Call + (This : in Widget_Callback; + Item : in out Widget'Class) is abstract; + + -- would like to move this definition to FLTK.Widgets.Groups somehow type Group_Cursor (Data : access FLTK.Widgets.Groups.Group'Class) is limited null record with Implicit_Dereference => Data; @@ -85,10 +91,18 @@ package FLTK.Widgets is Label : in Label_Kind); + procedure Set_Callback + (This : in out Widget; + Func : not null access Widget_Callback'Class); + + private - type Widget is abstract new Wrapper with null record; + type Widget is abstract new Wrapper with + record + Callback : access Widget_Callback'Class; + end record; package Widget_Convert is new System.Address_To_Access_Conversions (Widget'Class); -- cgit