wx.ToggleButton

Inheritance diagram for wx.ToggleButton:



Description

wx.ToggleButton is a button that stays pressed when clicked by the user. In other words, it is similar to wx.CheckBox in functionality but looks like a wx.Button.

Event Handling

Event Name Description
wx.EVT_TOGGLEBUTTON(id, func) Handles a toggle button click event.

Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Methods Summary

Properties Summary

Class API

Methods

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

Constructor, creating and showing a toggle button.

Parameters:


Returns:

wx.ToggleButton


GetValue()

Gets the state of the toggle button.

Returns True if it is pressed, False otherwise.


Returns:

bool


SetValue(value)

Sets the toggle button to the given state. This does not cause a wx.EVT_TOGGLEBUTTON event to be emitted.

Parameters:

  • value (bool): If True, the button is pressed

Properties

Value
See GetValue and SetValue