wx.BitmapToggleButton¶
wx.BitmapToggleButton is a wx.ToggleButton that contains a bitmap instead of text.
This class is not available in all ports currently (although it is available in the major ones), test for HAS_BITMAPTOGGLEBUTTON
to determine whether it can be used (in addition for possibly testing for USE_TOGGLEBTN
which can be set to 0 to explicitly disable support for this class and wx.ToggleButton).
This control emits an update UI event.
Events Emitted by this Class¶
Handlers bound for the following event types will receive a wx.CommandEvent parameter.
EVT_TOGGLEBUTTON: Handles a wxEVT_TOGGLEBUTTON event.
Class Hierarchy¶
Methods Summary¶
Default constructor. |
|
Create method for two-step construction. |
|
Gets the state of the toggle button. |
|
Sets the toggle button to the given state. |
Properties Summary¶
Class API¶
- class wx.BitmapToggleButton(ToggleButton)¶
Possible constructors:
BitmapToggleButton() -> None BitmapToggleButton(parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr) -> None
BitmapToggleButton is a ToggleButton that contains a bitmap instead of text.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor.
- Return type:
None
__init__ (self, parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr)
Constructor, creating and showing a toggle button with the bitmap label.
Internally calls
Create
.- Parameters:
parent (wx.Window)
id (wx.WindowID)
label (wx.BitmapBundle)
pos (wx.Point)
size (wx.Size)
style (long)
val (wx.Validator)
name (string)
- Return type:
None
- Create(self, parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr)¶
Create method for two-step construction.
- Parameters:
parent (wx.Window)
id (wx.WindowID)
label (wx.BitmapBundle)
pos (wx.Point)
size (wx.Size)
style (long)
val (wx.Validator)
name (string)
- Return type:
bool
- static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
- Parameters:
variant (WindowVariant)
- Return type:
- GetValue(self)¶
Gets the state of the toggle button.
- Return type:
bool
- Returns:
Returns
True
if it is pressed,False
otherwise.
- SetValue(self, state)¶
Sets the toggle button to the given state.
This does not cause a
EVT_TOGGLEBUTTON
event to be emitted.- Parameters:
state (bool) – If
True
, the button is pressed.- Return type:
None
Properties¶