.. 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.ChildFocusEvent:

==========================================================================================================================================
|phoenix_title|  **wx.ChildFocusEvent**
==========================================================================================================================================

A child focus event is sent to a (parent-)window when one of its child windows gains focus, so that the window could restore the focus back to its corresponding child if it loses it now and regains later. 
         

Notice that child window is the direct child of the window receiving event. Use :meth:`wx.Window.FindFocus`   to retrieve the window which is actually getting focus. 







.. _ChildFocusEvent-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.ChildFocusEvent` parameter.

 

- EVT_CHILD_FOCUS: Process a  ``wxEVT_CHILD_FOCUS``   event.   









         



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







|

|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>ChildFocusEvent</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.ChildFocusEvent_inheritance.svg" alt="Inheritance diagram of ChildFocusEvent" 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.ChildFocusEvent.html" title="A child focus event is sent to a (parent-)window when one of its child windows gains focus, so that the window could restore the focus back to its corresponding child if it loses it now and regains later." alt="" coords="5,236,181,265"/> <area shape="rect" id="node2" href="wx.CommandEvent.html" title="This event class contains information about command events, which originate from a variety of simple controls." alt="" coords="9,159,177,188"/> <area shape="rect" id="node3" href="wx.Event.html" title="An event is a structure holding information about an event passed to a callback or member function." alt="" coords="46,82,140,111"/> <area shape="rect" id="node4" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="44,5,143,34"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.ChildFocusEvent.__init__`                                             Constructor.
:meth:`~wx.ChildFocusEvent.GetWindow`                                            Returns the direct child which receives the focus, or a (grand-)parent of the control receiving the focus.
================================================================================ ================================================================================


|


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

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


|


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


.. class:: wx.ChildFocusEvent(CommandEvent)

   **Possible constructors**::

       ChildFocusEvent(win: Optional[Window]=None) -> None
       
   
   A child focus event is sent to a (parent-)window when one of its child
   windows gains focus, so that the window could restore the focus back
   to its corresponding child if it loses it now and regains later.



   .. method:: __init__(self, win: Optional[Window]=None)

      Constructor. 
                 




      :param `win`: The direct child which is (or which contains the window which is) receiving the focus.   
      :type `win`: wx.Window






      :rtype: `None`     




                  





   .. method:: GetWindow(self)

      Returns the direct child which receives the focus, or a (grand-)parent of the control receiving the focus. 
                 

      To get the actually focused control use :meth:`wx.Window.FindFocus` . 
                 

      :rtype: :ref:`wx.Window`








   .. attribute:: Window

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