12-05-2023, 09:44 PM
I think I've come up with a way to call the C++ destructors without attaching signal handlers to every single widget.
Basically windows or widgets can be destroyed two ways. A user close event on the top-level window or explicitly calling Destroy() on the widget.
So all we need to do is trap the top-level close (destroy) and add some additional code to Destroy() to enumerate all the children and call the individual widget destructors.
Since each platform will require enumeration, I think the best thing to do is add a user accessible child enumeration function, like:
dw_window_enum_children()
So this is the path to getting a stable C++ bindings ready for January release.
Basically windows or widgets can be destroyed two ways. A user close event on the top-level window or explicitly calling Destroy() on the widget.
So all we need to do is trap the top-level close (destroy) and add some additional code to Destroy() to enumerate all the children and call the individual widget destructors.
Since each platform will require enumeration, I think the best thing to do is add a user accessible child enumeration function, like:
dw_window_enum_children()
So this is the path to getting a stable C++ bindings ready for January release.