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.
^^
Handlers bound for the following event types will receive a wx.CommandEvent parameter.
EVT_TOGGLEBUTTON: Handles a wxEVT_TOGGLEBUTTON event. ^^
Default constructor. |
|
Create method for two-step construction. |
|
Gets the state of the toggle button. |
|
Sets the toggle button to the given state. |
wx.
BitmapToggleButton
(ToggleButton)¶Possible constructors:
BitmapToggleButton() -> None
BitmapToggleButton(parent : Window, id: int=ID_ANY, label:
BitmapBundle=NullBitmap, pos: Point=DefaultPosition, size:
Size=DefaultSize, style: int=0, val: Validator=DefaultValidator, name:
str=CheckBoxNameStr) -> None
BitmapToggleButton is a ToggleButton that contains a bitmap instead of text.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
None
__init__ (self, parent : Window, id: int=ID_ANY, label: BitmapBundle=NullBitmap, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0, val: Validator=DefaultValidator, name: str=CheckBoxNameStr)
Constructor, creating and showing a toggle button with the bitmap label.
Internally calls Create
.
parent (wx.Window) –
id (wx.WindowID) –
label (wx.BitmapBundle) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
val (wx.Validator) –
name (string) –
None
Create
(self, parent : Window, id: int=ID_ANY, label: BitmapBundle=NullBitmap, pos: Point=DefaultPosition, size: Size=DefaultSize, style: int=0, val: Validator=DefaultValidator, name: str=CheckBoxNameStr)¶Create method for two-step construction.
parent (wx.Window) –
id (wx.WindowID) –
label (wx.BitmapBundle) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
val (wx.Validator) –
name (string) –
bool
GetClassDefaultAttributes
(variant: WindowVariant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
GetValue
(self)¶Gets the state of the toggle button.
bool
Returns True
if it is pressed, False
otherwise.
SetValue
(self, state : bool)¶Sets the toggle button to the given state.
This does not cause a EVT_TOGGLEBUTTON
event to be emitted.
state (bool) – If True
, the button is pressed.
None