ImGui Knobs: rotary knobs for numeric values, in several styles (tick, dot, wiper, stepped, space...).
knob(label, value, v_min, v_max) returns (changed, new_value); knob_int() is its integer version.
The module imgui_bundle.imgui_knobs, the Python API of ImGui Knobs, from bindings/imgui_bundle/imgui_knobs.pyi: 4 functions, 2 classes, 2 enums. Each entry gives the Python signature, then the C++ one, then the doc of the C++ header. The sections are the header’s.
imgui-knobs.h¶
ImGuiKnobFlags_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
no_title | 1 << 0 | ImGuiKnobFlags_NoTitle = 1 << 0 | |
no_input | 1 << 1 | ImGuiKnobFlags_NoInput = 1 << 1 | |
value_tooltip | 1 << 2 | ImGuiKnobFlags_ValueTooltip = 1 << 2 | |
drag_horizontal | 1 << 3 | ImGuiKnobFlags_DragHorizontal = 1 << 3 | |
drag_vertical | 1 << 4 | ImGuiKnobFlags_DragVertical = 1 << 4 | |
logarithmic | 1 << 5 | ImGuiKnobFlags_Logarithmic = 1 << 5 | |
always_clamp | 1 << 6 | ImGuiKnobFlags_AlwaysClamp = 1 << 6 |
ImGuiKnobVariant_ (enum)¶
| Member | Value | C++ | |
|---|---|---|---|
tick | 1 << 0 | ImGuiKnobVariant_Tick = 1 << 0 | |
dot | 1 << 1 | ImGuiKnobVariant_Dot = 1 << 1 | |
wiper | 1 << 2 | ImGuiKnobVariant_Wiper = 1 << 2 | |
wiper_only | 1 << 3 | ImGuiKnobVariant_WiperOnly = 1 << 3 | |
wiper_dot | 1 << 4 | ImGuiKnobVariant_WiperDot = 1 << 4 | |
stepped | 1 << 5 | ImGuiKnobVariant_Stepped = 1 << 5 | |
space | 1 << 6 | ImGuiKnobVariant_Space = 1 << 6, } |
color_set (class)¶
| Attribute | C++ | |
|---|---|---|
base: ImColor | ImColor base; | |
hovered: ImColor | ImColor hovered; | |
active: ImColor | ImColor active; |
color_set.__init__¶
@overload
def __init__(self, base: ImColor, hovered: ImColor, active: ImColor) -> None
@overload
def __init__(self) -> None
@overload
def __init__(self, color: ImColor) -> Nonecolor_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);KnobColors (class)¶
| Attribute | C++ | |
|---|---|---|
primary: color_set | color_set primary; | |
secondary: color_set | color_set secondary; | |
track: color_set | color_set track; |
KnobColors.__init__¶
def __init__(self, primary: Optional[color_set] = None, secondary: Optional[color_set] = None, track: Optional[color_set] = None) -> NoneAuto-generated default constructor with named params
Python bindings defaults:
If any of the params below is None, then its default value below will be used:
* primary: color_set()
* secondary: color_set()
* track: color_set()
set_knob_colors¶
def set_knob_colors(colors: KnobColors) -> Nonevoid SetKnobColors(const KnobColors& colors);Set custom knob colors. Pass individual color_sets for primary (indicator), secondary (circle body), and track (background arc).
unset_knob_colors¶
def unset_knob_colors() -> Nonevoid UnsetKnobColors();Reset to theme-aware defaults (auto-detects dark/light theme).
knob¶
def knob(label: str, p_value: float, v_min: float, v_max: float, speed: float = 0, format: str = '%.3f', variant: Optional[ImGuiKnobVariant] = None, size: float = 0, flags: ImGuiKnobFlags = 0, steps: int = 10, angle_min: float = -1, angle_max: float = -1) -> Tuple[bool, float]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);Python bindings defaults:
If variant is None, then its default value will be: ImGuiKnobVariant_.tick
knob_int¶
def knob_int(label: str, p_value: int, v_min: int, v_max: int, speed: float = 0, format: str = '%i', variant: Optional[ImGuiKnobVariant] = None, size: float = 0, flags: ImGuiKnobFlags = 0, steps: int = 10, angle_min: float = -1, angle_max: float = -1) -> Tuple[bool, int]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);Python bindings defaults:
If variant is None, then its default value will be: ImGuiKnobVariant_.tick