Backport 5a574e8
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled

Improve Fl_Button event handling documentation (#1267)
This commit is contained in:
Matthias Melcher
2025-07-16 12:49:12 +02:00
parent 7884d55c1a
commit c730902f84
+13 -4
View File
@@ -254,10 +254,19 @@ void Fl_Button::key_release_timeout(void *d)
Derived classes may handle this differently.
A button may request callbacks with \p when() \p FL_WHEN_CHANGED,
\p FL_WHEN_NOT_CHANGED, and \p FL_WHEN_RELEASE, triggering the callback
reasons \p FL_REASON_CHANGED, \p FL_REASON_SELECTED,
and \p FL_REASON_DESELECTED.
Calling `when()` will tell the button widget when to call the callback.
Setting `FL_WHEN_RELEASE` will call the callback only if the button value
changed. It's called during `FL_RELEASE` and `FL_KEYBOARD` events with
`FL_REASON_RELEASED` set as the callback reason.
Setting `FL_WHEN_CHANGED` will call the callback with `FL_REASON_CHANGED`
every time the value of the button changes during `FL_DRAG`, `FL_RELEASE`,
and `FL_KEYBOARD` events.
Setting `FL_WHEN_NOT_CHANGED` will trigger a callback during `FL_RELEASE`
events, even if the value of the button die *not* change. For radio buttons,
this is also true during `FL_KEYBOARD` events.
\param[in] X, Y, W, H position and size of the widget
\param[in] L widget label, default is no label