Skip to main content

toggle_with

Function toggle_with 

Source
pub fn toggle_with(
    ui: &mut Ui<'_>,
    kind: Toggle,
    key: &str,
    text: &str,
    spec: NodeSpec,
    hint: Option<&str>,
) -> Key
Expand description

A toggle with its spec in the caller’s hands, the way button_with takes the button’s: spec is toggle_spec plus the state and the rows the element admits — checked, mixed (a checkbox’s third state), on_click, label, description, disabled, and hint, the tooltip drawn while it is hovered. The role is kind’s whatever the spec said. Keyed by key; an empty text draws the indicator alone, which then wants a label. A disabled toggle is dimmed as well as inert. This is what <checkbox>, <radio>, <switch> and their Lua and C doors lower to.