summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-menus-menu_buttons.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-16 12:17:46 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-16 12:17:46 +1300
commitba1719013e5bab82a2accb4aadfd8451c3ebc931 (patch)
tree0ce67b8257b0ed05e50704ec6a808aac0659816b /src/fltk-widgets-menus-menu_buttons.adb
parent106316bcedec72c5380a7544c27be6a5c117e57a (diff)
Fixed bug in Fl_Choice binding, filled small hole in Fl_Menu_Button binding
Diffstat (limited to 'src/fltk-widgets-menus-menu_buttons.adb')
-rw-r--r--src/fltk-widgets-menus-menu_buttons.adb24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/fltk-widgets-menus-menu_buttons.adb b/src/fltk-widgets-menus-menu_buttons.adb
index ae9ae75..5d56e4d 100644
--- a/src/fltk-widgets-menus-menu_buttons.adb
+++ b/src/fltk-widgets-menus-menu_buttons.adb
@@ -31,12 +31,6 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
- procedure fl_menu_button_type
- (M : in Storage.Integer_Address;
- T : in Interfaces.C.unsigned);
- pragma Import (C, fl_menu_button_type, "fl_menu_button_type");
- pragma Inline (fl_menu_button_type);
-
function fl_menu_button_popup
(M : in Storage.Integer_Address)
return Storage.Integer_Address;
@@ -179,11 +173,25 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
-- API Subprograms --
-----------------------
+ function Get_Popup_Kind
+ (This : in Menu_Button)
+ return Popup_Buttons
+ is
+ Result : Interfaces.C.unsigned_char := fl_widget_get_type (This.Void_Ptr);
+ begin
+ return Popup_Buttons'Val (Result);
+ exception
+ when Constraint_Error => raise Internal_FLTK_Error with
+ "Fl_Menu_Button::type returned unexpected Popup_Buttons value of " &
+ Interfaces.C.unsigned_char'Image (Result);
+ end Get_Popup_Kind;
+
+
procedure Set_Popup_Kind
(This : in out Menu_Button;
- Pop : in Popup_Buttons) is
+ Kind : in Popup_Buttons) is
begin
- fl_menu_button_type (This.Void_Ptr, Popup_Buttons'Pos (Pop));
+ fl_widget_set_type (This.Void_Ptr, Popup_Buttons'Pos (Kind));
end Set_Popup_Kind;