pub fn toggle_flag(flag: &str, widget: &mut WidgetContainer) {
    if !widget.has::<bool>(flag) {
        return;
    }

    let value = *widget.get::<bool>(flag);

    if let Some(selector) = widget.try_get_mut::<Selector>("selector") {
        if value {
            selector.push_state(flag);
        } else {
            selector.remove_state(flag);
        }
    }
}
/// Toggles the selector state`.
Toggles the selector state`.
Toggles the selector state ` .
pub fn toggle_flag(flag: &str, widget: &mut WidgetContainer) {
    if !widget.has::<bool>(flag) {
        return;
    }
    let value = *widget.get::<bool>(flag);
    if let Some(selector) = widget.try_get_mut::<Selector>("selector") {
        if value {
            selector.push_state(flag);
        } else {
            selector.remove_state(flag);
        }
    }
}
pub fn toggle_flag ( flag : & str , widget : & mut WidgetContainer ) { if ! widget . has :: < bool > ( flag ) { return ; } let value = * widget . get :: < bool > ( flag ) ; if let Some ( selector ) = widget . try_get_mut :: < Selector > ( " " ) { if value { selector . push_state ( flag ) ; } else { selector . remove_state ( flag ) ; } } }
Toggles the selector state`.
Toggles the selector state ` .
flag
&str
widget
&mut WidgetContainer