From 5dd1062df53c747339b875c8cb0c13df576ad4b8 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 29 Mar 2025 23:36:09 +0100 Subject: Adding `FL_BEFORE_MENU` event to classes derived from `Fl_Menu_` --- src/Fl_Input_Choice.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Fl_Input_Choice.cxx') diff --git a/src/Fl_Input_Choice.cxx b/src/Fl_Input_Choice.cxx index 77a7d937e..4183b3e65 100644 --- a/src/Fl_Input_Choice.cxx +++ b/src/Fl_Input_Choice.cxx @@ -54,6 +54,10 @@ - 1: the user picked a different item in the choice menu - 0: the user typed or pasted directly into the input field + FLTK triggers an `FL_BEFORE_MENU` event for this widget right before + displaying the menu. This event provides an opportunity to update menu + item states and activation. + \par Example Use of Fl_Input_Choice \code #include @@ -152,6 +156,7 @@ void Fl_Input_Choice::InputMenuButton::draw() { // Make pulldown menu appear under entire width of widget const Fl_Menu_Item* Fl_Input_Choice::InputMenuButton::popup() { + handle(FL_BEFORE_MENU); menu_end(); redraw(); Fl_Widget_Tracker mb(this); -- cgit v1.2.3