On Sun, Aug 25, 2013 at 4:24 PM, Andreas Falkenhahn
<andr...@falkenhahn.com>wrote:
...
> But how should I do it in wxLua? If I'd derive a whole new class from
> wxWindow I'd have to create new bindings for it etc. This all sounds
> quite complicated so I'd to know if there is an easier way to hook into
> the wxWindow::Destroy method for every wxWindow object created by
> wxLua.
>
> Connecting to wxEVT_DESTROY is probably not sufficient because AFAICS
> destruction is already in process when this event is sent, but I'd
> like to run my custom code *before* the destruction process is actually
> started.
>
>
wxLua only supports using wxEVT_DESTROY. Usually you can handle destroying
windows by managing how and who deletes them. wxWidgets only deletes the
children of a window when it is destroyed and only top level windows
(wxFrame/wxDialog) can be destroyed "by themselves," but you can veto
wxEVT_CLOSE events. I would try to refactor your code to work either with
wxEVT_DESTROY or manage deletion from the top down by doing what you need
to do before calling Destroy() on the window yourself.
Regards,
John
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users