***************** wx.TopLevelWindow ***************** Inheritance diagram for `wx.TopLevelWindow`: | .. inheritance-diagram:: wx.TopLevelWindow | Description =========== `wx.TopLevelWindow` is a common base class for `wx.Dialog `_ and `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. Derived From ^^^^^^^^^^^^^ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.ColourDialog `_, `wx.Dialog `_, `wx.DirDialog `_, `wx.FileDialog `_, `wx.FindReplaceDialog `_, `wx.FontDialog `_, `wx.Frame `_, `wx.MDIChildFrame `_, `wx.MDIParentFrame `_, `wx.MessageDialog `_, `wx.MiniFrame `_, `wx.MultiChoiceDialog `_, `wx.NumberEntryDialog`, `wx.PasswordEntryDialog `_, `wx.PreviewFrame `_, `wx.ProgressDialog `_, `wx.PyPreviewFrame `_, `wx.SingleChoiceDialog `_, `wx.SplashScreen `_, `wx.TextEntryDialog `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CanSetTransparent <#CanSetTransparent>`_ * `CenterOnScreen <#CenterOnScreen>`_ * `EnableCloseButton <#EnableCloseButton>`_ * `GetDefaultItem <#GetDefaultItem>`_ * `GetIcon <#GetIcon>`_ * `GetTitle <#GetTitle>`_ * `GetTmpDefaultItem <#GetTmpDefaultItem>`_ * `Iconize <#Iconize>`_ * `IsActive <#IsActive>`_ * `IsAlwaysMaximized <#IsAlwaysMaximized>`_ * `IsFullScreen <#IsFullScreen>`_ * `IsIconized <#IsIconized>`_ * `IsMaximized <#IsMaximized>`_ * `MacGetMetalAppearance <#MacGetMetalAppearance>`_ * `MacGetTopLevelWindowRef <#MacGetTopLevelWindowRef>`_ * `MacGetUnifiedAppearance <#MacGetUnifiedAppearance>`_ * `MacSetMetalAppearance <#MacSetMetalAppearance>`_ * `Maximize <#Maximize>`_ * `RequestUserAttention <#RequestUserAttention>`_ * `Restore <#Restore>`_ * `SetDefaultItem <#SetDefaultItem>`_ * `SetIcon <#SetIcon>`_ * `SetIcons <#SetIcons>`_ * `SetShape <#SetShape>`_ * `SetSizeHints <#SetSizeHints>`_ * `SetTitle <#SetTitle>`_ * `SetTransparent <#SetTransparent>`_ * `SetTmpDefaultItem <#SetTmpDefaultItem>`_ * `ShowFullScreen <#ShowFullScreen>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `DefaultItem <#DefaultItem>`_ * `Icon <#Icon>`_ * `Title <#Title>`_ * `TmpDefaultItem <#TmpDefaultItem>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() `No docstrings available for this method.` -------- .. method:: CanSetTransparent() Returns ``True`` if the platform supports making the window translucent. .. seealso:: `SetTransparent <#SetTransparent>`_ -------- .. method:: CenterOnScreen(dir=wx.BOTH) Center the window on screen **Parameters:** * `dir` (int) -------- .. method:: EnableCloseButton(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). Currently only implemented for wxMSW and wxGTK. Returns ``True`` if operation was successful. **Parameters:** * `enable` (bool) | **Returns:** `bool` -------- .. method:: GetDefaultItem() Returns a pointer to the button which is the default for this window, or ``None``. The default button is the one activated by pressing the ``Enter`` key. | **Returns:** `wx.Window `_ -------- .. method:: GetIcon() Returns the standard icon of the window. The icon will be invalid if it hadn't been previously set by `SetIcon <#SetIcon>`_. | **Returns:** `wx.Icon `_ -------- .. method:: GetTitle() Gets a string containing the window title. | **Returns:** `string` .. seealso:: `SetTitle <#SetTitle>`_ -------- .. method:: GetTmpDefaultItem() Return the temporary default item, which can be ``None``. | **Returns:** `wx.Window `_ -------- .. method:: Iconize(iconize) Iconizes or restores the window. **Parameters:** * `iconize` (bool): ``True`` to iconize the window, ``False`` to restore it. .. seealso:: `IsIconized <#IsIconized>`_, `Maximize <#Maximize>`_. -------- .. method:: IsActive() Returns ``True`` if this window is currently active, i.e. if the user is currently working with it. | **Returns:** `bool` -------- .. method:: 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. | **Returns:** `bool` -------- .. method:: IsFullScreen() Returns ``True`` if the window is in fullscreen mode. | **Returns:** `bool` .. seealso:: `ShowFullScreen <#ShowFullScreen>`_ -------- .. method:: IsIconized() Returns ``True`` if the window is iconized. | **Returns:** `bool` -------- .. method:: IsMaximized() Returns ``True`` if the window is maximized. | **Returns:** `bool` -------- .. method:: MacGetMetalAppearance() `No docstrings available for this method.` -------- .. method:: MacGetTopLevelWindowRef() `No docstrings available for this method.` -------- .. method:: MacGetUnifiedAppearance() `No docstrings available for this method.` -------- .. method:: MacSetMetalAppearance(on) | **Parameters:** * `on` (bool) -------- .. method:: Maximize(maximize) Maximizes or restores the window. **Parameters:** * `maximize` (bool): ``True`` to maximize the window, ``False`` to restore it. .. seealso:: `Iconize <#Iconize>`_ -------- .. method:: RequestUserAttention(flags=wx.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 ``wx.USER_ATTENTION_INFO`` (default) or ``wx.USER_ATTENTION_ERROR`` which results in a more drastic action. When in doubt, use the default value. **Parameters:** * `flags` (int) .. note:: Note that this function should normally be only used when the application is not already in foreground. .. note:: This function is currently implemented for Win32 where it flashes the window icon in the taskbar, and for wxGTK with task bars supporting it. -------- .. method:: Restore() `No docstrings available for this method.` -------- .. method:: SetDefaultItem(win) Changes the default item for the panel, usually `win` is a button. **Parameters:** * `win` (`wx.Window `_) .. seealso:: `GetDefaultItem <#GetDefaultItem>`_ -------- .. method:: SetIcon(icon) Sets the icon for this window. **Parameters:** * `icons` (`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. -------- .. method:: SetIcons(icons) Sets several icons of different sizes for this window: this allows to use 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 `SetIcon <#SetIcon>`_. **Parameters:** * `icons` (`wx.IconBundle `_): The icons to associate with this window. .. seealso:: `wx.IconBundle `_. -------- .. method:: SetShape(region) If the platform supports it, sets the shape of the window to that depicted by `region`. The system will not display or respond to any mouse event for the pixels that lie outside of the region. To reset the window to the normal rectangular shape simply call `SetShape` again with an empty region. Returns ``True`` if the operation is successful. **Parameters:** * `region` (`wx.Region `_) | **Returns:** `bool` -------- .. method:: SetSizeHints(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), the default values will be used. Sizers will also inspect the minimum window size and will use that value if set when calculating layout. The resizing increments are only significant under Motif or Xt. **Parameters:** * `minW` (int): Minimum width. * `minH` (int): Minimum height. * `maxW` (int): Maximum width. * `maxH` (int): Maximum height. * `incW` (int): Specifies the increment for sizing the width (Motif/Xt only). * `incH` (int): Specifies the increment for sizing the height (Motif/Xt only). .. note:: If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) -------- .. method:: SetTitle(title) Sets the window title. **Parameters:** * `title` (string): The window title. .. seealso:: `GetTitle <#GetTitle>`_ -------- .. method:: SetTmpDefaultItem(win) Set this child as temporary default **Parameters:** * `win` (`wx.Window `_) -------- .. method:: SetTransparent(alpha) If the platform supports it will set the window to be translucent. Returns ``True`` if the transparency was successfully changed. **Parameters:** * `alpha` (int): 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. -------- .. method:: ShowFullScreen(show, style=wx.FULLSCREEN_ALL) Depending on the value of `show` parameter the window is either shown full screen or restored to its normal state. **Parameters:** * `show` (bool) * `style` (long): 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: * ``wx.FULLSCREEN_NOMENUBAR`` * ``wx.FULLSCREEN_NOTOOLBAR`` * ``wx.FULLSCREEN_NOSTATUSBAR`` * ``wx.FULLSCREEN_NOBORDER`` * ``wx.FULLSCREEN_NOCAPTION`` * ``wx.FULLSCREEN_ALL`` (all of the above) | **Returns:** `bool` .. note:: This function has not been tested with MDI frames. .. note:: Note that showing a window full screen also actually `Show `_ if it hadn't been shown yet. .. seealso:: `IsFullScreen <#IsFullScreen>`_ -------- Properties ^^^^^^^^^^ .. attribute:: DefaultItem See `GetDefaultItem <#GetDefaultItem>`_ and `SetDefaultItem <#SetDefaultItem>`_ .. attribute:: Icon See `GetIcon <#GetIcon>`_ and `SetIcon <#SetIcon>`_ .. attribute:: Title See `GetTitle <#GetTitle>`_ and `SetTitle <#SetTitle>`_ .. attribute:: TmpDefaultItem See `GetTmpDefaultItem <#GetTmpDefaultItem>`_ and `SetTmpDefaultItem <#SetTmpDefaultItem>`_