.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.WindowDestroyEvent:

==========================================================================================================================================
|phoenix_title|  **wx.WindowDestroyEvent**
==========================================================================================================================================

This event is sent as early as possible during the window destruction process.          

For the top level windows, as early as possible means that this is done by :ref:`wx.Frame`  or :ref:`wx.Dialog`  destructor, i.e. after the destructor of the derived class was executed and so any methods specific to the derived class can't be called any more from this event handler. If you need to do this, you must call :meth:`wx.Window.SendDestroyEvent`   from your derived class destructor. 

For the child windows, this event is generated just before deleting the window from :meth:`wx.Window.Destroy`   (which is also called when the parent window is deleted) or from the window destructor if operator  ``delete``   was used directly (which is not recommended for this very reason). 

It is usually pointless to handle this event in the window itself but it ca be very useful to receive notifications about the window destruction in the parent window or in any other object interested in this window. 





         



.. seealso:: :ref:`Events and Event Handling <events and event handling>`, :ref:`wx.WindowCreateEvent`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>WindowDestroyEvent</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.WindowDestroyEvent_inheritance.png" alt="Inheritance diagram of WindowDestroyEvent" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.WindowDestroyEvent.html" title="wx.WindowDestroyEvent" alt="" coords="5,237,191,267"/> <area shape="rect" id="node2" href="wx.CommandEvent.html" title="wx.CommandEvent" alt="" coords="23,160,173,189"/> <area shape="rect" id="node3" href="wx.Event.html" title="wx.Event" alt="" coords="57,83,139,112"/> <area shape="rect" id="node4" href="wx.Object.html" title="wx.Object" alt="" coords="55,5,141,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.WindowDestroyEvent.__init__`                                          Constructor.
:meth:`~wx.WindowDestroyEvent.GetWindow`                                         Return the window being destroyed.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.WindowDestroyEvent.Window`                                            See :meth:`~wx.WindowDestroyEvent.GetWindow`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.WindowDestroyEvent(CommandEvent)

   **Possible constructors**::

       WindowDestroyEvent(win=None)
       
   
   This event is sent as early as possible during the window destruction
   process.



   .. method:: __init__(self, win=None)

      Constructor.                  


      :param `win`: 
      :type `win`: wx.Window







   .. method:: GetWindow(self)

      Return the window being destroyed.                  

      :rtype: :ref:`wx.Window`








   .. attribute:: Window

      See :meth:`~wx.WindowDestroyEvent.GetWindow`

