Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

imgui_knobs (C++)

ImGui Knobs: rotary knobs for numeric values, in several styles (tick, dot, wiper, stepped, space...).

The C++ API of ImGui Knobs as it is bound to Python: the entries of the module imgui_bundle.imgui_knobs, in the same order, with their C++ signatures and the headers’ comments. From the stubs: the functions excluded from the bindings, the typedefs and the macros are absent.

imgui-knobs.h

ImGuiKnobFlags_ (enum)

MemberValue
ImGuiKnobFlags_NoTitle = 1 << 01 << 0
ImGuiKnobFlags_NoInput = 1 << 11 << 1
ImGuiKnobFlags_ValueTooltip = 1 << 21 << 2
ImGuiKnobFlags_DragHorizontal = 1 << 31 << 3
ImGuiKnobFlags_DragVertical = 1 << 41 << 4
ImGuiKnobFlags_Logarithmic = 1 << 51 << 5
ImGuiKnobFlags_AlwaysClamp = 1 << 61 << 6

ImGuiKnobVariant_ (enum)

MemberValue
ImGuiKnobVariant_Tick = 1 << 01 << 0
ImGuiKnobVariant_Dot = 1 << 11 << 1
ImGuiKnobVariant_Wiper = 1 << 21 << 2
ImGuiKnobVariant_WiperOnly = 1 << 31 << 3
ImGuiKnobVariant_WiperDot = 1 << 41 << 4
ImGuiKnobVariant_Stepped = 1 << 51 << 5
ImGuiKnobVariant_Space = 1 << 6, }1 << 6

color_set (struct)

Member
ImColor base;
ImColor hovered;
ImColor active;

color_set::color_set

color_set(ImColor base, ImColor hovered, ImColor active)
color_set() : base(ImColor(0, 0, 0)), hovered(ImColor(0, 0, 0)), active(ImColor(0, 0, 0));
color_set(ImColor color);
            : base(base), hovered(hovered), active(active);

KnobColors (struct)

Member
color_set primary;
color_set secondary;
color_set track;

ImGuiKnobs::SetKnobColors

void SetKnobColors(const KnobColors& colors);

Set custom knob colors. Pass individual color_sets for primary (indicator), secondary (circle body), and track (background arc).

ImGuiKnobs::UnsetKnobColors

void UnsetKnobColors();

Reset to theme-aware defaults (auto-detects dark/light theme).

ImGuiKnobs::Knob

bool Knob( const char *label, float *p_value, float v_min, float v_max, float speed = 0, const char *format = "%.3f", ImGuiKnobVariant variant = ImGuiKnobVariant_Tick, float size = 0, ImGuiKnobFlags flags = 0, int steps = 10, float angle_min = -1, float angle_max = -1);

ImGuiKnobs::KnobInt

bool KnobInt( const char *label, int *p_value, int v_min, int v_max, float speed = 0, const char *format = "%i", ImGuiKnobVariant variant = ImGuiKnobVariant_Tick, float size = 0, ImGuiKnobFlags flags = 0, int steps = 10, float angle_min = -1, float angle_max = -1);