********* wx.Window ********* Inheritance diagram for `wx.Window`: | .. inheritance-diagram:: wx.Window | Description =========== `wx.Window` is the base class for all windows and represents any visible object on screen. All controls, top level windows and so on are windows. Sizers and device contexts are not, however, as they don't appear on screen themselves. .. note:: Please note that all children of the window will be deleted automatically by the destructor before the window itself is deleted which means that you don't have to worry about deleting them manually. .. note:: Also note that in this, and many others, wxWidgets classes some `GetXXX()` methods may be overloaded (as, for example, `GetSize <#GetSize>`_ or `GetClientSize <#GetClientSize>`_). In this case, the overloads are non-virtual because having multiple virtual functions with the same name results in a virtual function name hiding at the derived class level (in English, this means that the derived class has to override all overloaded variants if it overrides any of them). To allow overriding them in the derived class, wxWidgets uses a unique protected virtual `DoGetXXX()` method and all `GetXXX()` ones are forwarded to it, so overriding the former changes the behaviour of the latter. Derived From ^^^^^^^^^^^^^ * `wx.EvtHandler `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.BitmapButton `_, `wx.Button `_, `wx.CheckBox `_, `wx.CheckListBox `_, `wx.Choice `_, `wx.Choicebook `_, `wx.CollapsiblePane `_, `wx.ColourDialog `_, `wx.ColourPickerCtrl `_, `wx.ComboBox `_, `wx.ContextHelpButton `_, `wx.Control `_, `wx.ControlWithItems `_, `wx.DatePickerCtrl `_, `wx.DatePickerCtrlBase`, `wx.Dialog `_, `wx.DirDialog `_, `wx.DirFilterListCtrl `_, `wx.DirPickerCtrl `_, `wx.FileDialog `_, `wx.FilePickerCtrl `_, `wx.FindReplaceDialog `_, `wx.FontDialog `_, `wx.FontPickerCtrl `_, `wx.Frame `_, `wx.Gauge `_, `wx.GenericDatePickerCtrl`, `wx.GenericDirCtrl `_, `wx.HtmlListBox `_, `wx.HyperlinkCtrl `_, `wx.ListBox `_, `wx.ListCtrl `_, `wx.ListView `_, `wx.Listbook `_, `wx.MDIChildFrame `_, `wx.MDIClientWindow `_, `wx.MDIParentFrame `_, `wx.MenuBar `_, `wx.MessageDialog `_, `wx.MiniFrame `_, `wx.MultiChoiceDialog `_, `wx.Notebook `_, `wx.NotebookPage`, `wx.NumberEntryDialog`, `wx.Panel `_, `wx.PasswordEntryDialog `_, `wx.PickerBase `_, `wx.PopupTransientWindow`, `wx.PopupWindow`, `wx.PreviewCanvas `_, `wx.PreviewControlBar `_, `wx.PreviewFrame `_, `wx.ProgressDialog `_, `wx.PyAxBaseWindow `_, `wx.PyControl `_, `wx.PyPanel `_, `wx.PyPreviewControlBar `_, `wx.PyPreviewFrame `_, `wx.PyScrolledWindow `_, `wx.PyWindow `_, `wx.RadioBox `_, `wx.RadioButton `_, `wx.SashLayoutWindow `_, `wx.SashWindow `_, `wx.ScrollBar `_, `wx.ScrolledWindow `_, `wx.SearchCtrl `_, `wx.SimpleHtmlListBox `_, `wx.SingleChoiceDialog `_, `wx.Slider `_, `wx.SpinButton `_, `wx.SpinCtrl `_, `wx.SplashScreen `_, `wx.SplashScreenWindow`, `wx.SplitterWindow `_, `wx.StaticBitmap `_, `wx.StaticBox `_, `wx.StaticLine `_, `wx.StaticText `_, `wx.StatusBar `_, `wx.TextCtrl `_, `wx.TextEntryDialog `_, `wx.TipWindow `_, `wx.ToggleButton `_, `wx.ToolBar `_, `wx.ToolBarBase`, `wx.Toolbook `_, `wx.TopLevelWindow `_, `wx.TreeCtrl `_, `wx.Treebook `_, `wx.VListBox `_, `wx.VScrolledWindow `_ Window Styles ^^^^^^^^^^^^^ The following styles can apply to all windows, although they will not always make sense for a particular window class or on all platforms. ================================================== ================================================== Window Style Description ================================================== ================================================== ``wx.BORDER_SIMPLE`` Displays a thin border around the window. ``wx.SIMPLE_BORDER`` is the old name for this style. ``wx.BORDER_DOUBLE`` Displays a double border. ``wx.DOUBLE_BORDER`` is the old name for this style. Windows and Mac only. ``wx.BORDER_SUNKEN`` Displays a sunken border. ``wx.SUNKEN_BORDER`` is the old name for this style. ``wx.BORDER_RAISED`` Displays a raised border. ``wx.RAISED_BORDER`` is the old name for this style. ``wx.BORDER_STATIC`` Displays a border suitable for a static control. ``wx.STATIC_BORDER`` is the old name for this style. Windows only. ``wx.BORDER_THEME`` Displays a themed border where possible. Currently this has an effect on Windows XP and above only. ``wx.BORDER_NONE`` Displays no border, overriding the default border style for the window. ``wx.NO_BORDER`` is the old name for this style. ``wx.TRANSPARENT_WINDOW`` The window is transparent, that is, it will not receive paint events. Windows only. ``wx.TAB_TRAVERSAL`` Use this to enable tab traversal for non-dialog windows. ``wx.WANTS_CHARS`` Use this to indicate that the window wants to get all char/key events for all keys - even for keys like ``TAB`` or ``ENTER`` which are usually used for dialog navigation and which wouldn't be generated without this style. If you need to use this style in order to get the arrows or etc., but would still like to have normal keyboard navigation take place, you should create and send a `wx.NavigationKeyEvent <../Events/wx.NavigationKeyEvents.html>`_ in response to the key events for ``Tab`` and ``Shift-Tab``. ``wx.NO_FULL_REPAINT_ON_RESIZE`` On Windows, this style used to disable repainting the window completely when its size is changed. Since this behaviour is now the default, the style is now obsolete and no longer has an effect. ``wx.VSCROLL`` Use this style to enable a vertical scrollbar. ``wx.HSCROLL`` Use this style to enable a horizontal scrollbar. ``wx.ALWAYS_SHOW_SB`` If a window has scrollbars, disable them instead of hiding them when they are not needed (i.e. when the size of the window is big enough to not require the scrollbars to navigate it). This style is currently implemented for wxMSW, wxGTK and wxUniversal and does nothing on the other platforms. ``wx.CLIP_CHILDREN`` Use this style to eliminate flicker caused by the background being repainted, then children being painted over them. Windows only. ``wx.FULL_REPAINT_ON_RESIZE`` Use this style to force a complete redraw of the window whenever it is resized instead of redrawing just the part of the window affected by resizing. Note that this was the behaviour by default before 2.5.1 release and that if you experience redraw problems with code which previously used to work you may want to try this. Currently this style applies on GTK+ 2 and Windows only, and full repainting is always done on other platforms. ================================================== ================================================== Extra Window Styles ^^^^^^^^^^^^^^^^^^^ The following are extra styles, set using `SetExtraStyle <#SetExtraStyle>`_. ================================================== ================================================== Window Extra Style Description ================================================== ================================================== ``wx.WS_EX_VALIDATE_RECURSIVELY`` By default, `Validate <#Validate>`_ / `TransferDataToWindow <#TransferDataToWindow>`_ / `TransferDataFromWindow <#TransferDataFromWindow>`_ only work on direct children of the window (compatible behaviour). Set this flag to make them recursively descend into all subwindows. ``wx.WS_EX_BLOCK_EVENTS`` `wx.CommandEvents <../Events/wx.CommandEvent.html>`_ and the objects of the derived classes are forwarded to the parent window and so on recursively by default. Using this flag for the given window allows to block this propagation at this window, i.e. prevent the events from being propagated further upwards. Dialogs have this flag on by default. ``wx.WS_EX_TRANSIENT`` Don't use this window as an implicit parent for the other windows: this must be used with transient windows as otherwise there is the risk of creating a dialog/frame with this window as a parent which would lead to a crash if the parent is destroyed before the child. ``wx.WS_EX_PROCESS_IDLE`` This window should always process idle events, even if the mode set by `wx.IdleEvent.SetMode <../Events/wx.IdleEvent.html#SetMode>`_ is ``wx.IDLE_PROCESS_SPECIFIED``. ``wx.WS_EX_PROCESS_UI_UPDATES`` This window should always process UI update events, even if the mode set by `wx.UpdateUIEvent.SetMode <../Events/wx.UpdateUIEvent.html#SetMode>`_ is ``wx.UPDATE_UI_PROCESS_SPECIFIED``. ================================================== ================================================== Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `AcceptsFocus <#AcceptsFocus>`_ * `AcceptsFocusFromKeyboard <#AcceptsFocusFromKeyboard>`_ * `AddChild <#AddChild>`_ * `AdjustForLayoutDirection <#AdjustForLayoutDirection>`_ * `AssociateHandle <#AssociateHandle>`_ * `CacheBestSize <#CacheBestSize>`_ * `CanSetTransparent <#CanSetTransparent>`_ * `CaptureMouse <#CaptureMouse>`_ * `Center <#Center>`_ * `CenterOnParent <#CenterOnParent>`_ * `Centre <#Centre>`_ * `CentreOnParent <#CentreOnParent>`_ * `ClearBackground <#ClearBackground>`_ * `ClientToScreen <#ClientToScreen>`_ * `ClientToScreenXY <#ClientToScreenXY>`_ * `ClientToWindowSize <#ClientToWindowSize>`_ * `Close <#Close>`_ * `ConvertDialogPointToPixels <#ConvertDialogPointToPixels>`_ * `ConvertDialogSizeToPixels <#ConvertDialogSizeToPixels>`_ * `ConvertPixelPointToDialog <#ConvertPixelPointToDialog>`_ * `ConvertPixelSizeToDialog <#ConvertPixelSizeToDialog>`_ * `Create <#Create>`_ * `DLG_PNT <#DLG_PNT>`_ * `DLG_SZE <#DLG_SZE>`_ * `Destroy <#Destroy>`_ * `DestroyChildren <#DestroyChildren>`_ * `Disable <#Disable>`_ * `DissociateHandle <#DissociateHandle>`_ * `DragAcceptFiles <#DragAcceptFiles>`_ * `Enable <#Enable>`_ * `FindFocus <#FindFocus>`_ * `FindWindowById <#FindWindowById>`_ * `FindWindowByLabel <#FindWindowByLabel>`_ * `FindWindowByName <#FindWindowByName>`_ * `Fit <#Fit>`_ * `FitInside <#FitInside>`_ * `Freeze <#Freeze>`_ * `GetAcceleratorTable <#GetAcceleratorTable>`_ * `GetAdjustedBestSize <#GetAdjustedBestSize>`_ * `GetAutoLayout <#GetAutoLayout>`_ * `GetBackgroundColour <#GetBackgroundColour>`_ * `GetBackgroundStyle <#GetBackgroundStyle>`_ * `GetBestSize <#GetBestSize>`_ * `GetBestSizeTuple <#GetBestSizeTuple>`_ * `GetBestVirtualSize <#GetBestVirtualSize>`_ * `GetBorder <#GetBorder>`_ * `GetCapture <#GetCapture>`_ * `GetCaret <#GetCaret>`_ * `GetCharHeight <#GetCharHeight>`_ * `GetCharWidth <#GetCharWidth>`_ * `GetChildren <#GetChildren>`_ * `GetClassDefaultAttributes <#GetClassDefaultAttributes>`_ * `GetClientAreaOrigin <#GetClientAreaOrigin>`_ * `GetClientRect <#GetClientRect>`_ * `GetClientSize <#GetClientSize>`_ * `GetClientSizeTuple <#GetClientSizeTuple>`_ * `GetConstraints <#GetConstraints>`_ * `GetContainingSizer <#GetContainingSizer>`_ * `GetCursor <#GetCursor>`_ * `GetDefaultAttributes <#GetDefaultAttributes>`_ * `GetDropTarget <#GetDropTarget>`_ * `GetEffectiveMinSize <#GetEffectiveMinSize>`_ * `GetEventHandler <#GetEventHandler>`_ * `GetExtraStyle <#GetExtraStyle>`_ * `GetFont <#GetFont>`_ * `GetForegroundColour <#GetForegroundColour>`_ * `GetFullTextExtent <#GetFullTextExtent>`_ * `GetGrandParent <#GetGrandParent>`_ * `GetGtkWidget <#GetGtkWidget>`_ * `GetHandle <#GetHandle>`_ * `GetHelpText <#GetHelpText>`_ * `GetHelpTextAtPoint <#GetHelpTextAtPoint>`_ * `GetId <#GetId>`_ * `GetLabel <#GetLabel>`_ * `GetLayoutDirection <#GetLayoutDirection>`_ * `GetMaxHeight <#GetMaxHeight>`_ * `GetMaxSize <#GetMaxSize>`_ * `GetMaxWidth <#GetMaxWidth>`_ * `GetMinHeight <#GetMinHeight>`_ * `GetMinSize <#GetMinSize>`_ * `GetMinWidth <#GetMinWidth>`_ * `GetName <#GetName>`_ * `GetParent <#GetParent>`_ * `GetPosition <#GetPosition>`_ * `GetPositionTuple <#GetPositionTuple>`_ * `GetRect <#GetRect>`_ * `GetScreenPosition <#GetScreenPosition>`_ * `GetScreenPositionTuple <#GetScreenPositionTuple>`_ * `GetScreenRect <#GetScreenRect>`_ * `GetScrollPos <#GetScrollPos>`_ * `GetScrollRange <#GetScrollRange>`_ * `GetScrollThumb <#GetScrollThumb>`_ * `GetSize <#GetSize>`_ * `GetSizeTuple <#GetSizeTuple>`_ * `GetSizer <#GetSizer>`_ * `GetTextExtent <#GetTextExtent>`_ * `GetThemeEnabled <#GetThemeEnabled>`_ * `GetToolTip <#GetToolTip>`_ * `GetTopLevelParent <#GetTopLevelParent>`_ * `GetUpdateClientRect <#GetUpdateClientRect>`_ * `GetUpdateRegion <#GetUpdateRegion>`_ * `GetValidator <#GetValidator>`_ * `GetVirtualSize <#GetVirtualSize>`_ * `GetVirtualSizeTuple <#GetVirtualSizeTuple>`_ * `GetWindowBorderSize <#GetWindowBorderSize>`_ * `GetWindowStyleFlag <#GetWindowStyleFlag>`_ * `GetWindowVariant <#GetWindowVariant>`_ * `HasCapture <#HasCapture>`_ * `HasFlag <#HasFlag>`_ * `HasMultiplePages <#HasMultiplePages>`_ * `HasScrollbar <#HasScrollbar>`_ * `HasTransparentBackground <#HasTransparentBackground>`_ * `Hide <#Hide>`_ * `HitTest <#HitTest>`_ * `HitTestXY <#HitTestXY>`_ * `InheritAttributes <#InheritAttributes>`_ * `InheritsBackgroundColour <#InheritsBackgroundColour>`_ * `InitDialog <#InitDialog>`_ * `InvalidateBestSize <#InvalidateBestSize>`_ * `IsBeingDeleted <#IsBeingDeleted>`_ * `IsDoubleBuffered <#IsDoubleBuffered>`_ * `IsEnabled <#IsEnabled>`_ * `IsExposed <#IsExposed>`_ * `IsExposedPoint <#IsExposedPoint>`_ * `IsExposedRect <#IsExposedRect>`_ * `IsFrozen <#IsFrozen>`_ * `IsRetained <#IsRetained>`_ * `IsShown <#IsShown>`_ * `IsShownOnScreen <#IsShownOnScreen>`_ * `IsTopLevel <#IsTopLevel>`_ * `Layout <#Layout>`_ * `LineDown <#LineDown>`_ * `LineUp <#LineUp>`_ * `Lower <#Lower>`_ * `MakeModal <#MakeModal>`_ * `Move <#Move>`_ * `MoveAfterInTabOrder <#MoveAfterInTabOrder>`_ * `MoveBeforeInTabOrder <#MoveBeforeInTabOrder>`_ * `MoveXY <#MoveXY>`_ * `Navigate <#Navigate>`_ * `NewControlId <#NewControlId>`_ * `NextControlId <#NextControlId>`_ * `OnPaint <#OnPaint>`_ * `PageDown <#PageDown>`_ * `PageUp <#PageUp>`_ * `PopEventHandler <#PopEventHandler>`_ * `PopupMenu <#PopupMenu>`_ * `PopupMenuXY <#PopupMenuXY>`_ * `PostCreate <#PostCreate>`_ * `PrepareDC <#PrepareDC>`_ * `PrevControlId <#PrevControlId>`_ * `PushEventHandler <#PushEventHandler>`_ * `Raise <#Raise>`_ * `Refresh <#Refresh>`_ * `RefreshRect <#RefreshRect>`_ * `RegisterHotKey <#RegisterHotKey>`_ * `ReleaseMouse <#ReleaseMouse>`_ * `RemoveChild <#RemoveChild>`_ * `RemoveEventHandler <#RemoveEventHandler>`_ * `Reparent <#Reparent>`_ * `ScreenToClient <#ScreenToClient>`_ * `ScreenToClientXY <#ScreenToClientXY>`_ * `ScrollLines <#ScrollLines>`_ * `ScrollPages <#ScrollPages>`_ * `ScrollWindow <#ScrollWindow>`_ * `SendSizeEvent <#SendSizeEvent>`_ * `SetAcceleratorTable <#SetAcceleratorTable>`_ * `SetAutoLayout <#SetAutoLayout>`_ * `SetBackgroundColour <#SetBackgroundColour>`_ * `SetBackgroundStyle <#SetBackgroundStyle>`_ * `SetCaret <#SetCaret>`_ * `SetClientRect <#SetClientRect>`_ * `SetClientSize <#SetClientSize>`_ * `SetClientSizeWH <#SetClientSizeWH>`_ * `SetConstraints <#SetConstraints>`_ * `SetContainingSizer <#SetContainingSizer>`_ * `SetCursor <#SetCursor>`_ * `SetDimensions <#SetDimensions>`_ * `SetDoubleBuffered <#SetDoubleBuffered>`_ * `SetDropTarget <#SetDropTarget>`_ * `SetEventHandler <#SetEventHandler>`_ * `SetExtraStyle <#SetExtraStyle>`_ * `SetFocus <#SetFocus>`_ * `SetFocusFromKbd <#SetFocusFromKbd>`_ * `SetFont <#SetFont>`_ * `SetForegroundColour <#SetForegroundColour>`_ * `SetHelpText <#SetHelpText>`_ * `SetHelpTextForId <#SetHelpTextForId>`_ * `SetId <#SetId>`_ * `SetInitialSize <#SetInitialSize>`_ * `SetLabel <#SetLabel>`_ * `SetLayoutDirection <#SetLayoutDirection>`_ * `SetMaxSize <#SetMaxSize>`_ * `SetMinSize <#SetMinSize>`_ * `SetName <#SetName>`_ * `SetOwnBackgroundColour <#SetOwnBackgroundColour>`_ * `SetOwnFont <#SetOwnFont>`_ * `SetOwnForegroundColour <#SetOwnForegroundColour>`_ * `SetRect <#SetRect>`_ * `SetScrollPos <#SetScrollPos>`_ * `SetScrollbar <#SetScrollbar>`_ * `SetSize <#SetSize>`_ * `SetSizeHints <#SetSizeHints>`_ * `SetSizeHintsSz <#SetSizeHintsSz>`_ * `SetSizeWH <#SetSizeWH>`_ * `SetSizer <#SetSizer>`_ * `SetSizerAndFit <#SetSizerAndFit>`_ * `SetThemeEnabled <#SetThemeEnabled>`_ * `SetToolTip <#SetToolTip>`_ * `SetToolTipString <#SetToolTipString>`_ * `SetTransparent <#SetTransparent>`_ * `SetValidator <#SetValidator>`_ * `SetVirtualSize <#SetVirtualSize>`_ * `SetVirtualSizeHints <#SetVirtualSizeHints>`_ * `SetVirtualSizeHintsSz <#SetVirtualSizeHintsSz>`_ * `SetVirtualSizeWH <#SetVirtualSizeWH>`_ * `SetWindowStyle <#SetWindowStyle>`_ * `SetWindowStyleFlag <#SetWindowStyleFlag>`_ * `SetWindowVariant <#SetWindowVariant>`_ * `ShouldInheritColours <#ShouldInheritColours>`_ * `Show <#Show>`_ * `Thaw <#Thaw>`_ * `ToggleWindowStyle <#ToggleWindowStyle>`_ * `TransferDataFromWindow <#TransferDataFromWindow>`_ * `TransferDataToWindow <#TransferDataToWindow>`_ * `UnregisterHotKey <#UnregisterHotKey>`_ * `Update <#Update>`_ * `UpdateWindowUI <#UpdateWindowUI>`_ * `UseBgCol <#UseBgCol>`_ * `Validate <#Validate>`_ * `WarpPointer <#WarpPointer>`_ * `WindowToClientSize <#WindowToClientSize>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `AcceleratorTable <#AcceleratorTable>`_ * `AutoLayout <#AutoLayout>`_ * `BackgroundColour <#BackgroundColour>`_ * `BackgroundStyle <#BackgroundStyle>`_ * `BestSize <#BestSize>`_ * `BestVirtualSize <#BestVirtualSize>`_ * `Border <#Border>`_ * `Caret <#Caret>`_ * `CharHeight <#CharHeight>`_ * `CharWidth <#CharWidth>`_ * `Children <#Children>`_ * `ClientAreaOrigin <#ClientAreaOrigin>`_ * `ClientRect <#ClientRect>`_ * `ClientSize <#ClientSize>`_ * `Constraints <#Constraints>`_ * `ContainingSizer <#ContainingSizer>`_ * `Cursor <#Cursor>`_ * `DefaultAttributes <#DefaultAttributes>`_ * `DropTarget <#DropTarget>`_ * `EffectiveMinSize <#EffectiveMinSize>`_ * `Enabled <#Enabled>`_ * `EventHandler <#EventHandler>`_ * `ExtraStyle <#ExtraStyle>`_ * `Font <#Font>`_ * `ForegroundColour <#ForegroundColour>`_ * `GrandParent <#GrandParent>`_ * `GtkWidget <#GtkWidget>`_ * `Handle <#Handle>`_ * `HelpText <#HelpText>`_ * `Id <#Id>`_ * `Label <#Label>`_ * `LayoutDirection <#LayoutDirection>`_ * `MaxHeight <#MaxHeight>`_ * `MaxSize <#MaxSize>`_ * `MaxWidth <#MaxWidth>`_ * `MinHeight <#MinHeight>`_ * `MinSize <#MinSize>`_ * `MinWidth <#MinWidth>`_ * `Name <#Name>`_ * `Parent <#Parent>`_ * `Position <#Position>`_ * `Rect <#Rect>`_ * `ScreenPosition <#ScreenPosition>`_ * `ScreenRect <#ScreenRect>`_ * `Shown <#Shown>`_ * `Size <#Size>`_ * `Sizer <#Sizer>`_ * `ThemeEnabled <#ThemeEnabled>`_ * `ToolTip <#ToolTip>`_ * `TopLevel <#TopLevel>`_ * `TopLevelParent <#TopLevelParent>`_ * `UpdateClientRect <#UpdateClientRect>`_ * `UpdateRegion <#UpdateRegion>`_ * `Validator <#Validator>`_ * `VirtualSize <#VirtualSize>`_ * `WindowStyle <#WindowStyle>`_ * `WindowStyleFlag <#WindowStyleFlag>`_ * `WindowVariant <#WindowVariant>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name=wx.PanelNameStr) Construct and show a generic `wx.Window`. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `name` (string) | **Returns:** `wx.Window `_ -------- .. method:: AcceptsFocus() Can this window have focus? | **Returns:** `bool` -------- .. method:: AcceptsFocusFromKeyboard() Can this window be given focus by keyboard navigation? if not, the only way to give it focus (provided it accepts it at all) is to click it. | **Returns:** `bool` -------- .. method:: AddChild(child) Adds a child window. This is called automatically by window creation functions so should not be required by the application programmer. **Parameters:** * `child` (`wx.Window `_): Child window to add. .. note:: Notice that this function is mostly internal to wxWidgets and shouldn't be called by the user code. -------- .. method:: AdjustForLayoutDirection(x, width, widthTotal) Mirror coordinates for RTL layout if this window uses it and if the mirroring is not done automatically like Win32. **Parameters:** * `x` (int) * `width` (int) * `widthTotal` (int) | **Returns:** `int` -------- .. method:: AssociateHandle(handle) Associate the window with a new native handle. | **Parameters:** * `handle` (long) -------- .. method:: CacheBestSize(size) Sets the cached best size value. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: CanSetTransparent() Returns ``True`` if the platform supports setting the transparency for this window. | **Returns:** `bool` .. note:: Note that this method will err on the side of caution, so it is possible that this will return ``False`` when it is in fact possible to set the transparency. .. note:: On X-windows systems the X server must have the composite extension loaded, and there must be a composite manager program (such as *xcompmgr*) running. -------- .. method:: CaptureMouse() Directs all mouse input to this window. Call `ReleaseMouse <#ReleaseMouse>`_ to release the capture. .. note:: Note that wxWidgets maintains the stack of windows having captured the mouse and when the mouse is released the capture returns to the window which had had captured it previously and it is only really released if there were no previous window. In particular, this means that you must release the mouse as many times as you capture it, unless the window receives the `wx.MouseCaptureLostEvent <../Events/wx.MouseCaptureLostEvent.html>`_ event. .. note: Any application which captures the mouse in the beginning of some operation **must** handle `wx.MouseCaptureLostEvent <../Events/wx.MouseCaptureLostEvent.html>`_ and cancel this operation when it receives the event. The event handler must not recapture mouse. .. seealso:: `ReleaseMouse <#ReleaseMouse>`_, `wx.MouseCaptureLostEvent <../Events/wx.MouseCaptureLostEvent.html>`_ -------- .. method:: Center(direction) A synonym for `Centre <#Centre>`_. **Parameters:** * `direction` (int) -------- .. method:: CenterOnParent(direction) A synonym for `CentreOnParent <#CentreOnParent>`_. **Parameters:** * `direction` (int) -------- .. method:: Centre(direction=wx.BOTH) Centres the window. **Parameters:** * `direction` (int): Specifies the direction for the centering. May be ``wx.HORIZONTAL``, ``wx.VERTICAL`` or ``wx.BOTH``. It may also include ``wx.CENTRE_ON_SCREEN`` flag if you want to center the window on the entire screen and not on its parent window. .. note:: If the window is a top level one (i.e. doesn't have a parent), it will be centered relative to the screen anyhow. .. seealso:: `Center <#Center>`_ -------- .. method:: CentreOnParent(direction=wx.BOTH) Centres the window on its parent. This is a more readable synonym for `Centre <#Centre>`_. **Parameters:** * `direction` (int): Specifies the direction for the centering. May be ``wx.HORIZONTAL``, ``wx.VERTICAL`` or ``wx.BOTH``. .. note:: This methods provides for a way to center top level windows over their parents instead of the entire screen. If there is no parent or if the window is not a top level window, then behaviour is the same as `Centre <#Centre>`_. .. seealso:: `CentreOnScreen <#CentreOnScreen>`_ -------- .. method:: ClearBackground() Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated. -------- .. method:: ClientToScreen(pt) Converts to screen coordinates from coordinates relative to this window. **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `wx.Point `_ -------- .. method:: ClientToScreenXY(x, y) Converts to screen coordinates from coordinates relative to this window. **Parameters:** * `x` (int) * `y` (int) | **Returns:** `(x, y)` -------- .. method:: ClientToWindowSize(size) Converts client area size `size` to corresponding window size. In other words, the returned value is what would `GetSize <#GetSize>`_ return if this window had client area of given size. Components with `wx.DefaultCoord` value are left unchanged. This function is new since wxWidgets version 2.8.8 **Parameters:** * `size` (`wx.Size `_) | **Returns:** `wx.Size `_ .. note:: Note that the conversion is not always exact, it assumes that non-client area doesn't change and so doesn't take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars. .. seealso:: `WindowToClientSize <#WindowToClientSize>`_ -------- .. method:: Close(force=False) This function simply generates a `wx.CloseEvent <../Events/wx.CloseEvent.html>`_ whose handler usually tries to close the window. It doesn't close the window itself, however. **Parameters:** * `force` (bool): ``False`` if the window's close handler should be able to veto the destruction of this window, ``True`` if it cannot. | **Returns:** `bool` .. note:: `Close` calls the close handler for the window, providing an opportunity for the window to choose whether to destroy the window. Usually it is only used with the top level windows (`wx.Frame `_ and `wx.Dialog `_ classes) as the others are not supposed to have any special `OnClose()` logic. The close handler should check whether the window is being deleted forcibly, using `wx.CloseEvent.CanVeto <../Events/wx.CloseEvent.html#CanVeto>`_, in which case it should destroy the window using `Destroy <#Destroy>`_. .. note:: Calling `Close` does not guarantee that the window will be destroyed; but it provides a way to simulate a manual close of a window, which may or may not be implemented by destroying the window. To guarantee that the window will be destroyed, call `Destroy <#Destroy>`_ instead. .. seealso:: `Destroy <#Destroy>`_, `wx.CloseEvent <../Events/wx.CloseEvent.html>`_ -------- .. method:: ConvertDialogPointToPixels(pt) Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the `x` dimension, the dialog units are multiplied by the average character width and then divided by 4. For the `y` dimension, the dialog units are multiplied by the average character height and then divided by 8. **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `wx.Point `_ -------- .. method:: ConvertDialogSizeToPixels(sz) Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the `x` dimension, the dialog units are multiplied by the average character width and then divided by 4. For the `y` dimension, the dialog units are multiplied by the average character height and then divided by 8. **Parameters:** * `sz` (`wx.Size `_) | **Returns:** `wx.Size `_ -------- .. method:: ConvertPixelPointToDialog(pt) Converts a point from pixels to dialog units. For the `x` dimension, the pixels are multiplied by 4 and then divided by the average character width. For the `y` dimension, the pixels are multiplied by 8 and then divided by the average character height **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `wx.Point `_ -------- .. method:: ConvertPixelSizeToDialog(sz) Converts a size from pixels to dialog units. For the `x` dimension, the pixels are multiplied by 4 and then divided by the average character width. For the `y` dimension, the pixels are multiplied by 8 and then divided by the average character height **Parameters:** * `sz` (`wx.Size `_) | **Returns:** `wx.Size `_ -------- .. method:: Create(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name=wx.PanelNameStr) Create the GUI part of the Window for 2-phase creation mode. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `name` (string) | **Returns:** `bool` -------- .. method:: DLG_PNT(pt) Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the `x` dimension, the dialog units are multiplied by the average character width and then divided by 4. For the `y` dimension, the dialog units are multiplied by the average character height and then divided by 8. **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `wx.Point `_ -------- .. method:: DLG_SZE(sz) Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the `x` dimension, the dialog units are multiplied by the average character width and then divided by 4. For the `y` dimension, the dialog units are multiplied by the average character height and then divided by 8. **Parameters:** * `sz` (`wx.Size `_) | **Returns:** `wx.Size `_ -------- .. method:: Destroy() Destroys the window safely. Frames and dialogs are not destroyed immediately when this function is called -- they are added to a list of windows to be deleted on idle time, when all the window's events have been processed. This prevents problems with events being sent to non-existent windows. Returns ``True`` if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion. | **Returns:** `bool` -------- .. method:: DestroyChildren() Destroys all children of a window. Called automatically by the destructor. -------- .. method:: Disable() Disables the window, same as `Enable <#Enable>`_ (``False``). | **Returns:** `bool` -------- .. method:: DissociateHandle() Dissociate the current native handle from the window -------- .. method:: DragAcceptFiles(accept) Enables or disables eligibility for drop file events (`OnDropFiles`). **Parameters:** * `accept` (bool): If ``True``, the window is eligible for drop file events. If ``False``, the window will not accept drop file events. .. note:: Windows only. -------- .. method:: Enable(enable=True) Enable or disable the window for user input. **Parameters:** * `enable` (bool): If ``True``, enables the window for input. If ``False``, disables the window. | **Returns:** `bool` .. note:: Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is. .. seealso:: `IsEnabled <#IsEnabled>`_, `Disable <#Disable>`_, `wx.RadioBox.Enable `_ -------- .. method:: FindFocus() Finds the window or control which currently has the keyboard focus. | **Returns:** `wx.Window `_ .. note:: Note that this is a function, so it can be called without needing a `wx.Window` pointer. .. seealso:: `SetFocus <#SetFocus>`_ -------- .. method:: FindWindowById(id) Find the first window with the given `id`. **Parameters:** * `id` (long) | **Returns:** `wx.Window `_ .. seealso:: `FindWindow <#FindWindow>`_ -------- .. method:: FindWindowByLabel(label) Find a window by its label. Depending on the type of window, the label may be a window title or panel item label. **Parameters:** * `label` (string) | **Returns:** `wx.Window `_ .. seealso:: `FindWindow <#FindWindow>`_ -------- .. method:: FindWindowByName(name) Find a window by its name (as given in a window constructor or `Create <#Create>`_ function call). If no window with such name is found, `FindWindowByLabel <#FindWindowByLabel>`_ is called. **Parameters:** * `name` (string) | **Returns:** `wx.Window `_ .. seealso:: `FindWindow <#FindWindow>`_ -------- .. method:: Fit() Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows and will only really work correctly if the sizers are used for the subwindows layout. Also, if the window has exactly one subwindow it is better (faster and the result is more precise as `Fit` adds some margin to account for fuzziness of its calculations) to call:: window.SetClientSize(child.GetSize()) instead of calling `Fit`. -------- .. method:: FitInside() Similar to `Fit <#Fit>`_, but sizes the interior (virtual) size of a window. Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won't do anything if there are no subwindows. -------- .. method:: Freeze() Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all. `Thaw <#Thaw>`_ must be called to reenable window redrawing. Calls to these two functions may be nested. This method is useful for visual appearance optimization (for example, it is a good idea to use it before doing many large text insertions in a row into a `wx.TextCtrl` under wxGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWidgets and not a mandatory directive. -------- .. method:: GetAcceleratorTable() Gets the accelerator table for this window. | **Returns:** `wx.AcceleratorTable `_ .. seealso:: `wx.AcceleratorTable `_ -------- .. method:: GetAdjustedBestSize() Use `GetEffectiveMinSize <#GetEffectiveMinSize>`_ instead. | **Returns:** `wx.Size `_ .. warning:: This method is deprecated. -------- .. method:: GetAutoLayout() Returns the current auto layout setting. **Returns:** `bool` -------- .. method:: GetBackgroundColour() Returns the background colour of the window. | **Returns:** `wx.Colour `_ .. seealso:: `SetBackgroundColour <#SetBackgroundColour>`_, `SetForegroundColour <#SetForegroundColour>`_, `GetForegroundColour <#GetForegroundColour>`_ -------- .. method:: GetBackgroundStyle() Returns the background style of the window. The background style indicates whether background colour should be determined by the system (``wx.BG_STYLE_SYSTEM``), be set to a specific colour (``wx.BG_STYLE_COLOUR``), or should be left to the application to implement (``wx.BG_STYLE_CUSTOM``). On GTK+, use of ``wx.BG_STYLE_CUSTOM`` allows the flicker-free drawing of a custom background, such as a tiled bitmap. Currently the style has no effect on other platforms. | **Returns:** `int` .. seealso:: `SetBackgroundColour <#SetBackgroundColour>`_, `GetForegroundColour <#GetForegroundColour>`_, `SetBackgroundStyle <#SetBackgroundStyle>`_ -------- .. method:: GetBestSize() This functions returns the best acceptable minimal size for the window. For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically `wx.Panel `_), the size returned by this function will be the same as the size the window would have had after calling `Fit <#Fit>`_. | **Returns:** `wx.Size `_ -------- .. method:: GetBestSizeTuple() This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically `wx.Panel `_), the size returned by this function will be the same as the size the window would have had after calling `Fit <#Fit>`_. | **Returns:** `(width, height)` -------- .. method:: GetBestVirtualSize() Return the largest of `ClientSize` and `BestSize` (as determined by a sizer, interior children, or other means). | **Returns:** `wx.Size `_ -------- .. method:: GetBorder(flags) Get border for the flags of this window **Parameters:** * `flags` (long) | **Returns:** `int` -------- .. method:: GetCapture() Returns the currently captured window. | **Returns:** `wx.Window `_ .. seealso:: `HasCapture <#HasCapture>`_, `CaptureMouse <#CaptureMouse>`_, `ReleaseMouse <#ReleaseMouse>`_, `wx.MouseCaptureLostEvent <../Events/wx.MouseCaptureLostEvent.html>`_, `wx.MouseCaptureChangedEvent <../Events/wx.MouseCaptureChangedEvent.html>`_ -------- .. method:: GetCaret() Returns the caret associated with the window. | **Returns:** `wx.Caret `_ -------- .. method:: GetCharHeight() Returns the character height for this window. | **Returns:** `int` -------- .. method:: GetCharWidth() Returns the average character width for this window. | **Returns:** `int` -------- .. method:: GetChildren() Returns a reference to the list of the window's children. `wx.WindowList` is a type-safe list-like class whose elements are of type `wx.Window`. | **Returns:** `wx.WindowList` -------- .. method:: GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) Returns the default font and colours which are used by the control. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the users system, especially if it uses themes. The `variant` parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See `SetWindowVariant <#SetWindowVariant>`_ for more about this. This static method is "overridden" in many derived classes and so calling, for example, `wx.Button.GetClassDefaultAttributes()` will typically return the values appropriate for a button which will be normally different from those returned by, say, `wx.ListCtrl.GetClassDefaultAttributes()`. The `wx.VisualAttributes` structure has at least the fields `font`, `colFg` and `colBg`. All of them may be invalid if it was not possible to determine the default control appearance or, especially for the background colour, if the field doesn't make sense as is the case for `colBg` for the controls with themed background. **Parameters:** * `variant` (`wx.WindowVariant`) | **Returns:** `wx.VisualAttributes` .. seealso:: `InheritAttributes <#InheritAttributes>`_ -------- .. method:: GetClientAreaOrigin() Get the origin of the client area of the window relative to the window's top left corner (the client area may be shifted because of the borders, scrollbars, other decorations...) | **Returns:** `wx.Point `_ -------- .. method:: GetClientRect() Get the client area position and size as a `wx.Rect `_ object. | **Returns:** `wx.Rect `_ -------- .. method:: GetClientSize() This gets the size of the window 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc... | **Returns:** `wx.Size `_ .. seealso:: `GetSize <#GetSize>`_, `GetVirtualSize <#GetVirtualSize>`_ -------- .. method:: GetClientSizeTuple() This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc... | **Returns:** `(width, height)` -------- .. method:: GetConstraints() Returns a pointer to the window's layout constraints, or ``None`` if there are none. | **Returns:** `wx.LayoutConstraints `_ -------- .. method:: GetContainingSizer() Return the sizer that this window is a member of, if any, otherwise ``None``. | **Returns:** `wx.Sizer `_ -------- .. method:: GetCursor() Return the cursor associated with this window. | **Returns:** `wx.Cursor `_ .. seealso:: `SetCursor <#SetCursor>`_ -------- .. method:: GetDefaultAttributes() Currently this is the same as calling `GetClassDefaultAttributes <#GetClassDefaultAttributes>`_ (`GetWindowVariant <#GetWindowVariant>`_ ()). One advantage of using this function compared to the static version is that the call is automatically dispatched to the correct class (as usual with virtual functions) and you don't have to specify the class name explicitly. The other one is that in the future this function could return different results, for example it might return a different font for an ``Ok`` button than for a generic button if the users GUI is configured to show such buttons in bold font. Of course, the down side is that it is impossible to call this function without actually having an object to apply it to whereas the static version can be used without having to create an object first. | **Returns:** `wx.VisualAttributes` -------- .. method:: GetDropTarget() Returns the associated drop target, which may be ``None``. | **Returns:** `wx.DropTarget `_ .. seealso:: `SetDropTarget <#SetDropTarget>`_ -------- .. method:: GetEffectiveMinSize() Merges the window's best size into the min size and returns the result. This is the value used by sizers to determine the appropriate ammount of space to allocate for the widget. | **Returns:** `wx.Size `_ .. seealso:: `GetBestSize <#GetBestSize>`_, `SetInitialSize <#SetInitialSize>`_ -------- .. method:: GetEventHandler() Returns the event handler for this window. By default, the window is its own event handler. | **Returns:** `wx.EvtHandler `_ .. seealso:: `SetEventHandler <#SetEventHandler>`_, `PushEventHandler <#PushEventHandler>`_, `PopEventHandler <#PopEventHandler>`_, `wx.EvtHandler.ProcessEvent `_, `wx.EvtHandler `_ -------- .. method:: GetExtraStyle() Returns the extra style bits for the window. | **Returns:** `long` -------- .. method:: GetFont() Returns the font for this window. | **Returns:** `wx.Font `_ .. seealso:: `SetFont <#SetFont>`_ -------- .. method:: GetForegroundColour() Returns the foreground colour of the window. | **Returns:** `wx.Colour `_ .. note:: The interpretation of foreground colour is open to interpretation according to the window class; it may be the text colour or other colour, or it may not be used at all. .. seealso:: `SetForegroundColour <#SetForegroundColour>`_, `SetBackgroundColour <#SetBackgroundColour>`_, `GetBackgroundColour <#GetBackgroundColour>`_ -------- .. method:: GetFullTextExtent(string, font=None) Get the width, height, decent and leading of the text using the current or specified font. **Parameters:** * `string` (string) * `font` (`wx.Font `_) | **Returns:** `(width, height, descent, externalLeading)` -------- .. method:: GetGrandParent() Returns the grandparent of a window, or ``None`` if there isn't one. | **Returns:** `wx.Window `_ -------- .. method:: GetGtkWidget() On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero. | **Returns:** `long` -------- .. method:: GetHandle() Returns the platform-specific handle of the physical window. Cast it to an appropriate handle, such as ``HWND`` for Windows, ``Widget`` for Motif, ``GtkWidget`` for GTK or ``WinHandle`` for PalmOS. | **Returns:** `int` -------- .. method:: GetHelpText() Gets the help text to be used as context-sensitive help for this window. | **Returns:** `string` .. note:: Note that the text is actually stored by the current `wx.HelpProvider `_ implementation, and not in the window object itself. .. seealso:: `SetHelpText <#SetHelpText>`_, `GetHelpTextAtPoint <#GetHelpTextAtPoint>`_, `wx.HelpProvider `_ -------- .. method:: GetHelpTextAtPoint() Gets the help text to be used as context-sensitive help for this window. This method should be overridden if the help message depends on the position inside the window, otherwise `GetHelpText <#GetHelpText>`_ can be used. | **Returns:** `string` -------- .. method:: GetId() Returns the identifier of the window. | **Returns:** `int` .. note:: Each window has an integer identifier. If the application has not provided one (or the default ``wx.ID_ANY``) an unique identifier with a negative value will be generated. .. seealso:: `SetId <#SetId>`_ -------- .. method:: GetLabel() Generic way of getting a label from any window, for identification purposes. | **Returns:** `string` .. note:: The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or text controls, it is the button text. This function can be useful for meta-programs (such as testing tools or special-needs access programs) which need to identify windows by name. -------- .. method:: GetLayoutDirection() Get the layout direction (LTR or RTL) for this window. Returns `wx.Layout_Default` if layout direction is not supported. | **Returns:** `int` -------- .. method:: GetMaxHeight() `No docstrings available for this method.` -------- .. method:: GetMaxSize() Returns the maximum size of the window, an indication to the sizer layout mechanism that this is the maximum possible size. | **Returns:** `wx.Size `_ -------- .. method:: GetMaxWidth() `No docstrings available for this method.` -------- .. method:: GetMinHeight() `No docstrings available for this method.` -------- .. method:: GetMinSize() Returns the minimum size of the window, an indication to the sizer layout mechanism that this is the minimum required size. It normally just returns the value set by `SetMinSize <#SetMinSize>`_, but it can be overridden to do the calculation on demand. | **Returns:** `wx.Size `_ -------- .. method:: GetMinWidth() `No docstrings available for this method.` -------- .. method:: GetName() Returns the window's name. | **Returns:** `string` .. note:: This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via `SetName <#SetName>`_. .. seealso:: `SetName <#SetName>`_ -------- .. method:: GetParent() Returns the parent of the window, or ``None`` if there is no parent. | **Returns:** `wx.Window `_ -------- .. method:: GetPosition() This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows. | **Returns:** `wx.Point `_ .. seealso:: `GetScreenPosition <#GetScreenPosition>`_ -------- .. method:: GetPositionTuple() Get the window's position. Notice that the position is in client coordinates for child windows and screen coordinates for the top level ones, use `GetScreenPosition <#GetScreenPosition>`_ if you need screen coordinates for all kinds of windows. | **Returns:** `(x, y)` -------- .. method:: GetRect() Returns the size and position of the window as a `wx.Rect `_ object. | **Returns:** `wx.Rect `_ .. seealso:: `GetScreenRect <#GetScreenRect>`_ -------- .. method:: GetScreenPosition() Returns the window position in screen coordinates, whether the window is a child window or a top level one. | **Returns:** `wx.Point `_ .. seealso:: `GetPosition <#GetPosition>`_ -------- .. method:: GetScreenPositionTuple() Get the position of the window in screen coordinantes. | **Returns:** `(x,y)` -------- .. method:: GetScreenRect() Returns the size and position of the window on the screen as a `wx.Rect `_ object. | **Returns:** `wx.Rect `_ .. seealso:: `GetRect <#GetRect>`_ -------- .. method:: GetScrollPos(orientation) Returns the built-in scrollbar position. **Parameters:** * `orientation` (int) | **Returns:** `int` .. seealso:: See `SetScrollbar <#SetScrollbar>`_ -------- .. method:: GetScrollRange(orientation) Returns the built-in scrollbar range. **Parameters:** * `orientation` (int) | **Returns:** `int` .. seealso:: `SetScrollbar <#SetScrollbar>`_ -------- .. method:: GetScrollThumb(orientation) Returns the built-in scrollbar thumb size. **Parameters:** * `orientation` (int) | **Returns:** `int` .. seealso:: `SetScrollbar <#SetScrollbar>`_ -------- .. method:: GetSize() This gets the size of the entire window in pixels, including title bar, border, scrollbars, etc... | **Returns:** `wx.Size `_ .. seealso:: `GetClientSize <#GetClientSize>`_, `GetVirtualSize <#GetVirtualSize>`_ -------- .. method:: GetSizeTuple() Get the window size. | **Returns:** `(width, height)` -------- .. method:: GetSizer() Return the sizer associated with the window by a previous call to `SetSizer <#SetSizer>`_ or ``None``. | **Returns:** `wx.Sizer `_ -------- .. method:: GetTextExtent(string) Gets the dimensions of the string as it would be drawn on the window with the currently selected font. **Parameters:** * `string` (string): String whose extent is to be measured. | **Returns:** `(width, height)` -------- .. method:: GetThemeEnabled() Return the `themeEnabled` flag. | **Returns:** `bool` -------- .. method:: GetToolTip() Get the associated tooltip or ``None`` if none. | **Returns:** `wx.ToolTip `_ -------- .. method:: GetTopLevelParent() Returns the first frame or dialog in this window's parental hierarchy. | **Returns:** `wx.Window `_ -------- .. method:: GetUpdateClientRect() Get the update rectangle region bounding box in client coords. | **Returns:** `wx.Rect `_ -------- .. method:: GetUpdateRegion() Returns the region specifying which parts of the window have been damaged. Should only be called within an `wx.PaintEvent <../Events/wx.PaintEvent.html>`_ handler. | **Returns:** `wx.Region `_ .. seealso:: `wx.Region `_, `wx.RegionIterator `_ -------- .. method:: GetValidator() Returns a pointer to the current validator for the window, or ``None`` if there is none. | **Returns:** `wx.Validator `_ -------- .. method:: GetVirtualSize() This gets the virtual size of the window in pixels. By default it returns the client size of the window, but after a call to `SetVirtualSize <#SetVirtualSize>`_ it will return that size. | **Returns:** `wx.Size `_ -------- .. method:: GetVirtualSizeTuple() Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size. | **Returns:** `(width, height)` -------- .. method:: GetWindowBorderSize() Returns the size of the left/right and top/bottom borders of this window in `x` and `y` components of the result respectively. | **Returns:** `wx.Size `_ -------- .. method:: GetWindowStyleFlag() Gets the window style that was passed to the constructor or `Create <#Create>`_ method. `GetWindowStyle()` is another name for the same function. | **Returns:** `long` -------- .. method:: GetWindowVariant() Returns the value previously passed to `SetWindowVariant <#SetWindowVariant>`_. | **Returns:** `wx.WindowVariant` -------- .. method:: HasCapture() Returns ``True`` if this window has the current mouse capture. | **Returns:** `bool` .. seealso:: `CaptureMouse <#CaptureMouse>`_, `ReleaseMouse <#ReleaseMouse>`_, `wx.MouseCaptureLostEvent <../Events/wx.MouseCaptureLostEvent.html>`_, `wx.MouseCaptureChangedEvent <../Events/wx.MouseCaptureChangedEvent.html>`_ -------- .. method:: HasFlag(flag) Returns ``True`` if the window has the given `flag` bit set. **Parameters:** * `flag` (int) | **Returns:** `bool` -------- .. method:: HasMultiplePages() This method should be overridden to return ``True`` if this window has multiple pages. All standard class with multiple pages such as `wx.Notebook `_, `wx.Listbook `_ and `wx.Treebook `_ already override it to return ``True`` and user-defined classes with similar behaviour should do it as well to allow the library to handle such windows appropriately. | **Returns:** `bool` -------- .. method:: HasScrollbar(orient) Returns ``True`` if this window has a scroll bar for this orientation. **Parameters:** * `orient` (int): Orientation to check, either ``wx.HORIZONTAL`` or ``wx.VERTICAL``. | **Returns:** `bool` -------- .. method:: HasTransparentBackground() Returns ``True`` if this window background is transparent (as, for example, for `wx.StaticText `_) and should show the parent window background. This method is mostly used internally by the library itself and you normally shouldn't have to call it. You may, however, have to override it in your `wx.Window` -derived class to ensure that background is painted correctly. | **Returns:** `bool` -------- .. method:: Hide() Equivalent to calling `Show <#Show>`_ (``False``). | **Returns:** `bool` -------- .. method:: HitTest(pt) Test where the given (in client coords) point lies **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `int` -------- .. method:: HitTestXY(x, y) Test where the given (in client coords) point lies **Parameters:** * `x` (int) * `y` (int) | **Returns:** `int` -------- .. method:: InheritAttributes() This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours. By "intelligently" the following is meant: by default, all windows use their own default attributes. However if some of the parents attributes are explicitly (that is, using `SetFont <#SetFont>`_ and not `SetOwnFont <#SetOwnFont>`_) changed **and** if the corresponding attribute hadn't been explicitly set for this window itself, then this window takes the same value as used by the parent. In addition, if the window overrides `ShouldInheritColours <#ShouldInheritColours>`_ to return ``False``, the colours will not be changed no matter what and only the font might. This rather complicated logic is necessary in order to accommodate the different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can't inherit the same value from the parent. However it was also deemed desirable to allow to simply change the attributes of all children at once by just changing the font or colour of their common parent, hence in this case we do inherit the parents attributes. -------- .. method:: InheritsBackgroundColour() `No docstrings available for this method.` -------- .. method:: InitDialog() Sends an ``wx.EVT_INIT_DIALOG`` event, whose handler usually transfers data to the dialog via validators. -------- .. method:: InvalidateBestSize() Resets the cached best size value so it will be recalculated the next time it is needed. -------- .. method:: IsBeingDeleted() Is the window in the process of being deleted? | **Returns:** `bool` -------- .. method:: IsDoubleBuffered() Returns ``True`` if the window contents is double-buffered by the system, i.e. if any drawing done on the window is really done on a temporary backing surface and transferred to the screen all at once later. | **Returns:** `bool` .. seealso:: `wx.BufferedDC `_ -------- .. method:: IsEnabled() Returns ``True`` if the window is enabled for input, ``False`` otherwise. | **Returns:** `bool` .. seealso:: `Enable <#Enable>`_ -------- .. method:: IsExposed(x, y, w=1, h=1) Returns ``True`` if the given rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed. **Parameters:** * `x` (int) * `y` (int) * `w` (int) * `h` (int) | **Returns:** `bool` -------- .. method:: IsExposedPoint(pt) Returns ``True`` if the given point area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed. **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `bool` -------- .. method:: IsExposedRect(rect) Returns ``True`` if the given rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed. **Parameters:** * `rect` (`wx.Rect `_) | **Returns:** `bool` -------- .. method:: IsFrozen() Returns ``True`` if the window is currently frozen by a call to `Freeze <#Freeze>`_. | **Returns:** `bool` .. seealso:: `Thaw <#Thaw>`_ -------- .. method:: IsRetained() Returns ``True`` if the window is retained, ``False`` otherwise. | **Returns:** `bool` .. note:: Retained windows are only available on X platforms. -------- .. method:: IsShown() Returns ``True`` if the window is shown, ``False`` if it has been hidden. | **Returns:** `bool` .. seealso:: `IsShownOnScreen <#IsShownOnScreen>`_ -------- .. method:: IsShownOnScreen() Returns ``True`` if the window is physically visible on the screen, i.e. it is shown and all its parents up to the toplevel window are shown as well. | **Returns:** `bool` .. seealso:: `IsShown <#IsShown>`_ -------- .. method:: IsTopLevel() Returns ``True`` if the given window is a top-level one. Currently all frames and dialogs are considered to be top-level windows (even if they have a parent window). | **Returns:** `bool` -------- .. method:: Layout() Invokes the constraint-based layout algorithm or the sizer-based algorithm for this window. See `SetAutoLayout <#SetAutoLayout>`_: when auto layout is on, this function gets called automatically when the window is resized. -------- .. method:: Lower() Lowers the window to the bottom of the window hierarchy (z-order). .. seealso:: `Raise <#Raise>`_ -------- .. method:: MakeModal(modal) Disables all other windows in the application so that the user can only interact with this window. **Parameters:** * `modal` (bool): If ``True``, this call disables all other windows in the application so that the user can only interact with this window. If ``False``, the effect is reversed -------- .. method:: Move(pt, flags=wx.SIZE_USE_EXISTING) Moves the window to the given position. **Parameters:** * `pt` (`wx.Point `_) * `flags` (int) .. note:: Implementations of `SetDimensions <#SetDimensions>`_ can also implicitly implement the `Move` function, which is defined in the base `wx.Window` class as the call:: self.SetDimensions(x, y, wx.DefaultCoord, wx.DefaultCoord, wx.SIZE_USE_EXISTING) .. seealso:: `SetDimensions <#SetDimensions>`_ -------- .. method:: MoveAfterInTabOrder(win) Moves this window in the tab navigation order after the specified `win`. This means that when the user presses ``TAB`` key on that other window, the focus switches to this window. Default tab order is the same as creation order, this function and `MoveBeforeInTabOrder <#MoveBeforeInTabOrder>`_ allow to change it after creating all the windows. **Parameters:** * `win` (`wx.Window `_): A sibling of this window which should precede it in tab order, must not be ``None`` -------- .. method:: MoveBeforeInTabOrder(win) Same as `MoveAfterInTabOrder <#MoveAfterInTabOrder>`_ except that it inserts this window just before `win` instead of putting it right after it. **Parameters:** * `win` (`wx.Window `_) -------- .. method:: MoveXY(x, y, flags=wx.SIZE_USE_EXISTING) Moves the window to the given position. **Parameters:** * `x` (int) * `y` (int) * `flags` (int) -------- .. method:: Navigate(flags=wx.NavigationKeyEvent.IsForward) Does keyboard navigation from this window to another, by sending a `wx.NavigationKeyEvent`. **Parameters:** * `flags` (int): A combination of `wx.NavigationKeyEvent.IsForward` and `wx.NavigationKeyEvent.WinChange`. | **Returns:** `bool` .. note:: You may wish to call this from a text control custom keypress handler to do the default navigation behaviour for the tab key, since the standard default behaviour for a multiline text control with the ``wx.TE_PROCESS_TAB`` style is to insert a tab and not navigate to the next control. -------- .. method:: NewControlId() Generate a control id for the controls which were not given one. | **Returns:** `int` -------- .. method:: NextControlId(winid) Get the id of the control following the one with the given (autogenerated) id. **Parameters:** * `winid` (int) | **Returns:** `int` -------- .. method:: OnPaint(event) | **Parameters:** * `event` (`wx.PaintEvent <../Events/wx.PaintEvent.html>`_) -------- .. method:: PopEventHandler(deleteHandler=False) Removes and returns the top-most event handler on the event handler stack. **Parameters:** * `deleteHandler` (bool): If this is ``True``, the handler will be deleted after it is removed. The default value is ``False``. | **Returns:** `wx.EvtHandler `_ .. seealso:: `SetEventHandler <#SetEventHandler>`_, `GetEventHandler <#GetEventHandler>`_, `PushEventHandler <#PushEventHandler>`_, `wx.EvtHandler.ProcessEvent `_, `wx.EvtHandler `_ -------- .. method:: PopupMenu(menu, pos=wx.DefaultPosition) Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usually. If the coordinates are not specified, the current mouse cursor position is used. **Parameters:** * `menu` (`wx.Menu `_): Menu to pop up. * `pos` (`wx.Point `_): The position where the menu will appear. | **Returns:** `bool` .. note:: Just before the menu is popped up, `wx.Menu.UpdateUI `_ is called to ensure that the menu items are in the correct state. The menu does not get deleted by the window. It is recommended to not explicitly specify coordinates when calling PopupMenu in response to mouse click, because some of the ports (namely, wxGTK) can do a better job of positioning the menu in that case. .. seealso:: `wx.Menu `_ -------- .. method:: PopupMenuXY(menu, x=-1, y=-1) Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used. **Parameters:** * `menu` (`wx.Menu `_) * `x` (int) * `y` (int) | **Returns:** `bool` -------- .. method:: PostCreate(pre) Phase 3 of the 2-phase create . Call this method after precreating the window with the 2-phase create method. **Parameters:** * `pre` -------- .. method:: PrepareDC(dc) Call this function to prepare the device context for drawing a scrolled image. It sets the device origin according to the current scroll position. **Parameters:** * `dc` (`wx.DC `_) -------- .. method:: PrevControlId(winid) Get the id of the control preceding the one with the given (autogenerated) id. **Parameters:** * `winid` (int) | **Returns:** `int` -------- .. method:: PushEventHandler(handler) Pushes this event handler onto the event stack for the window. **Parameters:** * `handler` (`wx.EvtHandler `_): Specifies the handler to be pushed. .. note:: An event handler is an object that is capable of processing the events sent to a window. By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. `PushEventHandler` allows an application to set up a chain of event handlers, where an event not handled by one event handler is handed to the next one in the chain. Use `PopEventHandler <#PopEventHandler>`_ to remove the event handler. .. seealso:: `SetEventHandler <#SetEventHandler>`_, `GetEventHandler <#GetEventHandler>`_, `PopEventHandler <#PopEventHandler>`_, `wx.EvtHandler.ProcessEvent `_, `wx.EvtHandler `_ -------- .. method:: Raise() Raises the window to the top of the window hierarchy (z-order). In current version of wxWidgets this works both for managed and child windows. .. seealso:: `Lower <#Lower>`_ -------- .. method:: Refresh(eraseBackground=True, rect=None) Causes this window, and all of its children recursively (except under wxGTK1 where this is not implemented), to be repainted. **Parameters:** * `eraseBackground` (bool): If ``True``, the background will be erased. * `rect` (`wx.Rect `_): If not ``None``, only the given rectangle will be treated as damaged. .. note:: Note that repainting doesn't happen immediately but only during the next event loop iteration, if you need to update the window immediately you should use `Update <#Update>`_ instead. .. seealso:: `RefreshRect <#RefreshRect>`_ -------- .. method:: RefreshRect(rect, eraseBackground=True) Redraws the contents of the given rectangle: only the area inside it will be repainted. This is the same as `Refresh <#Refresh>`_ but has a nicer syntax as it can be called with a temporary `wx.Rect `_ object as argument like this:: self.RefreshRect(wx.Rect(x, y, width, height)) **Parameters:** * `rect` (`wx.Rect `_) * `eraseBackground` (bool) -------- .. method:: RegisterHotKey(hotkeyId, modifiers) Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window will receive a hotkey event. It will receive the event even if the application is in the background and does not have the input focus because the user is working with some other application. **Parameters:** * `hotkeyId` (int): Numeric identifier of the hotkey. For applications this must be between 0 and 0xBFFF. If this function is called from a shared DLL, it must be a system wide unique identifier between 0xC000 and 0xFFFF. This is a MSW specific detail. * `modifiers` (int): A bitwise combination of ``wx.MOD_SHIFT``, ``wx.MOD_CONTROL``, ``wx.MOD_ALT`` or ``wx.MOD_WIN`` specifying the modifier keys that have to be pressed along with the key. | **Returns:** `bool` .. note:: You can use:: self.Bind(wx.EVT_HOTKEY, fnc, id=hotkeyId) in the event table to capture the event. .. note:: This function is currently only implemented under Windows. It is used in the Windows CE port for detecting hardware button presses. .. seealso:: `UnregisterHotKey <#UnregisterHotKey>`_ -------- .. method:: ReleaseMouse() Releases mouse input captured with `CaptureMouse <#CaptureMouse>`_. .. seealso:: `CaptureMouse <#CaptureMouse>`_, `HasCapture <#HasCapture>`_, `ReleaseMouse <#ReleaseMouse>`_, `wx.MouseCaptureLostEvent <../Events/wx.MouseCaptureLostEvent.html>`_, `wx.MouseCaptureChangedEvent <../Events/wx.MouseCaptureChangedEvent.html>`_ -------- .. method:: RemoveChild(child) Removes a child window. This is called automatically by window deletion functions so should not be required by the application programmer. **Parameters:** * `child` (`wx.Window `_): Child window to remove. .. note:: Notice that this function is mostly internal to wxWidgets and shouldn't be called by the user code. -------- .. method:: RemoveEventHandler(handler) Find the given `handler` in the windows event handler chain and remove (but not delete) it from it. **Parameters:** * `handler` (`wx.EvtHandler `_): The event handler to remove, must be non- ``None`` and must be present in this windows event handlers chain | **Returns:** `bool` .. seealso:: `PushEventHandler <#PushEventHandler>`_, `PopEventHandler <#PopEventHandler>`_ -------- .. method:: Reparent(newParent) Reparents the window, i.e the window will be removed from its current parent window (e.g. a non-standard toolbar in a `wx.Frame `_) and then re-inserted into another. **Parameters:** * `newParent` (`wx.Window `_): New parent. | **Returns:** `bool` -------- .. method:: ScreenToClient(pt) Converts from screen to client window coordinates. **Parameters:** * `pt` (`wx.Point `_) | **Returns:** `wx.Point `_ -------- .. method:: ScreenToClientXY(x, y) Converts from screen to client window coordinates. **Parameters:** * `x` (int) * `y` (int) | **Returns:** `(x, y)` -------- .. method:: ScrollLines(lines) Scrolls the window by the given number of lines down (if `lines` is positive) or up. **Parameters:** * `lines` (int) | **Returns:** `bool` .. note:: This function is currently only implemented under MSW and `wx.TextCtrl `_ under wxGTK (it also works for `wx.ScrolledWindow `_ derived classes under all platforms). .. seealso:: `ScrollPages <#ScrollPages>`_ -------- .. method:: ScrollPages(pages) Scrolls the window by the given number of pages down (if `pages` is positive) or up. **Parameters:** * `pages` (int) | **Returns:** `bool` .. note:: This function is currently only implemented under MSW and wxGTK. .. seealso:: `ScrollLines <#ScrollLines>`_ -------- .. method:: ScrollWindow(dx, dy, rect=None) Physically scrolls the pixels in the window and move child windows accordingly. **Parameters:** * `dx` (int): Amount to scroll horizontally. * `dy` (int): Amount to scroll vertically. * `rect` (`wx.Rect `_): Rectangle to scroll, if it is ``None``, the whole window is scrolled (this is always the case under wxGTK which doesn't support this parameter) .. note:: Note that you can often use `wx.ScrolledWindow `_ instead of using this function directly. -------- .. method:: SendSizeEvent() `No docstrings available for this method.` -------- .. method:: SetAcceleratorTable(accel) Sets the accelerator table for this window. **Parameters:** * `accel` (`wx.AcceleratorTable `_) .. seealso:: `wx.AcceleratorTable `_ -------- .. method:: SetAutoLayout(autoLayout) Determines whether the `Layout <#Layout>`_ function will be called automatically when the window is resized. This method is called implicitly by `SetSizer <#SetSizer>`_ but if you use `SetConstraints <#SetConstraints>`_ you should call it manually or otherwise the window layout won't be correctly updated when its size changes. **Parameters:** * `autoLayout` (bool): Set this to ``True`` if you wish the Layout function to be called automatically when the window is resized. .. note:: Please note that this only happens for the windows usually used to contain children, namely `wx.Panel `_ and `wx.TopLevelWindow `_ (and the classes deriving from them). .. seealso:: `SetConstraints <#SetConstraints>`_ -------- .. method:: SetBackgroundColour(colour) Sets the background colour of the window. Please see `InheritAttributes <#InheritAttributes>`_ for explanation of the difference between this method and `SetOwnBackgroundColour <#SetOwnBackgroundColour>`_. **Parameters:** * `colour` (`wx.Colour `_): The colour to be used as the background colour, pass `wx.NullColour` to reset to the default colour. | **Returns:** `bool` .. note:: The background colour is usually painted by the default `wx.EraseEvent <../Events/wx.EraseEvent.html>`_ event handler function under Windows and automatically under GTK. .. note:: Note that setting the background colour does not cause an immediate refresh, so you may wish to call `ClearBackground <#ClearBackground>`_ or `Refresh <#Refresh>`_ after calling this function. Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system. .. seealso:: `GetBackgroundColour <#GetBackgroundColour>`_, `SetForegroundColour <#SetForegroundColour>`_, `GetForegroundColour <#GetForegroundColour>`_, `ClearBackground <#ClearBackground>`_, `Refresh <#Refresh>`_, `wx.EraseEvent <../Events/wx.EraseEvent.html>`_ -------- .. method:: SetBackgroundStyle(style) Sets the background style of the window. The background style indicates whether background colour should be determined by the system (``wx.BG_STYLE_SYSTEM``), be set to a specific colour (``wx.BG_STYLE_COLOUR``), or should be left to the application to implement (``wx.BG_STYLE_CUSTOM``). On GTK+, use of ``wx.BG_STYLE_CUSTOM`` allows the flicker-free drawing of a custom background, such as a tiled bitmap. Currently the style has no effect on other platforms. **Parameters:** * `style` (int) .. seealso:: `SetBackgroundColour <#SetBackgroundColour>`_, `GetForegroundColour <#GetForegroundColour>`_, `GetBackgroundStyle <#GetBackgroundStyle>`_ -------- .. method:: SetCaret(caret) Sets the caret associated with the window. **Parameters:** * `caret` (`wx.Caret `_) -------- .. method:: SetClientRect(rect) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than `SetSize <#SetSize>`_, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. **Parameters:** * `rect` (`wx.Rect `_) -------- .. method:: SetClientSize(size) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than `SetSize <#SetSize>`_, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: SetClientSizeWH(width, height) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than `SetSize <#SetSize>`_, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. **Parameters:** * `width` (int) * `height` (int) -------- .. method:: SetConstraints(constraints) Sets the window to have the given layout constraints. The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted. **Parameters:** * `constraints` (`wx.LayoutConstraints `_): The constraints to set. Pass ``None`` to disassociate and delete the window's constraints. .. note:: You must call `SetAutoLayout <#SetAutoLayout>`_ to tell a window to use the constraints automatically in `OnSize`; otherwise, you must override `OnSize` and call `Layout()` explicitly. When setting both a `wx.LayoutConstraints` and a `wx.Sizer `_, only the sizer will have effect. -------- .. method:: SetContainingSizer(sizer) This normally does not need to be called by user code. It is called when a window is added to a sizer, and is used so the window can remove itself from the sizer when it is destroyed. **Parameters:** * `sizer` (`wx.Sizer `_) -------- .. method:: SetCursor(cursor) Sets the window's cursor. Notice that the window cursor also sets it for the children of the window implicitly. The `cursor` may be `wx.NullCursor` in which case the window cursor will be reset back to default. **Parameters:** * `cursor` (`wx.Cursor `_): Specifies the cursor that the window should normally display. .. seealso:: `wx.SetCursor <../wxFunctions.html#SetCursor>`_, `wx.Cursor `_ -------- .. method:: SetDimensions(x, y, width, height, sizeFlags=wx.SIZE_AUTO) Sets the position and size of the window in pixels. The `sizeFlags` parameter indicates the interpretation of the other params if they are equal to -1. `sizeFlags` may have one of this bit set: =================================== ====================================== Size Flags Description =================================== ====================================== ``wx.SIZE_AUTO`` A -1 indicates that a class-specific default should be used. ``wx.SIZE_AUTO_WIDTH`` A -1 indicates that a class-specific default should be used for the width. ``wx.SIZE_AUTO_HEIGHT`` A -1 indicates that a class-specific default should be used for the height. ``wx.SIZE_USE_EXISTING`` Existing dimensions should be used if -1 values are supplied. ``wx.SIZE_ALLOW_MINUS_ONE`` Allow dimensions of -1 and less to be interpreted as real dimensions, not default values. ``wx.SIZE_FORCE`` Normally, if the position and the size of the window are already the same as the parameters of this function, nothing is done. but with this flag a window resize may be forced even in this case (supported in wx 2.6.2 and later and only implemented for MSW and ignored elsewhere currently) =================================== ====================================== | **Parameters:** * `x` (int) * `y` (int) * `width` (int) * `height` (int) * `sizeFlags` (int) -------- .. method:: SetDoubleBuffered(on) Put the native window into double buffered or composited mode. **Parameters:** * `on` (bool) -------- .. method:: SetDropTarget(target) Associates a drop target with this window. If the window already has a drop target, it is deleted. **Parameters:** * `target` (`wx.DropTarget `_) .. seealso:: `GetDropTarget <#GetDropTarget>`_ -------- .. method:: SetEventHandler(handler) Sets the event handler for this window. **Parameters:** * `handler` (`wx.EvtHandler `_): Specifies the handler to be set. .. note:: An event handler is an object that is capable of processing the events sent to a window. By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. It is usually better to use `PushEventHandler <#PushEventHandler>`_ since this sets up a chain of event handlers, where an event not handled by one event handler is handed to the next one in the chain. .. seealso:: `GetEventHandler <#GetEventHandler>`_, `PushEventHandler <#PushEventHandler>`_, `PopEventHandler <#PopEventHandler>`_, `wx.EvtHandler.ProcessEvent `_, `wx.EvtHandler `_ -------- .. method:: SetExtraStyle(exStyle) Sets the extra style bits for the window. The currently defined extra style bits are: ================================================== ================================================== Window Extra Style Description ================================================== ================================================== ``wx.WS_EX_VALIDATE_RECURSIVELY`` By default, `Validate <#Validate>`_ / `TransferDataToWindow <#TransferDataToWindow>`_ / `TransferDataFromWindow <#TransferDataFromWindow>`_ only work on direct children of the window (compatible behaviour). Set this flag to make them recursively descend into all subwindows. ``wx.WS_EX_BLOCK_EVENTS`` `wx.CommandEvents <../Events/wx.CommandEvent.html>`_ and the objects of the derived classes are forwarded to the parent window and so on recursively by default. Using this flag for the given window allows to block this propagation at this window, i.e. prevent the events from being propagated further upwards. Dialogs have this flag on by default. ``wx.WS_EX_TRANSIENT`` Don't use this window as an implicit parent for the other windows: this must be used with transient windows as otherwise there is the risk of creating a dialog/frame with this window as a parent which would lead to a crash if the parent is destroyed before the child. ``wx.WS_EX_PROCESS_IDLE`` This window should always process idle events, even if the mode set by `wx.IdleEvent.SetMode <../Events/wx.IdleEvent.html#SetMode>`_ is ``wx.IDLE_PROCESS_SPECIFIED``. ``wx.WS_EX_PROCESS_UI_UPDATES`` This window should always process UI update events, even if the mode set by `wx.UpdateUIEvent.SetMode <../Events/wx.UpdateUIEvent.html#SetMode>`_ is ``wx.UPDATE_UI_PROCESS_SPECIFIED``. ================================================== ================================================== | **Parameters:** * `exStyle` (long) -------- .. method:: SetFocus() This sets the window to receive keyboard input. .. seealso:: `wx.FocusEvent <../Events/wx.FocusEvent.html>`_, `wx.Panel.SetFocus `_, `wx.Panel.SetFocusIgnoringChildren `_ -------- .. method:: SetFocusFromKbd() This function is called by wxWidgets keyboard navigation code when the user gives the focus to this window from keyboard (e.g. using ``TAB`` key). By default this method simply calls `SetFocus <#SetFocus>`_ but can be overridden to do something in addition to this in the derived classes. -------- .. method:: SetFont(font) Sets the font for this window. This function should not be called for the parent window if you don't want its font to be inherited by its children, use `SetOwnFont <#SetOwnFont>`_ instead in this case and see `InheritAttributes <#InheritAttributes>`_ for more explanations. **Parameters:** * `font` (`wx.Font `_): Font to associate with this window, pass `wx.NullFont` to reset to the default font. .. note:: Please notice that the given font is **not** automatically used for `wx.PaintDC `_ objects associated with this window, you need to call `wx.DC.SetFont `_ too. However this font is used by any standard controls for drawing their text as well as by `GetTextExtent <#GetTextExtent>`_. .. seealso:: `GetFont <#GetFont>`_, `InheritAttributes <#InheritAttributes>`_ -------- .. method:: SetForegroundColour(colour) Sets the foreground colour of the window. Please see `InheritAttributes <#InheritAttributes>`_ for explanation of the difference between this method and `SetOwnForegroundColour <#SetOwnForegroundColour>`_. **Parameters:** * `colour` (`wx.Colour `_): The colour to be used as the foreground colour, pass `wx.NullColour` to reset to the default colour. .. note:: The interpretation of foreground colour is open to interpretation according to the window class; it may be the text colour or other colour, or it may not be used at all. .. seealso:: `GetForegroundColour <#GetForegroundColour>`_, `SetBackgroundColour <#SetBackgroundColour>`_, `GetBackgroundColour <#GetBackgroundColour>`_ -------- .. method:: SetHelpText(helpText) Sets the help text to be used as context-sensitive help for this window. **Parameters:** * `helpText` (string) .. note:: Note that the text is actually stored by the current `wx.HelpProvider `_ implementation, and not in the window object itself. .. seealso:: `GetHelpText <#GetHelpText>`_, `wx.HelpProvider `_ -------- .. method:: SetHelpTextForId(text) Associate this help text with all windows with the same id as this one. **Parameters:** * `text` (string) -------- .. method:: SetId(id) Sets the identifier of the window. **Parameters:** * `id` (int) .. note:: Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently. .. seealso:: `GetId <#GetId>`_ -------- .. method:: SetInitialSize(size=wx.DefaultSize) A *smart* `SetSize <#SetSize>`_ that will fill in default size components with the window's *best* size values. Also sets the window's minsize to the value passed in for use with sizers. This means that if a full or partial size is passed to this function then the sizers will use that size instead of the results of `GetBestSize <#GetBestSize>`_ to determine the minimum needs of the window for layout. Most controls will use this to set their initial size, and their min size to the passed in value (if any.) **Parameters:** * `size` (`wx.Size `_) .. seealso:: `SetSize <#SetSize>`_, `GetBestSize <#GetBestSize>`_, `GetEffectiveMinSize <#GetEffectiveMinSize>`_ -------- .. method:: SetLabel(label) Sets the window's label. **Parameters:** * `label` (string): The window label. .. seealso:: `GetLabel <#GetLabel>`_ -------- .. method:: SetLayoutDirection(dir) Set the layout direction (LTR or RTL) for this window. **Parameters:** * `dir` (int) -------- .. method:: SetMaxSize(size) Sets the maximum size of the window, to indicate to the sizer layout mechanism that this is the maximum possible size. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: SetMinSize(size) Sets the minimum size of the window, to indicate to the sizer layout mechanism that this is the minimum required size. You may need to call this if you change the window size after construction and before adding to its parent sizer. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: SetName(name) Sets the window's name. **Parameters:** * `name` (string): A name to set for the window. .. seealso:: `GetName <#GetName>`_ -------- .. method:: SetOwnBackgroundColour(colour) Sets the background colour of the window but prevents it from being inherited by the children of this window. **Parameters:** * `colour` (`wx.Colour `_) .. seealso:: `SetBackgroundColour <#SetBackgroundColour>`_, `InheritAttributes <#InheritAttributes>`_ -------- .. method:: SetOwnFont(font) Sets the font of the window but prevents it from being inherited by the children of this window. **Parameters:** * `font` (`wx.Font `_) .. seealso:: `SetFont <#SetFont>`_, `InheritAttributes <#InheritAttributes>`_ -------- .. method:: SetOwnForegroundColour(colour) Sets the foreground colour of the window but prevents it from being inherited by the children of this window. **Parameters:** * `colour` (`wx.Colour `_) .. seealso:: `SetForegroundColour <#SetForegroundColour>`_, `InheritAttributes <#InheritAttributes>`_ -------- .. method:: SetRect(rect, sizeFlags=wx.SIZE_AUTO) Sets the position and size of the window in pixels using a `wx.Rect `_ object. **Parameters:** * `rect` (`wx.Rect `_) * `sizeFlags` (int) -------- .. method:: SetScrollPos(orientation, pos, refresh=True) Sets the position of one of the built-in scrollbars. **Parameters:** * `orientation` (int): Determines the scrollbar whose position is to be set. May be ``wx.HORIZONTAL`` or ``wx.VERTICAL``. * `pos` (int): Position in scroll units. * `refresh` (bool): ``True`` to redraw the scrollbar, ``False`` otherwise. .. note:: This function does not directly affect the contents of the window: it is up to the application to take note of scrollbar attributes and redraw contents accordingly. .. seealso:: `SetScrollbar <#SetScrollbar>`_, `GetScrollPos <#GetScrollPos>`_, `GetScrollThumb <#GetScrollThumb>`_, `wx.ScrollBar `_, `wx.ScrolledWindow `_ -------- .. method:: SetScrollbar(orientation, position, thumbSize, range, refresh=True) Sets the scrollbar properties of a built-in scrollbar. **Parameters:** * `orientation` (int): Determines the scrollbar whose page size is to be set. May be ``wx.HORIZONTAL`` or ``wx.VERTICAL``. * `position` (int): The position of the scrollbar in scroll units. * `thumbSize` (int): The size of the thumb, or visible portion of the scrollbar, in scroll units. * `range` (int): The maximum position of the scrollbar. * `refresh` (bool): ``True`` to redraw the scrollbar, ``False`` otherwise. .. note:: Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use:: self.SetScrollbar(wx.VERTICAL, 0, 16, 50) Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. .. note:: You can determine how many lines are currently visible by dividing the current view size by the string character height in pixels. When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and `SetScrollbar` call into a function named `AdjustScrollbars`, which can be called initially and also from your `wx.SizeEvent <../Events/wx.SizeEvent.html>`_ handler function. .. seealso:: `wx.ScrollBar `_, `wx.ScrolledWindow `_, `wx.ScrollWinEvent <../Events/wx.ScrollWinEvent.html>`_ -------- .. method:: SetSize(size) Sets the size of the window in pixels. **Parameters:** * `size` (`wx.Size `_): `wx.Size` object for setting the size. .. seealso:: `Move <#Move>`_ -------- .. 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:: Use of this function for windows which are not toplevel windows (such as `wx.Dialog `_ or `wx.Frame `_) is discouraged. Please use `SetMinSize <#SetMinSize>`_ and `SetMaxSize <#SetMaxSize>`_ instead. .. seealso:: `wx.TopLevelWindow.SetSizeHints `_. -------- .. method:: SetSizeHintsSz(minSize, maxSize=wx.DefaultSize, incSize=wx.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), 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:** * `minSize` (`wx.Size `_) * `maxSize` (`wx.Size `_) * `incSize` (`wx.Size `_) -------- .. method:: SetSizeWH(width, height) Sets the size of the window in pixels. **Parameters:** * `width` (int) * `height` (int) -------- .. method:: SetSizer(sizer, deleteOld=True) Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted if the `deleteOld` parameter is ``True``. **Parameters:** * `sizer` (`wx.Sizer `_): The sizer to set. Pass ``None`` to disassociate and conditionally delete the window's sizer. See below. * `deleteOld` (bool): If ``True`` (the default), this will delete any prexisting sizer. Pass ``False`` if you wish to handle deleting the old sizer yourself. .. note:: Note that this function will also call `SetAutoLayout <#SetAutoLayout>`_ implicitly with ``True`` parameter if the `sizer` is not ``None`` and ``False`` otherwise. .. note:: `SetSizer` now enables and disables layout automatically. -------- .. method:: SetSizerAndFit(sizer, deleteOld=True) The same as `SetSizer <#SetSizer>`_, except it also sets the size hints for the window based on the sizer's minimum size. **Parameters:** * `sizer` (`wx.Sizer `_) * `deleteOld` (bool) -------- .. method:: SetThemeEnabled(enable) This function tells a window if it should use the system's "theme" code to draw the windows' background instead if its own background drawing code. This does not always have any effect since the underlying platform obviously needs to support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user's selected theme. Dialogs, notebook pages and the status bar have this flag set to ``True`` by default so that the default look and feel is simulated best. **Parameters:** * `enable` (bool) -------- .. method:: SetToolTip(tip) Attach a tooltip to the window. **Parameters:** * `tip` (`wx.ToolTip `_) .. seealso:: `GetToolTip <#GetToolTip>`_, `wx.ToolTip `_ -------- .. method:: SetToolTipString(tip) Attach a tooltip to the window. **Parameters:** * `tip` (string) -------- .. method:: SetTransparent(alpha) Attempt to set the transparency of this window to the `alpha` value, returns ``True`` on success. The `alpha` value is an integer in the range of 0 to 255, where 0 is fully transparent and 255 is fully opaque. **Parameters:** * `alpha` (int): Determines how opaque or transparent the window will be, if the platform supports the opreration. A value of 0 sets the window to be fully transparent, and a value of 255 sets the window to be fully opaque. | **Returns:** `bool` -------- .. method:: SetValidator(validator) Deletes the current validator (if any) and sets the window validator, having called `wx.Validator.Clone `_ to create a new validator of this type. **Parameters:** * `validator` (`wx.Validator `_) -------- .. method:: SetVirtualSize(size) Sets the virtual size of the window in pixels. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: SetVirtualSizeHints(minW, minH, maxW=-1, maxH=-1) Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. **Parameters:** * `minW` (int): Minimum width. * `minH` (int): Minimum height. * `maxW` (int): Maximum width. * `maxH` (int): Maximum height. .. note:: If this function is called, the user will not be able to size the area of the window outside the given bounds. -------- .. method:: SetVirtualSizeHintsSz(minSize, maxSize=wx.DefaultSize) Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. **Parameters:** * `minSize` (`wx.Size `_) * `maxSize` (`wx.Size `_) .. note:: If this function is called, the user will not be able to size the area of the window outside the given bounds. -------- .. method:: SetVirtualSizeWH(w, h) Set the the virtual size of a window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size. **Parameters:** * `w` (int) * `h` (int) -------- .. method:: SetWindowStyle(style) Identical to `SetWindowStyleFlag <#SetWindowStyleFlag>`_. **Parameters:** * `style` (long) -------- .. method:: SetWindowStyleFlag(style) Sets the style of the window. **Parameters:** * `style` (long) .. note:: Please note that some styles cannot be changed after the window creation and that `Refresh <#Refresh>`_ might need to be be called after changing the others for the change to take place immediately. .. seealso:: `GetWindowStyleFlag <#GetWindowStyleFlag>`_ -------- .. method:: SetWindowVariant(variant) This function can be called under all platforms but only does anything under Mac OS X 10.3+ currently. Under this system, each of the standard control can exist in several sizes which correspond to the elements of `wx.WindowVariant` enum: =============================== =============================================== `wx.WindowVariant` Description =============================== =============================================== ``wx.WINDOW_VARIANT_NORMAL`` Normal size ``wx.WINDOW_VARIANT_SMALL`` Smaller size (about 25 % smaller than normal) ``wx.WINDOW_VARIANT_MINI`` Mini size (about 33 % smaller than normal) ``wx.WINDOW_VARIANT_LARGE`` Large size (about 25 % larger than normal) =============================== =============================================== | By default the controls use the normal size, of course, but this function can be used to change this. **Parameters:** * `variant` (`wx.WindowVariant`) -------- .. method:: ShouldInheritColours() Return ``True`` from here to allow the colours of this window to be changed by `InheritAttributes <#InheritAttributes>`_, returning ``False`` forbids inheriting them from the parent window. The base class version returns ``False``, but this method is overridden in `wx.Control `_ where it returns ``True``. | **Returns:** `bool` -------- .. method:: Show(show=True) Shows or hides the window. You may need to call `Raise <#Raise>`_ for a top level window if you want to bring it to top, although this is not needed if `Show()` is called immediately after the frame creation. **Parameters:** * `show` (bool) | **Returns:** `bool` .. seealso:: `IsShown <#IsShown>`_, `Hide <#Hide>`_, `wx.RadioBox.Show `_ -------- .. method:: Thaw() Reenables window updating after a previous call to `Freeze <#Freeze>`_. To really thaw the control, it must be called exactly the same number of times as `Freeze <#Freeze>`_. -------- .. method:: ToggleWindowStyle(flag) Turns the given `flag` on if it's currently turned off and vice versa. This function cannot be used if the value of the `flag` is 0 (which is often the case for default flags). **Parameters:** * `flag` (int) | **Returns:** `bool` .. note:: Please notice that not all styles can be changed after the control creation. .. seealso:: `SetWindowStyleFlag <#SetWindowStyleFlag>`_, `HasFlag <#HasFlag>`_ -------- .. method:: TransferDataFromWindow() Transfers values from child controls to data areas specified by their validators. Returns ``False`` if a transfer failed. If the window has ``wx.WS_EX_VALIDATE_RECURSIVELY`` extra style flag set, the method will also call `TransferDataFromWindow()` of all child windows. | **Returns:** `bool` .. seealso:: `TransferDataToWindow <#TransferDataToWindow>`_, `wx.Validator `_, `Validate <#Validate>`_ -------- .. method:: TransferDataToWindow() Transfers values to child controls from data areas specified by their validators. If the window has ``wx.WS_EX_VALIDATE_RECURSIVELY`` extra style flag set, the method will also call `TransferDataToWindow()` of all child windows. | **Returns:** `bool` .. seealso:: `TransferDataFromWindow <#TransferDataFromWindow>`_, `wx.Validator `_, `Validate <#Validate>`_ -------- .. method:: UnregisterHotKey(hotkeyId) Unregisters a system wide hotkey. **Parameters:** * `hotkeyId` (int): Numeric identifier of the hotkey. Must be the same id that was passed to `RegisterHotKey <#RegisterHotKey>`_. | **Returns:** `bool` .. note:: This function is currently only implemented under MSW. .. seealso:: `RegisterHotKey <#RegisterHotKey>`_ -------- .. method:: Update() Calling this method immediately repaints the invalidated area of the window and all of its children recursively while this would usually only happen when the flow of control returns to the event loop. .. note:: Notice that this function doesn't invalidate any area of the window so nothing happens if nothing has been invalidated (i.e. marked as requiring a redraw). Use `Refresh <#Refresh>`_ first if you want to immediately redraw the window unconditionally. -------- .. method:: UpdateWindowUI(flags=wx.UPDATE_UI_NONE) This function sends `wx.UpdateUIEvents <../Events/wx.UpdateUIEvents.html>`_ to the window. The particular implementation depends on the window; for example a `wx.ToolBar `_ will send an update UI event for each toolbar button, and a `wx.Frame `_ will send an update UI event for each menubar menu item. You can call this function from your application to ensure that your UI is up-to-date at this point (as far as your `wx.UpdateUIEvent` handlers are concerned). This may be necessary if you have called `wx.UpdateUIEvent.SetMode <../Events/wx.UpdateUIEvent.html#SetMode>`_ or `wx.UpdateUIEvent.SetUpdateInterval <../Events/wx.UpdateUIEvent.html#SetUpdateInterval>`_ to limit the overhead that wxWidgets incurs by sending update UI events in idle time. `flags` should be a bitlist of one or more of the following values: ============================= =================================== Update Flags Description ============================= =================================== ``wx.UPDATE_UI_NONE`` = 0x0000, No particular value ``wx.UPDATE_UI_RECURSE`` = 0x0001, Call the function for descendants ``wx.UPDATE_UI_FROMIDLE`` = 0x0002, Invoked from On(Internal)Idle ============================= =================================== | If you are calling this function from an `OnInternalIdle` or `OnIdle` function, make sure you pass the ``wx.UPDATE_UI_FROMIDLE`` flag, since this tells the window to only update the UI elements that need to be updated in idle time. Some windows update their elements only when necessary, for example when a menu is about to be shown. **Parameters:** * `flags` (long) .. seealso:: `wx.UpdateUIEvent <../Events/wx.UpdateUIEvent.html>`_ -------- .. method:: UseBgCol() `No docstrings available for this method.` -------- .. method:: Validate() Validates the current values of the child controls using their validators. If the window has ``wx.WS_EX_VALIDATE_RECURSIVELY`` extra style flag set, the method will also call `Validate()` of all child windows. | **Returns:** `bool` .. seealso:: `TransferDataFromWindow <#TransferDataFromWindow>`_, `TransferDataToWindow <#TransferDataToWindow>`_, `wx.Validator `_ -------- .. method:: WarpPointer(x, y) Moves the pointer to the given position on the window. **Parameters:** * `x` (int): The new x position for the cursor. * `y` (int): The new y position for the cursor. .. note:: This function is not supported under Mac because Apple Human Interface Guidelines forbid moving the mouse cursor programmatically. -------- .. method:: WindowToClientSize(size) Converts window size `size` to corresponding client area size. In other words, the returned value is what would `GetClientSize <#GetClientSize>`_ return if this window had given window size. Components with `wx.DefaultCoord` value are left unchanged. This function is new since wxWidgets version 2.8.8 **Parameters:** * `size` (`wx.Size `_) | **Returns:** `wx.Size `_ .. note:: Note that the conversion is not always exact, it assumes that non-client area doesn't change and so doesn't take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars. -------- Properties ^^^^^^^^^^ .. attribute:: AcceleratorTable See `GetAcceleratorTable <#GetAcceleratorTable>`_ and `SetAcceleratorTable <#SetAcceleratorTable>`_ .. attribute:: AutoLayout See `GetAutoLayout <#GetAutoLayout>`_ and `SetAutoLayout <#SetAutoLayout>`_ .. attribute:: BackgroundColour See `GetBackgroundColour <#GetBackgroundColour>`_ and `SetBackgroundColour <#SetBackgroundColour>`_ .. attribute:: BackgroundStyle See `GetBackgroundStyle <#GetBackgroundStyle>`_ and `SetBackgroundStyle <#SetBackgroundStyle>`_ .. attribute:: BestSize See `GetBestSize <#GetBestSize>`_ .. attribute:: BestVirtualSize See `GetBestVirtualSize <#GetBestVirtualSize>`_ .. attribute:: Border See `GetBorder <#GetBorder>`_ .. attribute:: Caret See `GetCaret <#GetCaret>`_ and `SetCaret <#SetCaret>`_ .. attribute:: CharHeight See `GetCharHeight <#GetCharHeight>`_ .. attribute:: CharWidth See `GetCharWidth <#GetCharWidth>`_ .. attribute:: Children See `GetChildren <#GetChildren>`_ .. attribute:: ClientAreaOrigin See `GetClientAreaOrigin <#GetClientAreaOrigin>`_ .. attribute:: ClientRect See `GetClientRect <#GetClientRect>`_ and `SetClientRect <#SetClientRect>`_ .. attribute:: ClientSize See `GetClientSize <#GetClientSize>`_ and `SetClientSize <#SetClientSize>`_ .. attribute:: Constraints See `GetConstraints <#GetConstraints>`_ and `SetConstraints <#SetConstraints>`_ .. attribute:: ContainingSizer See `GetContainingSizer <#GetContainingSizer>`_ and `SetContainingSizer <#SetContainingSizer>`_ .. attribute:: Cursor See `GetCursor <#GetCursor>`_ and `SetCursor <#SetCursor>`_ .. attribute:: DefaultAttributes See `GetDefaultAttributes <#GetDefaultAttributes>`_ .. attribute:: DropTarget See `GetDropTarget <#GetDropTarget>`_ and `SetDropTarget <#SetDropTarget>`_ .. attribute:: EffectiveMinSize See `GetEffectiveMinSize <#GetEffectiveMinSize>`_ .. attribute:: Enabled See `IsEnabled <#IsEnabled>`_ and `Enable <#Enable>`_ .. attribute:: EventHandler See `GetEventHandler <#GetEventHandler>`_ and `SetEventHandler <#SetEventHandler>`_ .. attribute:: ExtraStyle See `GetExtraStyle <#GetExtraStyle>`_ and `SetExtraStyle <#SetExtraStyle>`_ .. attribute:: Font See `GetFont <#GetFont>`_ and `SetFont <#SetFont>`_ .. attribute:: ForegroundColour See `GetForegroundColour <#GetForegroundColour>`_ and `SetForegroundColour <#SetForegroundColour>`_ .. attribute:: GrandParent See `GetGrandParent <#GetGrandParent>`_ .. attribute:: GtkWidget On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero. .. attribute:: Handle See `GetHandle <#GetHandle>`_ .. attribute:: HelpText See `GetHelpText <#GetHelpText>`_ and `SetHelpText <#SetHelpText>`_ .. attribute:: Id See `GetId <#GetId>`_ and `SetId <#SetId>`_ .. attribute:: Label See `GetLabel <#GetLabel>`_ and `SetLabel <#SetLabel>`_ .. attribute:: LayoutDirection See `GetLayoutDirection <#GetLayoutDirection>`_ and `SetLayoutDirection <#SetLayoutDirection>`_ .. attribute:: MaxHeight See `GetMaxHeight <#GetMaxHeight>`_ .. attribute:: MaxSize See `GetMaxSize <#GetMaxSize>`_ and `SetMaxSize <#SetMaxSize>`_ .. attribute:: MaxWidth See `GetMaxWidth <#GetMaxWidth>`_ .. attribute:: MinHeight See `GetMinHeight <#GetMinHeight>`_ .. attribute:: MinSize See `GetMinSize <#GetMinSize>`_ and `SetMinSize <#SetMinSize>`_ .. attribute:: MinWidth See `GetMinWidth <#GetMinWidth>`_ .. attribute:: Name See `GetName <#GetName>`_ and `SetName <#SetName>`_ .. attribute:: Parent See `GetParent <#GetParent>`_ .. attribute:: Position See `GetPosition` and `SetPosition` .. attribute:: Rect See `GetRect <#GetRect>`_ and `SetRect <#SetRect>`_ .. attribute:: ScreenPosition See `GetScreenPosition <#GetScreenPosition>`_ .. attribute:: ScreenRect See `GetScreenRect <#GetScreenRect>`_ .. attribute:: Shown See `IsShown <#IsShown>`_ and `Show <#Show>`_ .. attribute:: Size See `GetSize <#GetSize>`_ and `SetSize <#SetSize>`_ .. attribute:: Sizer See `GetSizer <#GetSizer>`_ and `SetSizer <#SetSizer>`_ .. attribute:: ThemeEnabled See `GetThemeEnabled <#GetThemeEnabled>`_ and `SetThemeEnabled <#SetThemeEnabled>`_ .. attribute:: ToolTip See `GetToolTip <#GetToolTip>`_ and `SetToolTip <#SetToolTip>`_ .. attribute:: TopLevel See `IsTopLevel <#IsTopLevel>`_ .. attribute:: TopLevelParent See `GetTopLevelParent <#GetTopLevelParent>`_ .. attribute:: UpdateClientRect See `GetUpdateClientRect <#GetUpdateClientRect>`_ .. attribute:: UpdateRegion See `GetUpdateRegion <#GetUpdateRegion>`_ .. attribute:: Validator See `GetValidator <#GetValidator>`_ and `SetValidator <#SetValidator>`_ .. attribute:: VirtualSize See `GetVirtualSize <#GetVirtualSize>`_ and `SetVirtualSize <#SetVirtualSize>`_ .. attribute:: WindowStyle See `GetWindowStyle` and `SetWindowStyle <#SetWindowStyle>`_ .. attribute:: WindowStyleFlag See `GetWindowStyleFlag <#GetWindowStyleFlag>`_ and `SetWindowStyleFlag <#SetWindowStyleFlag>`_ .. attribute:: WindowVariant See `GetWindowVariant <#GetWindowVariant>`_ and `SetWindowVariant <#SetWindowVariant>`_