summaryrefslogtreecommitdiff
path: root/fltk-widgets.ads
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2016-09-07 02:15:57 +1000
committerJed Barber <jjbarber@y7mail.com>2016-09-07 02:15:57 +1000
commite9add081b396a0cbfdf59df9d340afe44d9b9544 (patch)
treead5a4cb0d3e7a5ee228f7e5d954a78dc1c0e6f22 /fltk-widgets.ads
parentdac7e747e5c61d78deffdccc986d202e9f0d63bb (diff)
Now using widget user data to refer back to Ada side of things, will enable easy implementation of callbacks
Diffstat (limited to 'fltk-widgets.ads')
-rw-r--r--fltk-widgets.ads21
1 files changed, 15 insertions, 6 deletions
diff --git a/fltk-widgets.ads b/fltk-widgets.ads
index 8108a5d..3f02302 100644
--- a/fltk-widgets.ads
+++ b/fltk-widgets.ads
@@ -2,6 +2,8 @@
with FLTK.Enums; use FLTK.Enums;
limited with FLTK.Widgets.Groups;
+private with System;
+private with System.Address_To_Access_Conversions;
package FLTK.Widgets is
@@ -86,14 +88,21 @@ package FLTK.Widgets is
private
- type Widget is abstract new Wrapper with
- record
- Parent : access FLTK.Widgets.Groups.Group;
- end record;
+ type Widget is abstract new Wrapper with null record;
- overriding procedure Finalize
- (This : in out Widget);
+ package Widget_Convert is new System.Address_To_Access_Conversions (Widget'Class);
+
+
+ function fl_widget_get_user_data
+ (W : in System.Address)
+ return System.Address;
+ pragma Import (C, fl_widget_get_user_data, "fl_widget_get_user_data");
+
+
+ procedure fl_widget_set_user_data
+ (W, D : in System.Address);
+ pragma Import (C, fl_widget_set_user_data, "fl_widget_set_user_data");
end FLTK.Widgets;