diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-07-30 01:15:48 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-07-30 01:15:48 +1000 |
commit | 88e5c98995d1b330abe2982b27c472d4ae52fad6 (patch) | |
tree | e31dece0a38e343a861e6f412283eeaad399f2d2 | |
parent | 45c820a4879110d934ce9ca93076eff4aa2d4979 (diff) |
Added Redraw and Redraw_Label procedures to Widgets
-rw-r--r-- | src/c_fl_widget.cpp | 11 | ||||
-rw-r--r-- | src/c_fl_widget.h | 4 | ||||
-rw-r--r-- | src/fltk-widgets.adb | 25 | ||||
-rw-r--r-- | src/fltk-widgets.ads | 6 |
4 files changed, 46 insertions, 0 deletions
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<Fl_Widget*>(w)->image(reinterpret_cast<Fl_Image*>(img)); } + + + +void fl_widget_redraw(WIDGET w) { + reinterpret_cast<Fl_Widget*>(w)->redraw(); +} + +void fl_widget_redraw_label(WIDGET w) { + reinterpret_cast<Fl_Widget*>(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) |