wx.RadioButton

Inheritance diagram for wx.RadioButton:



Description

A radio button item is a button which usually denotes one of several mutually exclusive options. It has a text label next to a (usually) round button.

You can create a group of mutually-exclusive radio buttons by specifying wx.RB_GROUP for the first in the group. The group ends when another radio button group is created, or there are no more radio buttons.

Window Styles

Window Style Description
wx.RB_GROUP Marks the beginning of a new group of radio buttons.
wx.RB_SINGLE In some circumstances, radio buttons that are not consecutive siblings trigger a hang bug in Windows (only). If this happens, add this style to mark the button as not belonging to a group, and implement the mutually-exclusive group behaviour yourself.
wx.RB_USE_CHECKBOX Use a checkbox button instead of radio button (currently supported only on PalmOS).

Event Handling

Event Name Description
wx.EVT_RADIOBUTTON(id, func) Process a wx.wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the radiobutton is clicked.

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

Constructor.

Parameters:


Returns:

wx.RadioButton


GetValue()

Returns True if the radio button is depressed, False otherwise.


Returns:

bool


SetValue(value)

Sets the radio button to selected or deselected status. This does not cause a wx.wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted.

Parameters:

  • value (bool): True to select, False to deselect.

Properties

Value
See GetValue and SetValue