diff options
| author | Matthias Melcher <github@matthiasm.com> | 2025-03-29 23:36:09 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2025-03-29 23:36:19 +0100 |
| commit | 5dd1062df53c747339b875c8cb0c13df576ad4b8 (patch) | |
| tree | 9c618866ea1159cf53ed6bdadeda48b4efff808f /src/Fl_Input_Choice.cxx | |
| parent | b7189192e2e31ce5ca1f2eaac2a303f9b8216ded (diff) | |
Adding `FL_BEFORE_MENU` event to classes derived from `Fl_Menu_`
Diffstat (limited to 'src/Fl_Input_Choice.cxx')
| -rw-r--r-- | src/Fl_Input_Choice.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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 <stdio.h> @@ -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); |
