wx.TopLevelWindow

Inheritance diagram for wx.TopLevelWindow:



Class API

Methods

__init__()
No docstrings available for this method.

CanSetTransparent()
Returns True if the platform supports making the window translucent.

See also

SetTransparent


CenterOnScreen(dir=wx.BOTH)

Center the window on screen

Parameters:

  • dir (int)

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


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


GetIcon()

Returns the standard icon of the window.

The icon will be invalid if it hadn’t been previously set by SetIcon.


Returns:

wx.Icon


GetTitle()

Gets a string containing the window title.


Returns:

string

See also

SetTitle


GetTmpDefaultItem()

Return the temporary default item, which can be None.


Returns:

wx.Window


Iconize(iconize)

Iconizes or restores the window.

Parameters:

  • iconize (bool): True to iconize the window, False to restore it.

See also

IsIconized, Maximize.


IsActive()

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


Returns:

bool


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


IsFullScreen()

Returns True if the window is in fullscreen mode.


Returns:

bool

See also

ShowFullScreen


IsIconized()

Returns True if the window is iconized.


Returns:

bool


IsMaximized()

Returns True if the window is maximized.


Returns:

bool


MacGetMetalAppearance()
No docstrings available for this method.

MacGetTopLevelWindowRef()
No docstrings available for this method.

MacGetUnifiedAppearance()
No docstrings available for this method.

MacSetMetalAppearance(on)

Parameters:

  • on (bool)

Maximize(maximize)

Maximizes or restores the window.

Parameters:

  • maximize (bool): True to maximize the window, False to restore it.

See also

Iconize


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.


Restore()
No docstrings available for this method.

SetDefaultItem(win)

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

Parameters:

See also

GetDefaultItem


SetIcon(icon)

Sets the icon for this window.

Parameters:

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.


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.

Parameters:

  • icons (wx.IconBundle): The icons to associate with this window.

See also

wx.IconBundle.


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:


Returns:

bool


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.)


SetTitle(title)

Sets the window title.

Parameters:

  • title (string): The window title.

See also

GetTitle


SetTmpDefaultItem(win)

Set this child as temporary default

Parameters:


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.

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.

See also

IsFullScreen


Properties

DefaultItem
See GetDefaultItem and SetDefaultItem
Icon
See GetIcon and SetIcon
Title
See GetTitle and SetTitle
TmpDefaultItem
See GetTmpDefaultItem and SetTmpDefaultItem