2.5. Style helpers — colors, vars, push/pop, themes

Style stack primitives plus the with_style((key, val), …) { } call_macro for scoped style overrides. push_style_one is overloaded for color (ImGuiCol key with ImVec4 or packed uint) and var (ImGuiStyleVar key with float or ImVec2); pop_style_n(n) rolls back exactly n entries via a per-thread kind stack that batches into one PopStyleColor + one PopStyleVar call. The with_style macro emits push/invoke/pop in source order for arbitrary heterogeneous tuples — what daslang’s uniform varargs can’t express.

2.5.1. Call macros

with_style

Function annotation with_style

2.5.2. Push/pop

pop_style_n(n: int )

Pop the last n entries pushed via push_style_one, issuing one bulk PopStyleColor and one bulk PopStyleVar.

Arguments:
  • n : int

2.5.2.1. push_style_one

push_style_one(idx: ImGuiCol; col: uint )

Push one ImGui style entry — color (ImGuiCol key) or var (ImGuiStyleVar key); paired with pop_style_n.

Arguments:
push_style_one(idx: ImGuiStyleVar; val: ImVec2 )
push_style_one(idx: ImGuiCol; col: ImVec4 )
push_style_one(idx: ImGuiStyleVar; val: float )