Switch¶
Screenshot¶
Example¶
from enamlnative.widgets.api import *
enamldef ContentView(Flexbox):
flex_direction = "column"
Switch: sw:
text = "Switch"
checked = True
Switch:
text = "Bound switch"
checked := sw.checked
Declaration¶
- class enamlnative.widgets.switch.Switch(parent=None, **kwargs)[source]¶
Bases:
enamlnative.widgets.compound_button.CompoundButton
A simple control for displaying a Switch.
- show_text¶
Sets whether the on/off text should be displayed.
- split_track¶
Specifies whether the track should be split by the thumb.
- text_off¶
Sets the text for when the button is not in the checked state.
- text_on¶
Sets the text for when the button is in the checked state.
- proxy¶
A reference to the ProxySwitch object.
Android Implementation¶
- class enamlnative.android.android_switch.AndroidSwitch[source]¶
Bases:
enamlnative.android.android_compound_button.AndroidCompoundButton
,enamlnative.widgets.switch.ProxySwitch
An Android implementation of an Enaml ProxySwitch.
- widget¶
A reference to the widget created by the proxy.
No iOS implementation found.