diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-07-21 13:19:00 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-07-26 18:00:25 +0200 |
| commit | 8cffbd694106a2371d297caa008f2290185fed2f (patch) | |
| tree | 52eaa856bc85c87a34ade06d36f3fd4f010169e3 /FL | |
| parent | b740c48ee8505f93662065384d84b449d5e33438 (diff) | |
Adds the FL_AUTO_DELETE_EVENT to suppress auto delete.
Language wrappers can have major issues with FLTK auto deleting
all children of a group if a group is deleted. This event gives individual
widget the opportunity to override auto delete.
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Enumerations.H | 9 | ||||
| -rw-r--r-- | FL/names.h | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H index d944a13a2..339851d81 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -407,7 +407,14 @@ enum Fl_Event { // events /** A zoom event (ctrl/+/-/0/ or cmd/+/-/0/) was processed. Use Fl::add_handler() to be notified of this event. */ - FL_ZOOM_EVENT = 27 + FL_ZOOM_EVENT = 27, + /** This event is sent if the parent widget is deleted and the parent is about + to delete this widget as well. Returning the default value 0 will give the + parent permission to call the destructor of this widget. Returning 1 will + preserve this widget, but still remove it from the widget hierarchy. + \see Fl_Group::clear() + */ + FL_AUTO_DELETE_EVENT = 28 // DEV NOTE: Keep this list in sync with FL/names.h }; diff --git a/FL/names.h b/FL/names.h index 15a491f84..4f90c3ec1 100644 --- a/FL/names.h +++ b/FL/names.h @@ -73,9 +73,10 @@ const char * const fl_eventnames[] = "FL_FULLSCREEN", "FL_ZOOM_GESTURE", "FL_ZOOM_EVENT", - "FL_EVENT_28", // not yet defined, just in case it /will/ be defined ... + "FL_AUTO_DELETE_EVENT", "FL_EVENT_29", // not yet defined, just in case it /will/ be defined ... - "FL_EVENT_30" // not yet defined, just in case it /will/ be defined ... + "FL_EVENT_30", // not yet defined, just in case it /will/ be defined ... + "FL_EVENT_31" // not yet defined, just in case it /will/ be defined ... }; /** |
