From 249933f4573a7b812334a24c734cf2630a9bf9fc Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 11 Sep 2016 01:40:45 +1000 Subject: WIDGET CALLBACKS!!! --- fltk-widgets.ads | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'fltk-widgets.ads') diff --git a/fltk-widgets.ads b/fltk-widgets.ads index 3f02302..1c21ca4 100644 --- a/fltk-widgets.ads +++ b/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