pub fn toggle_button(&mut self, on_text: &str, off_text: &str, state: &mut bool) -> bool {
        let (id, on_text) = id_and_text(on_text, CompType::ToggleButton, &self.salt);
        let text = if *state { on_text } else { off_text };
        let toggle = self.button_internal(text, id).2;
        if toggle {
            *state = !*state;
        }
        toggle
    }
/// Shows a new toggle button which toggles between showing `on_text` and `off_text` whenever
/// the button is pressed. Note that this function needs to be called every frame if you want
/// to see the button. Only the `on_text` is used to create the id for this button, so only it
/// needs to be unique. Additionally, there is a separate id "pool" for toggle buttons, so you
/// can have buttons and toggle buttons with the same nameThe same rules as for naming buttons 
/// apply.
///
/// Returns true if the button was toggled
Shows a new toggle button which toggles between showing `on_text` and `off_text` whenever
the button is pressed. Note that this function needs to be called every frame if you want
to see the button. Only the `on_text` is used to create the id for this button, so only it
needs to be unique. Additionally, there is a separate id "pool" for toggle buttons, so you
can have buttons and toggle buttons with the same nameThe same rules as for naming buttons
apply.

Returns true if the button was toggled
Shows a new toggle button which toggles between showing ` on_text ` and ` off_text ` whenever the button is pressed . Note that this function needs to be called every frame if you want to see the button . Only the ` on_text ` is used to create the id for this button so only it needs to be unique . Additionally there is a separate id " pool " for toggle buttons so you can have buttons and toggle buttons with the same nameThe same rules as for naming buttons apply . Returns true if the button was toggled
pub fn toggle_button(&mut self, on_text: &str, off_text: &str, state: &mut bool) -> bool {
        let (id, on_text) = id_and_text(on_text, CompType::ToggleButton, &self.salt);
        let text = if *state { on_text } else { off_text };
        let toggle = self.button_internal(text, id).2;
        if toggle {
            *state = !*state;
        }
        toggle
    }
pub fn toggle_button ( & mut self , on_text : & str , off_text : & str , state : & mut bool ) -> bool { let ( id , on_text ) = id_and_text ( on_text , CompType :: ToggleButton , & self . salt ) ; let text = if * state { on_text } else { off_text } ; let toggle = self . button_internal ( text , id ) . 2 ; if toggle { * state = ! * state ; } toggle }
Shows a new toggle button which toggles between showing `on_text` and `off_text` whenever
the button is pressed.
Shows a new toggle button which toggles between showing ` on_text ` and ` off_text ` whenever the button is pressed .
&mut self
on_text
&str
off_text
&str
state
&mut bool
&mut self
on_text
&str
off_text
&str
state
&mut bool