summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-07-28 16:32:36 +0200
committerMatthias Melcher <github@matthiasm.com>2024-07-28 16:32:36 +0200
commit5cafae4a3a4b729e42dcc05a0eba07ab5c3e3d21 (patch)
treedeb99665a3e95c94224c47a2cda6d39231e530f2
parentc0dba15e4ba9d2e4103a4af8c3862c1a7b8b1769 (diff)
Remove FL_AUTO_DELETE_EVENT feature
It's not ripe for release yet and possibly not even needed according to pyFLTK maintainers. Added: 8cffbd694106a2371d297caa008f2290185fed2f
-rw-r--r--FL/Enumerations.H11
-rw-r--r--FL/names.h5
-rw-r--r--src/Fl_Group.cxx16
3 files changed, 6 insertions, 26 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H
index 339851d81..1beb450e5 100644
--- a/FL/Enumerations.H
+++ b/FL/Enumerations.H
@@ -407,15 +407,8 @@ 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,
- /** 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
+ FL_ZOOM_EVENT = 27
+ // DEV NOTE: Keep this list in sync with FL/names.h
};
/** \name When Conditions */
diff --git a/FL/names.h b/FL/names.h
index 4f90c3ec1..15a491f84 100644
--- a/FL/names.h
+++ b/FL/names.h
@@ -73,10 +73,9 @@ const char * const fl_eventnames[] =
"FL_FULLSCREEN",
"FL_ZOOM_GESTURE",
"FL_ZOOM_EVENT",
- "FL_AUTO_DELETE_EVENT",
+ "FL_EVENT_28", // not yet defined, just in case it /will/ be defined ...
"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_31" // not yet defined, just in case it /will/ be defined ...
+ "FL_EVENT_30" // not yet defined, just in case it /will/ be defined ...
};
/**
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx
index 134b49998..07079cf8c 100644
--- a/src/Fl_Group.cxx
+++ b/src/Fl_Group.cxx
@@ -376,18 +376,7 @@ Fl_Group::Fl_Group(int X,int Y,int W,int H,const char *l)
Fl::pushed() widget these are set to sensible values (other widgets
or the Fl_Group widget itself).
- \note FLTK's auto-delete feature efficiently manages widget hierarchies in
- C++ applications by automatically cleaning up. However, this feature can
- cause issues when FLTK is used with reference-counting languages like Python,
- where automatic deletion might interfere with reference counting. To address
- this, auto-delete can be disabled for individual widgets. When
- \ref Fl_Group::clear() is called, it sends an \ref FL_AUTO_DELETE event to
- each widget. If a widget returns 1 in response to this event, it will not
- be deleted. In a Python wrapper, this behavior would typically involve
- decrementing the widget's reference count instead of deleting it.
-
- \see Fl_Group::remove(int), Fl_Group::delete_child(int),
- Fl_Group::~Fl_Group()
+ \see Fl_Group::remove(int), Fl_Group::delete_child(int), Fl_Group::~Fl_Group()
*/
void Fl_Group::clear() {
savedfocus_ = 0;
@@ -430,8 +419,7 @@ void Fl_Group::clear() {
} else { // slow removal
remove(idx);
}
- if (w->handle(FL_AUTO_DELETE_EVENT)==0)
- delete w; // delete the child
+ delete w; // delete the child
} else { // should never happen
remove(idx); // remove it anyway
}