Switch

Screenshot

Switch - Reference - Enaml-native - CodeLV

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.

create_widget()[source]

Create the underlying widget.

init_widget()[source]

Initialize the underlying widget.

No iOS implementation found.