From e93b9bbc02e2791f3a35b6f077fcbb8514c28aed Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sun, 12 Jan 2025 01:14:58 +1300 Subject: Refactored draw/handle methods in Widgets hierarchy, improved docs, added a few minor method bindings here and there --- src/fltk-widgets-groups-windows-double-cairo.adb | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/fltk-widgets-groups-windows-double-cairo.adb') diff --git a/src/fltk-widgets-groups-windows-double-cairo.adb b/src/fltk-widgets-groups-windows-double-cairo.adb index 61ea232..eeeab90 100644 --- a/src/fltk-widgets-groups-windows-double-cairo.adb +++ b/src/fltk-widgets-groups-windows-double-cairo.adb @@ -134,6 +134,14 @@ package body FLTK.Widgets.Groups.Windows.Double.Cairo is end Extra_Init; + procedure Initialize + (This : in out Cairo_Window) is + begin + This.Draw_Ptr := fl_cairo_window_draw'Address; + This.Handle_Ptr := fl_cairo_window_handle'Address; + end Initialize; + + package body Forge is function Create @@ -202,20 +210,10 @@ package body FLTK.Widgets.Groups.Windows.Double.Cairo is procedure Draw (This : in out Cairo_Window) is begin - fl_cairo_window_draw (This.Void_Ptr); + Double_Window (This).Draw; end Draw; - function Handle - (This : in out Cairo_Window; - Event : in Event_Kind) - return Event_Outcome is - begin - return Event_Outcome'Val - (fl_cairo_window_handle (This.Void_Ptr, Event_Kind'Pos (Event))); - end Handle; - - end FLTK.Widgets.Groups.Windows.Double.Cairo; -- cgit