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

==========================================================================================================================================
|phoenix_title|  **wx.TopLevelWindow**
==========================================================================================================================================

:ref:`wx.TopLevelWindow`  is a common base class for :ref:`wx.Dialog`  and :ref:`wx.Frame`.          

It is an abstract base class meaning that you never work with objects of this class directly, but all of its methods are also applicable for the two classes above. 

Note that the instances of :ref:`wx.TopLevelWindow`  are managed by wxWidgets in the internal top level window list. 





.. _TopLevelWindow-events:

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

Event macros for events emitted by this class: 

  

- EVT_MAXIMIZE: Process a  ``wxEVT_MAXIMIZE``   event. See  :ref:`wx.MaximizeEvent`.  
- EVT_MOVE: Process a  ``wxEVT_MOVE``   event, which is generated when a window is moved. See  :ref:`wx.MoveEvent`.  
- EVT_MOVE_START: Process a  ``wxEVT_MOVE_START``   event, which is generated when the user starts to move or size a window. wxMSW only. See  :ref:`wx.MoveEvent`.  
- EVT_MOVE_END: Process a  ``wxEVT_MOVE_END``   event, which is generated when the user stops moving or sizing a window. wxMSW only. See  :ref:`wx.MoveEvent`.  
- EVT_SHOW: Process a  ``wxEVT_SHOW``   event. See  :ref:`wx.ShowEvent`.  








         



.. seealso:: :ref:`wx.Dialog`, :ref:`wx.Frame`    







|

|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>TopLevelWindow</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.TopLevelWindow_inheritance.png" alt="Inheritance diagram of TopLevelWindow" 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.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="31,315,186,344"/> <area shape="rect" id="node2" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="25,237,193,267"/> <area shape="rect" id="node3" href="wx.Window.html" title="wx.Window" alt="" coords="60,160,157,189"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="50,83,167,112"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="117,5,223,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.Dialog`, :ref:`wx.Frame`

|


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

================================================================================ ================================================================================
:meth:`~wx.TopLevelWindow.__init__`                                              Default constructor.
:meth:`~wx.TopLevelWindow.CanSetTransparent`                                     Returns ``True`` if the platform supports making the window translucent.
:meth:`~wx.TopLevelWindow.CenterOnScreen`                                        A synonym for :meth:`~TopLevelWindow.CentreOnScreen` .
:meth:`~wx.TopLevelWindow.CentreOnScreen`                                        Centres the window on screen.
:meth:`~wx.TopLevelWindow.Create`                                                Creates the top level window.
:meth:`~wx.TopLevelWindow.EnableCloseButton`                                     Enables or disables the Close button (most often in the right upper corner of a dialog) and the Close entry of the system menu (most often in the left upper corner of the dialog).
:meth:`~wx.TopLevelWindow.EnableFullScreenView`                                  Enables the maximize button to toggle full screen mode.
:meth:`~wx.TopLevelWindow.EnableMaximizeButton`                                  Enables or disables the Maximize button (in the right or left upper corner of a frame or dialog).
:meth:`~wx.TopLevelWindow.EnableMinimizeButton`                                  Enables or disables the Minimize button (in the right or left upper corner of a frame or dialog).
:meth:`~wx.TopLevelWindow.GetClassDefaultAttributes`                             
:meth:`~wx.TopLevelWindow.GetDefaultItem`                                        Returns a pointer to the button which is the default for this window, or
:meth:`~wx.TopLevelWindow.GetDefaultSize`                                        Get the default size for a new top level window.
:meth:`~wx.TopLevelWindow.GetIcon`                                               Returns the standard icon of the window.
:meth:`~wx.TopLevelWindow.GetIcons`                                              Returns all icons associated with the window, there will be none of them if neither :meth:`~TopLevelWindow.SetIcon`   nor :meth:`~TopLevelWindow.SetIcons`   had been called before.
:meth:`~wx.TopLevelWindow.GetTitle`                                              Gets a string containing the window title.
:meth:`~wx.TopLevelWindow.GetTmpDefaultItem`                                     
:meth:`~wx.TopLevelWindow.Iconize`                                               Iconizes or restores the window.
:meth:`~wx.TopLevelWindow.IsActive`                                              Returns ``True`` if this window is currently active, i.e. if the user is currently working with it.
:meth:`~wx.TopLevelWindow.IsAlwaysMaximized`                                     Returns ``True`` if this window is expected to be always maximized, either due to platform policy or due to local policy regarding particular class.
:meth:`~wx.TopLevelWindow.IsFullScreen`                                          Returns ``True`` if the window is in fullscreen mode.
:meth:`~wx.TopLevelWindow.IsIconized`                                            Returns ``True`` if the window is iconized.
:meth:`~wx.TopLevelWindow.IsMaximized`                                           Returns ``True`` if the window is maximized.
:meth:`~wx.TopLevelWindow.Layout`                                                Lays out the children using the window sizer or resizes the only child of the window to cover its entire area.
:meth:`~wx.TopLevelWindow.MacGetMetalAppearance`                                 
:meth:`~wx.TopLevelWindow.MacGetTopLevelWindowRef`                               
:meth:`~wx.TopLevelWindow.MacGetUnifiedAppearance`                               
:meth:`~wx.TopLevelWindow.MacSetMetalAppearance`                                 
:meth:`~wx.TopLevelWindow.Maximize`                                              Maximizes or restores the window.
:meth:`~wx.TopLevelWindow.OSXIsModified`                                         Returns the current modified state of the :ref:`wx.TopLevelWindow`  on macOS.
:meth:`~wx.TopLevelWindow.OSXSetModified`                                        This function sets the :ref:`wx.TopLevelWindow`'s modified state on macOS, which currently draws a black dot in the :ref:`wx.TopLevelWindow`'s close button.
:meth:`~wx.TopLevelWindow.RequestUserAttention`                                  Use a system-dependent way to attract users attention to the window when it is in background.
:meth:`~wx.TopLevelWindow.Restore`                                               Restore a previously iconized or maximized window to its normal state.
:meth:`~wx.TopLevelWindow.RestoreToGeometry`                                     Restores the window to the previously saved geometry.
:meth:`~wx.TopLevelWindow.SaveGeometry`                                          Save the current window geometry to allow restoring it later.
:meth:`~wx.TopLevelWindow.SetDefaultItem`                                        Changes the default item for the panel, usually `win`  is a button.
:meth:`~wx.TopLevelWindow.SetIcon`                                               Sets the icon for this window.
:meth:`~wx.TopLevelWindow.SetIcons`                                              Sets several icons of different sizes for this window: this allows using different icons for different situations (e.g.
:meth:`~wx.TopLevelWindow.SetMaxSize`                                            A simpler interface for setting the size hints than :meth:`~TopLevelWindow.SetSizeHints` .
:meth:`~wx.TopLevelWindow.SetMinSize`                                            A simpler interface for setting the size hints than :meth:`~TopLevelWindow.SetSizeHints` .
:meth:`~wx.TopLevelWindow.SetRepresentedFilename`                                Sets the file name represented by this :ref:`wx.TopLevelWindow`.
:meth:`~wx.TopLevelWindow.SetSizeHints`                                          Allows specification of minimum and maximum window sizes, and window size increments.
:meth:`~wx.TopLevelWindow.SetTitle`                                              Sets the window title.
:meth:`~wx.TopLevelWindow.SetTmpDefaultItem`                                     
:meth:`~wx.TopLevelWindow.SetTransparent`                                        If the platform supports it will set the window to be translucent.
:meth:`~wx.TopLevelWindow.ShouldPreventAppExit`                                  This virtual function is not meant to be called directly but can be overridden to return ``False`` (it returns ``True`` by default) to allow the application to close even if this, presumably not very important, window is still opened.
:meth:`~wx.TopLevelWindow.ShowFullScreen`                                        Depending on the value of `show`  parameter the window is either shown full screen or restored to its normal state.
:meth:`~wx.TopLevelWindow.ShowWithoutActivating`                                 Show the :ref:`wx.TopLevelWindow`, but do not give it keyboard focus.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.TopLevelWindow.DefaultItem`                                           See :meth:`~wx.TopLevelWindow.GetDefaultItem` and :meth:`~wx.TopLevelWindow.SetDefaultItem`
:attr:`~wx.TopLevelWindow.Icon`                                                  See :meth:`~wx.TopLevelWindow.GetIcon` and :meth:`~wx.TopLevelWindow.SetIcon`
:attr:`~wx.TopLevelWindow.MacMetalAppearance`                                    See :meth:`~wx.TopLevelWindow.MacGetMetalAppearance` and :meth:`~wx.TopLevelWindow.MacSetMetalAppearance`
:attr:`~wx.TopLevelWindow.OSXModified`                                           See :meth:`~wx.TopLevelWindow.OSXIsModified` and :meth:`~wx.TopLevelWindow.OSXSetModified`
:attr:`~wx.TopLevelWindow.Title`                                                 See :meth:`~wx.TopLevelWindow.GetTitle` and :meth:`~wx.TopLevelWindow.SetTitle`
:attr:`~wx.TopLevelWindow.TmpDefaultItem`                                        See :meth:`~wx.TopLevelWindow.GetTmpDefaultItem` and :meth:`~wx.TopLevelWindow.SetTmpDefaultItem`
================================================================================ ================================================================================


|


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


.. class:: wx.TopLevelWindow(NonOwnedWindow)

   **Possible constructors**::

       TopLevelWindow()
       
       TopLevelWindow(parent, id=ID_ANY, title=EmptyString,
                      pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE,
                      name=FrameNameStr)
       
   
   TopLevelWindow is a common base class for Dialog and Frame.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, parent, id=ID_ANY, title=EmptyString, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)`
      
      Constructor creating the top level window.                  
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `title`: 
      :type `title`: string
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `name`: 
      :type `name`: string
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: CanSetTransparent(self)

      Returns ``True`` if the platform supports making the window translucent.                  

                

      :rtype: `bool`







      .. seealso:: :meth:`SetTransparent`     








   .. method:: CenterOnScreen(self, direction=BOTH)

      A synonym for :meth:`CentreOnScreen` .                  


      :param `direction`: 
      :type `direction`: int







   .. method:: CentreOnScreen(self, direction=BOTH)

      Centres the window on screen.                  




      :param `direction`: Specifies the direction for the centering. May be  ``HORIZONTAL`` ,   ``VERTICAL``   or   ``BOTH`` .  
      :type `direction`: int




                  



      .. seealso:: :meth:`wx.Window.CentreOnParent`     








   .. method:: Create(self, parent, id=ID_ANY, title=EmptyString, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)

      Creates the top level window.                  


      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `title`: 
      :type `title`: string
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `name`: 
      :type `name`: string




      :rtype: `bool`








   .. method:: EnableCloseButton(self, enable=True)

      Enables or disables the Close button (most often in the right upper corner of a dialog) and the Close entry of the system menu (most often in the left upper corner of the dialog).                  

      Returns ``True`` if operation was successful. This may be wrong on X11 (including GTK+) where the window manager may not support this operation and there is no way to find out.                  


      :param `enable`: 
      :type `enable`: bool




      :rtype: `bool`








   .. method:: EnableFullScreenView(self, enable=True)

      Enables the maximize button to toggle full screen mode.                  

      Prior to macOS 10.10 a full screen button is added to the right upper corner of a window's title bar. 

      Currently only available for OSX/Cocoa. 




      :param `enable`: If ``True`` (default) adds the full screen button in the title bar; if ``False`` the button is removed.  
      :type `enable`: bool






      :rtype: `bool`






                 



      :returns: 

         ``True`` if the button was added or removed, ``False`` if running under another OS.  







      .. versionadded:: 4.1/wxWidgets-3.1.0  
     







      .. availability:: Only available for OSX.  







      .. note:: 

         Having the button is also required to let :meth:`ShowFullScreen`   make use of the full screen API: a full screen window gets its own space and entering and exiting the mode is animated. If the button is not present the old way of switching to full screen is used.  







      .. seealso:: :meth:`ShowFullScreen`   








   .. method:: EnableMaximizeButton(self, enable=True)

      Enables or disables the Maximize button (in the right or left upper corner of a frame or dialog).                  

      Currently only implemented for wxMSW and wxOSX. 

      The window style must contain ``wx.MAXIMIZE_BOX``. 

      Returns ``True`` if operation was successful. Note that a successful operation does not change the window style flags. 

                


      :param `enable`: 
      :type `enable`: bool




      :rtype: `bool`







      .. versionadded:: 4.1/wxWidgets-3.1.0  
     








   .. method:: EnableMinimizeButton(self, enable=True)

      Enables or disables the Minimize button (in the right or left upper corner of a frame or dialog).                  

      Currently only implemented for wxMSW and wxOSX. 

      The window style must contain ``wx.MINIMIZE_BOX``. 

      Note that in wxMSW a successful operation will change the window style flags. 

      Returns ``True`` if operation was successful. Note that a successful operation does not change the window style flags. 

                


      :param `enable`: 
      :type `enable`: bool




      :rtype: `bool`







      .. versionadded:: 4.1/wxWidgets-3.1.0  
     








   .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)




      :param `variant`: 
      :type `variant`: wx.WindowVariant




      :rtype: :ref:`wx.VisualAttributes`








   .. method:: GetDefaultItem(self)

      Returns a pointer to the button which is the default for this window, or                  

      The default button is the one activated by pressing the Enter key.                  

      :rtype: :ref:`wx.Window`








   .. staticmethod:: GetDefaultSize()

      Get the default size for a new top level window.                  

      This is used internally by wxWidgets on some platforms to determine the default size for a window created using :ref:`wx.DefaultSize`  so it is not necessary to use it when creating a :ref:`wx.TopLevelWindow`, however it may be useful if a rough estimation of the window size is needed for some other reason. 

                

      :rtype: :ref:`wx.Size`







      .. versionadded:: 2.9.2 
     








   .. method:: GetIcon(self)

      Returns the standard icon of the window.                  

      The icon will be invalid if it hadn't been previously set by :meth:`SetIcon` . 

                

      :rtype: :ref:`wx.Icon`







      .. seealso:: :meth:`GetIcons`     








   .. method:: GetIcons(self)

      Returns all icons associated with the window, there will be none of them if neither :meth:`SetIcon`   nor :meth:`SetIcons`   had been called before.                  

      Use :meth:`GetIcon`   to get the main icon of the window. 

                

      :rtype: :ref:`wx.IconBundle`







      .. seealso:: :ref:`wx.IconBundle`    








   .. method:: GetTitle(self)

      Gets a string containing the window title.                  

                

      :rtype: `string`







      .. seealso:: :meth:`SetTitle`     








   .. method:: GetTmpDefaultItem(self)



      :rtype: :ref:`wx.Window`








   .. method:: Iconize(self, iconize=True)

      Iconizes or restores the window.                  

      Note that in wxGTK the change to the window state is not immediate, i.e. :meth:`IsIconized`   will typically return ``False`` right after a call to :meth:`Iconize`   and its return value will only change after the control flow returns to the event loop and the notification about the window being really iconized is received. 




      :param `iconize`: If ``True``, iconizes the window; if ``False``, shows and restores it.  
      :type `iconize`: bool




                  



      .. seealso:: :meth:`IsIconized` , :meth:`Restore` (), :ref:`wx.IconizeEvent`.   








   .. method:: IsActive(self)

      Returns ``True`` if this window is currently active, i.e. if the user is currently working with it.                  

      :rtype: `bool`








   .. method:: IsAlwaysMaximized(self)

      Returns ``True`` if this window is expected to be always maximized, either due to platform policy or due to local policy regarding particular class.                  

      :rtype: `bool`








   .. method:: IsFullScreen(self)

      Returns ``True`` if the window is in fullscreen mode.                  

                

      :rtype: `bool`







      .. seealso:: :meth:`ShowFullScreen`     








   .. method:: IsIconized(self)

      Returns ``True`` if the window is iconized.                  

      :rtype: `bool`








   .. method:: IsMaximized(self)

      Returns ``True`` if the window is maximized.                  

      :rtype: `bool`








   .. method:: Layout(self)

      Lays out the children using the window sizer or resizes the only child of the window to cover its entire area.                  

      This class overrides the base class :meth:`Layout`   method to check if this window contains exactly one child –  which is commonly the case, with :ref:`wx.Panel`  being often created as the only child of :ref:`wx.TopLevelWindow`  –  and, if this is the case, resizes this child window to cover the entire client area. 

      Note that if you associate a sizer with this window, the sizer takes precedence and the only-child-resizing is only used as fallback. 

                

      :rtype: `bool`







      :returns: 

         ``False`` if nothing was done because the window doesn't have neither a sizer nor a single child, ``True`` otherwise.   








   .. method:: MacGetMetalAppearance(self)



      :rtype: `bool`








   .. method:: MacGetTopLevelWindowRef(self)






   .. method:: MacGetUnifiedAppearance(self)



      :rtype: `bool`








   .. method:: MacSetMetalAppearance(self, on)






   .. method:: Maximize(self, maximize=True)

      Maximizes or restores the window.                  

      Note that, just as with :meth:`Iconize` , the change to the window state is not immediate in at least wxGTK port. 




      :param `maximize`: If ``True``, maximizes the window, otherwise it restores it.  
      :type `maximize`: bool




                  



      .. seealso:: :meth:`Restore` , :meth:`Iconize`     








   .. method:: OSXIsModified(self)

      Returns the current modified state of the :ref:`wx.TopLevelWindow`  on macOS.                  

      On other platforms, this method does nothing. 

                

      :rtype: `bool`







      .. seealso:: :meth:`OSXSetModified`     








   .. method:: OSXSetModified(self, modified)

      This function sets the :ref:`wx.TopLevelWindow`'s modified state on macOS, which currently draws a black dot in the :ref:`wx.TopLevelWindow`'s close button.                  

      On other platforms, this method does nothing. 

                


      :param `modified`: 
      :type `modified`: bool






      .. seealso:: :meth:`OSXIsModified`     








   .. method:: RequestUserAttention(self, flags=USER_ATTENTION_INFO)

      Use a system-dependent way to attract users attention to the window when it is in background.                  

      `flags`  may have the value of either  ``USER_ATTENTION_INFO``  (default) or   ``USER_ATTENTION_ERROR``  which results in a more drastic action. When in doubt, use the default value. 


      This function is currently implemented for Win32 where it flashes the window icon in the taskbar, and for wxGTK with task bars supporting it.                   


      :param `flags`: 
      :type `flags`: int






      .. note:: 

         This function should normally be only used when the application is not already in foreground.  








   .. method:: Restore(self)

      Restore a previously iconized or maximized window to its normal state.                  

      In wxGTK this method currently doesn't return the maximized window to its normal state and you must use :meth:`Maximize`   with ``False`` argument explicitly for this. In the other ports, it both unmaximizes the maximized windows and uniconizes the iconized ones. 

                 



      .. seealso:: :meth:`Iconize` , :meth:`Maximize`     








   .. method:: RestoreToGeometry(self, ser)

      Restores the window to the previously saved geometry.                  

      This is a companion function to :meth:`SaveGeometry`   and can be called later to restore the window to the geometry it had when it was saved. 




      :param `ser`: An object implementing :ref:`wx.TopLevelWindow.GeometrySerializer`  virtual methods.  
      :type `ser`: wx.TopLevelWindow.GeometrySerializer






      :rtype: `bool`



                  



      :returns: 

         ``True`` if any (and, usually, but not necessarily, all) of the window geometry attributes were restored or ``False`` if there was no saved geometry information at all or restoring it failed.  







      .. versionadded:: 4.1/wxWidgets-3.1.2  
     








   .. method:: SaveGeometry(self, ser)

      Save the current window geometry to allow restoring it later.                  

      After calling this function, window geometry is saved in the provided serializer and calling :meth:`RestoreToGeometry`   with the same serializer later (i.e. usually during a subsequent program execution) would restore the window to the same position, size, maximized/minimized state etc. 

      This function is used by :ref:`PersistentTLW`, so it is not necessary to use it if the goal is to just save and restore window geometry in the simplest possible way. However is more flexibility is required, it can be also used directly with a custom serializer object. 




      :param `ser`: An object implementing :ref:`wx.TopLevelWindow.GeometrySerializer`  virtual methods.  
      :type `ser`: wx.TopLevelWindow.GeometrySerializer






      :rtype: `bool`



                  



      :returns: 

         ``True`` if the geometry was saved, ``False`` if doing it failed  







      .. versionadded:: 4.1/wxWidgets-3.1.2  
     








   .. method:: SetDefaultItem(self, win)

      Changes the default item for the panel, usually `win`  is a button.                  

                


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




      :rtype: :ref:`wx.Window`







      .. seealso:: :meth:`GetDefaultItem`     








   .. method:: SetIcon(self, icon)

      Sets the icon for this window.                  




      :param `icon`: The :ref:`wx.Icon`  to associate with this window.  
      :type `icon`: wx.Icon




                  



      .. note:: 

         The window takes a 'copy' of `icon`, but since it uses reference counting, the copy is very quick. It is safe to delete `icon`  after calling this function.  







      .. note:: 

         In wxMSW, `icon`  must be either 16x16 or 32x32 icon.  







      .. seealso:: :ref:`wx.Icon`, :meth:`SetIcons`     








   .. method:: SetIcons(self, icons)

      Sets several icons of different sizes for this window: this allows using different icons for different situations (e.g.                  

      task switching bar, taskbar, window title bar) instead of scaling, with possibly bad looking results, the only icon set by :meth:`SetIcon` . 




      :param `icons`: The icons to associate with this window.  
      :type `icons`: wx.IconBundle




                  



      .. note:: 

         In wxMSW, `icons`  must contain a 16x16 or 32x32 icon, preferably both.  







      .. seealso:: :ref:`wx.IconBundle`    








   .. method:: SetMaxSize(self, size)

      A simpler interface for setting the size hints than :meth:`SetSizeHints` .                  


      :param `size`: 
      :type `size`: wx.Size







   .. method:: SetMinSize(self, size)

      A simpler interface for setting the size hints than :meth:`SetSizeHints` .                  


      :param `size`: 
      :type `size`: wx.Size







   .. method:: SetRepresentedFilename(self, filename)

      Sets the file name represented by this :ref:`wx.TopLevelWindow`.                  

      Under macOS, this file name is used to set the "proxy icon", which appears in the window title bar near its title, corresponding to this file name. Under other platforms it currently doesn't do anything but it is harmless to call it now and it might be implemented to do something useful in the future so you're encouraged to use it for any window representing a file-based document. 

                


      :param `filename`: 
      :type `filename`: string






      .. versionadded:: 2.9.4 
     








   .. method:: SetSizeHints(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **SetSizeHints** `(self, minW, minH, maxW=-1, maxH=-1, incW=-1, incH=-1)`
      
      Allows specification of minimum and maximum window sizes, and window size increments.                  
      
      If a pair of values is not set (or set to -1), no constraints will be used. 
      
      
      
      
      :param `minW`: The minimum width.   
      :type `minW`: int
      :param `minH`: The minimum height.   
      :type `minH`: int
      :param `maxW`: The maximum width.   
      :type `maxW`: int
      :param `maxH`: The maximum height.   
      :type `maxH`: int
      :param `incW`: Specifies the increment for sizing the width (GTK/Motif/Xt only).   
      :type `incW`: int
      :param `incH`: Specifies the increment for sizing the height (GTK/Motif/Xt only).  
      :type `incH`: int
      
      
      
      
      
      
      
      
      
      
      
      
      
      
                        
      
      
      
      .. note:: 
      
         Notice that this function not only prevents the user from resizing the window outside the given bounds but it also prevents the program itself from doing it using :meth:`wx.Window.SetSize` .   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **SetSizeHints** `(self, minSize, maxSize=DefaultSize, incSize=DefaultSize)`
      
      Allows specification of minimum and maximum window sizes, and window size increments.                  
      
      If a pair of values is not set (or set to -1), no constraints will be used. 
      
      
      
      
      :param `minSize`: The minimum size of the window.   
      :type `minSize`: wx.Size
      :param `maxSize`: The maximum size of the window.   
      :type `maxSize`: wx.Size
      :param `incSize`: Increment size (only taken into account under X11-based ports such as GTK/wxMotif/wxX11).  
      :type `incSize`: wx.Size
      
      
      
      
      
      
      
      
                        
      
      
      
      .. note:: 
      
         Notice that this function not only prevents the user from resizing the window outside the given bounds but it also prevents the program itself from doing it using :meth:`wx.Window.SetSize` .   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: SetTitle(self, title)

      Sets the window title.                  




      :param `title`: The window title.  
      :type `title`: string




                  



      .. seealso:: :meth:`GetTitle`     








   .. method:: SetTmpDefaultItem(self, win)




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




      :rtype: :ref:`wx.Window`








   .. method:: SetTransparent(self, alpha)

      If the platform supports it will set the window to be translucent.                  




      :param `alpha`: Determines how opaque or transparent the window will be, if the platform supports the operation. A value of 0 sets the window to be fully transparent, and a value of 255 sets the window to be fully opaque.   
      :type `alpha`: wx.Byte






      :rtype: `bool`



                  





   .. method:: ShouldPreventAppExit(self)

      This virtual function is not meant to be called directly but can be overridden to return ``False`` (it returns ``True`` by default) to allow the application to close even if this, presumably not very important, window is still opened.                  

      By default, the application stays alive as long as there are any open top level windows.                  

      :rtype: `bool`








   .. method:: ShowFullScreen(self, show, style=FULLSCREEN_ALL)

      Depending on the value of `show`  parameter the window is either shown full screen or restored to its normal state.                  

      `style`  is a bit list containing some or all of the following values, which indicate what elements of the window to hide in full-screen mode: 



      -  ``FULLSCREEN_NOMENUBAR``     
      -  ``FULLSCREEN_NOTOOLBAR``     
      -  ``FULLSCREEN_NOSTATUSBAR``     
      -  ``FULLSCREEN_NOBORDER``     
      -  ``FULLSCREEN_NOCAPTION``     
      -  ``FULLSCREEN_ALL``  (all of the above) 




      This function has not been tested with MDI frames. 

                


      :param `show`: 
      :type `show`: bool
      :param `style`: 
      :type `style`: long




      :rtype: `bool`







      .. note:: 

         Showing a window full screen also actually :meth:`Show` s the window if it isn't shown.  







      .. seealso:: :meth:`EnableFullScreenView` , :meth:`IsFullScreen`     








   .. method:: ShowWithoutActivating(self)

      Show the :ref:`wx.TopLevelWindow`, but do not give it keyboard focus.                  

      This can be used for pop up or notification windows that should not steal the current focus.                   





   .. attribute:: DefaultItem

      See :meth:`~wx.TopLevelWindow.GetDefaultItem` and :meth:`~wx.TopLevelWindow.SetDefaultItem`


   .. attribute:: Icon

      See :meth:`~wx.TopLevelWindow.GetIcon` and :meth:`~wx.TopLevelWindow.SetIcon`


   .. attribute:: MacMetalAppearance

      See :meth:`~wx.TopLevelWindow.MacGetMetalAppearance` and :meth:`~wx.TopLevelWindow.MacSetMetalAppearance`


   .. attribute:: OSXModified

      See :meth:`~wx.TopLevelWindow.OSXIsModified` and :meth:`~wx.TopLevelWindow.OSXSetModified`


   .. attribute:: Title

      See :meth:`~wx.TopLevelWindow.GetTitle` and :meth:`~wx.TopLevelWindow.SetTitle`


   .. attribute:: TmpDefaultItem

      See :meth:`~wx.TopLevelWindow.GetTmpDefaultItem` and :meth:`~wx.TopLevelWindow.SetTmpDefaultItem`

