From 88e5c98995d1b330abe2982b27c472d4ae52fad6 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 30 Jul 2017 01:15:48 +1000 Subject: Added Redraw and Redraw_Label procedures to Widgets --- src/c_fl_widget.cpp | 11 +++++++++++ src/c_fl_widget.h | 4 ++++ src/fltk-widgets.adb | 25 +++++++++++++++++++++++++ src/fltk-widgets.ads | 6 ++++++ 4 files changed, 46 insertions(+) (limited to 'src') diff --git a/src/c_fl_widget.cpp b/src/c_fl_widget.cpp index 832d7fe..923b509 100644 --- a/src/c_fl_widget.cpp +++ b/src/c_fl_widget.cpp @@ -194,3 +194,14 @@ void fl_widget_set_image(WIDGET w, void * img) { reinterpret_cast(w)->image(reinterpret_cast(img)); } + + + +void fl_widget_redraw(WIDGET w) { + reinterpret_cast(w)->redraw(); +} + +void fl_widget_redraw_label(WIDGET w) { + reinterpret_cast(w)->redraw_label(); +} + diff --git a/src/c_fl_widget.h b/src/c_fl_widget.h index 26f0ebe..7bf5d71 100644 --- a/src/c_fl_widget.h +++ b/src/c_fl_widget.h @@ -68,5 +68,9 @@ extern "C" void fl_widget_position(WIDGET w, int x, int y); extern "C" void fl_widget_set_image(WIDGET w, void * img); +extern "C" void fl_widget_redraw(WIDGET w); +extern "C" void fl_widget_redraw_label(WIDGET w); + + #endif diff --git a/src/fltk-widgets.adb b/src/fltk-widgets.adb index 8d6bec2..deb0213 100644 --- a/src/fltk-widgets.adb +++ b/src/fltk-widgets.adb @@ -204,6 +204,17 @@ package body FLTK.Widgets is + procedure fl_widget_redraw + (W : in System.Address); + pragma Import (C, fl_widget_redraw, "fl_widget_redraw"); + + procedure fl_widget_redraw_label + (W : in System.Address); + pragma Import (C, fl_widget_redraw_label, "fl_widget_redraw_label"); + + + + procedure Callback_Hook (W, U : in System.Address) is @@ -551,6 +562,20 @@ package body FLTK.Widgets is + procedure Redraw + (This : in out Widget) is + begin + fl_widget_redraw (This.Void_Ptr); + end Redraw; + + + procedure Redraw_Label + (This : in out Widget) is + begin + fl_widget_redraw_label (This.Void_Ptr); + end Redraw_Label; + + function Handle (This : in out Widget; Event : in Event_Kind) diff --git a/src/fltk-widgets.ads b/src/fltk-widgets.ads index 895ffc3..5205106 100644 --- a/src/fltk-widgets.ads +++ b/src/fltk-widgets.ads @@ -181,6 +181,12 @@ package FLTK.Widgets is procedure Draw (This : in out Widget) is null; + procedure Redraw + (This : in out Widget); + + procedure Redraw_Label + (This : in out Widget); + function Handle (This : in out Widget; Event : in Event_Kind) -- cgit