summaryrefslogtreecommitdiff
path: root/src/fltk-widgets.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-21 00:53:56 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-21 00:53:56 +1300
commitf9e453e3d456514066e8ecbed9fbac93a588a0d0 (patch)
tree06587afde830fb324d5ab7372f0f1686c4fd993a /src/fltk-widgets.adb
parent67a43ef89ba41ac32b86cda7396c16fffaf691b3 (diff)
Using the type method is now more consistent
Diffstat (limited to 'src/fltk-widgets.adb')
-rw-r--r--src/fltk-widgets.adb18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fltk-widgets.adb b/src/fltk-widgets.adb
index fdfec81..a312641 100644
--- a/src/fltk-widgets.adb
+++ b/src/fltk-widgets.adb
@@ -1009,20 +1009,26 @@ package body FLTK.Widgets is
end Set_Label_Size;
- function Get_Label_Type
+ function Get_Label_Kind
(This : in Widget)
- return Label_Kind is
+ return Label_Kind
+ is
+ Result : Interfaces.C.int := fl_widget_get_labeltype (This.Void_Ptr);
begin
- return Label_Kind'Val (fl_widget_get_labeltype (This.Void_Ptr));
- end Get_Label_Type;
+ return Label_Kind'Val (Result);
+ exception
+ when Constraint_Error => raise Internal_FLTK_Error with
+ "Fl_Widget::labeltype returned unexpected int value of " &
+ Interfaces.C.int'Image (Result);
+ end Get_Label_Kind;
- procedure Set_Label_Type
+ procedure Set_Label_Kind
(This : in out Widget;
Label : in Label_Kind) is
begin
fl_widget_set_labeltype (This.Void_Ptr, Label_Kind'Pos (Label));
- end Set_Label_Type;
+ end Set_Label_Kind;
procedure Measure_Label