Show / Hide Table of Contents

Toggle Button

A toggle button returns true if the box is ticked. Otherwise, it returns false. Use this if you need to keep track of a state.

Remarks

  • Toggle states internally cache a bool to keep the state.
    • Please see the Prune API for more information.

Example

bool toggled; // class variable

ImGui.Label($"Toggle Value: {toggled}");
toggled = ImGui.Toggle("Toggle Button Demo");

toggle

  • Improve this Doc
In This Article
Back to top Generated by DocFX