From 6aa9475d598065081866913bb86a049a6d2d0c1a Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Mon, 18 Jul 2016 15:58:30 +1000 Subject: Decided on widget init problem, started on rudimentary editor appearance --- fltk-widgets.adb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'fltk-widgets.adb') diff --git a/fltk-widgets.adb b/fltk-widgets.adb index 39ffb66..cffd3f7 100644 --- a/fltk-widgets.adb +++ b/fltk-widgets.adb @@ -1,6 +1,7 @@ with Interfaces.C; +with Interfaces.C.Strings; with System; with FLTK.Widgets.Groups; @@ -18,6 +19,16 @@ package body FLTK.Widgets is B : in Interfaces.C.int); pragma Import (C, fl_widget_set_box, "fl_widget_set_box"); + function fl_widget_get_label + (W : in System.Address) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, fl_widget_get_label, "fl_widget_get_label"); + + procedure fl_widget_set_label + (W : in System.Address; + T : in Interfaces.C.char_array); + pragma Import (C, fl_widget_set_label, "fl_widget_set_label"); + function fl_widget_get_label_font (W : in System.Address) return Interfaces.C.int; @@ -92,6 +103,26 @@ package body FLTK.Widgets is + function Get_Label + (This : in out Widget) + return String is + begin + return Interfaces.C.Strings.Value (fl_widget_get_label (This.Void_Ptr)); + end Get_Label; + + + + + procedure Set_Label + (This : in out Widget; + Text : in String) is + begin + fl_widget_set_label (This.Void_Ptr, Interfaces.C.To_C (Text)); + end Set_Label; + + + + function Get_Label_Font (This : in Widget) return Font_Kind is -- cgit