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 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.
This class supports the following styles:
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.Handlers bound for the following event types will receive a wx.CommandEvent parameter.
wxEVT_RADIOBUTTON
event, when the radiobutton is clicked.See also
__init__ |
Default constructor. |
Create |
Creates the choice for two-step construction. |
GetValue |
Returns True if the radio button is checked, False otherwise. |
SetValue |
Sets the radio button to checked or unchecked status. |
wx.
RadioButton
(Control)¶Possible constructors:
RadioButton()
RadioButton(parent, id=ID_ANY, label="", pos=DefaultPosition,
size=DefaultSize, style=0, validator=DefaultValidator,
name=RadioButtonNameStr)
A radio button item is a button which usually denotes one of several mutually exclusive options.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
See also
__init__ (self, parent, id=ID_ANY, label=””, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=RadioButtonNameStr)
Constructor, creating and showing a radio button.
Parameters: |
|
---|
See also
Create
(self, parent, id=ID_ANY, label="", pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=RadioButtonNameStr)¶Creates the choice for two-step construction.
See wx.RadioButton for further details.
Parameters: |
|
---|---|
Return type: | bool |
GetValue
(self)¶Returns True
if the radio button is checked, False
otherwise.
Return type: | bool |
---|
SetValue
(self, value)¶Sets the radio button to checked or unchecked status.
This does not cause a wxEVT_RADIOBUTTON
event to get emitted.
If the radio button belongs to a radio group exactly one button in the group may be checked and so this method can be only called with value set to True
. To uncheck a radio button in a group you must check another button in the same group.
Parameters: | value (bool) – True to check, False to uncheck. |
---|