wx.Control

Inheritance diagram for wx.Control:



Class API

Methods

__init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, validator=wx.DefaultValidator, name=wx.ControlNameStr)

Create a Control. Normally you should only call this from a subclass’ __init__ as a plain old wx.Control is not very useful.

Parameters:


Returns:

wx.Control


Command(event)

Simulates the effect of the user issuing a command to the item.

Parameters:

See also

wx.CommandEvent


GetAlignment()

Get the control alignment (left/right/centre, top/bottom/centre)


Returns:

int


GetLabel()

Returns the control’s text.


Returns:

string

Note

Note that the returned string contains the mnemonics (& characters) if any, use GetLabelText if they are undesired.


GetLabelText()

Returns the control’s label or the given label string for the static version without the mnemonics characters.


Returns:

string


SetLabel(label)

Sets the item’s text.

The & characters in the label are special and indicate that the following character is a mnemonic for this control and can be used to activate it from the keyboard (typically by using Alt key in combination with it). To insert a literal ampersand character, you need to double it, i.e. use &&.

Parameters:

  • label (string): the item label.

Properties

Alignment
See GetAlignment
LabelText
See GetLabelText