wx.Panel

Inheritance diagram for wx.Panel:



Description

A panel is a window on which controls are placed. It is usually placed within a frame. It contains minimal extra functionality over and above its parent class wx.Window; its main purpose is to be similar in appearance and functionality to a dialog, but with the flexibility of having any window as a parent.

Tip

if not all characters are being intercepted by your OnKeyDown or OnChar handler, it may be because you are using the wx.TAB_TRAVERSAL style, which grabs some keypresses for use by child controls.

See also

wx.Dialog

Remarks

By default, a panel has the same colouring as a dialog.

Class API

Methods

__init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TAB_TRAVERSAL|wx.NO_BORDER, name=wx.PanelNameStr)

Constructor.

Parameters:


Returns:

wx.Panel


SetFocus()

Overrides wx.Window.SetFocus.

This method uses the mix-in class wx.ControlContainer which manages the focus and TAB logic for controls which usually have child controls. In practice, if you call this method and the control has at least one child window, the focus will be given to the child window.


SetFocusIgnoringChildren()
In contrast to SetFocus (see above) this will set the focus to the panel even of there are child windows in the panel. This is only rarely needed.