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.internal

Dear ImGui’s internal API (imgui_internal.h): the functions and structures that the widgets are built with.

Use it to write custom widgets, or to reach what the public API does not expose. It may change between versions of Dear ImGui, without notice.

The module imgui_bundle.imgui.internal, the Python API of Dear ImGui, from bindings/imgui_bundle/imgui/internal.pyi: 566 functions, 91 classes, 44 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_internal.h

Generic helpers

im_hash_data

def im_hash_data(data: Any, data_size: int, seed: ID = 0) -> ID
IMGUI_API ImGuiID ImHashData(const void* data, size_t data_size, ImGuiID seed = 0);

Note that the ImXXX helpers functions are lower-level than ImGui functions.
ImGui functions or the ImGui context are never called/used from other ImXXX functions.

im_hash_str

def im_hash_str(data: str, data_size: int = 0, seed: ID = 0) -> ID
IMGUI_API ImGuiID ImHashStr(const char* data, size_t data_size = 0, ImGuiID seed = 0);

im_hash_skip_uncontributing_prefix

def im_hash_skip_uncontributing_prefix(label: str) -> str
IMGUI_API const char* ImHashSkipUncontributingPrefix(const char* label);

Helpers: Sorting

im_alpha_blend_colors

def im_alpha_blend_colors(col_a: ImU32, col_b: ImU32) -> ImU32
IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);

Helpers: Color Blending

Helpers: Bit manipulation

im_is_power_of_two

@overload
def im_is_power_of_two(v: int) -> bool

@overload
def im_is_power_of_two(v: ImU64) -> bool
inline bool ImIsPowerOfTwo(int v);
inline bool ImIsPowerOfTwo(ImU64 v);

(private API)

im_upper_power_of_two

def im_upper_power_of_two(v: int) -> int
inline int ImUpperPowerOfTwo(int v);

(private API)

im_count_set_bits

def im_count_set_bits(v: int) -> int
inline unsigned int ImCountSetBits(unsigned int v);

(private API)

Helpers: String

im_memdup

def im_memdup(src: Any, size: int) -> Any
IMGUI_API void* ImMemdup(const void* src, size_t size);

Duplicate a chunk of memory.

im_char_is_blank_w

def im_char_is_blank_w(c: int) -> bool
inline bool ImCharIsBlankW(unsigned int c);

(private API)

Helpers: UTF-8 <> wchar conversions

im_text_find_previous_utf8_codepoint

def im_text_find_previous_utf8_codepoint(in_text_start: str, in_p: str) -> str
IMGUI_API const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_p);

return previous UTF-8 code-point.

im_text_find_valid_utf8_codepoint_end

def im_text_find_valid_utf8_codepoint_end(in_text_start: str, in_text_end: str, in_p: str) -> str
IMGUI_API const char* ImTextFindValidUtf8CodepointEnd(const char* in_text_start, const char* in_text_end, const char* in_p);

return previous UTF-8 code-point if ‘in_p’ is not the end of a valid one.

im_text_count_lines

def im_text_count_lines(in_text: str, in_text_end: str) -> int
IMGUI_API int ImTextCountLines(const char* in_text, const char* in_text_end);

return number of lines taken by text. trailing carriage return doesn’t count as an extra line.

ImDrawTextFlags_ (enum)

Helpers: High-level text functions (DO NOT USE!!! THIS IS A MINIMAL SUBSET OF LARGER UPCOMING CHANGES)

MemberValueC++
none0ImDrawTextFlags_None = 0
cpu_fine_clip1 << 0ImDrawTextFlags_CpuFineClip = 1 << 0Must be == 1/True for legacy with ‘bool cpu_fine_clip’ arg to RenderText()
wrap_keep_blanks1 << 1ImDrawTextFlags_WrapKeepBlanks = 1 << 1
stop_on_new_line1 << 2ImDrawTextFlags_StopOnNewLine = 1 << 2, }

im_font_calc_word_wrap_position_ex

def im_font_calc_word_wrap_position_ex(font: ImFont, size: float, text: str, text_end: str, wrap_width: float, flags: ImDrawTextFlags = 0) -> str
IMGUI_API const char* ImFontCalcWordWrapPositionEx(ImFont* font, float size, const char* text, const char* text_end, float wrap_width, ImDrawTextFlags flags = 0);

im_text_calc_word_wrap_next_line_start

def im_text_calc_word_wrap_next_line_start(text: str, text_end: str, flags: ImDrawTextFlags = 0) -> str
IMGUI_API const char* ImTextCalcWordWrapNextLineStart(const char* text, const char* text_end, ImDrawTextFlags flags = 0);

trim trailing space and find beginning of next line

ImWcharClass (enum)

Character classification for word-wrapping logic

MemberValueC++
blank0ImWcharClass_Blank
punct1ImWcharClass_Punct
other2ImWcharClass_Other

im_text_init_classifiers

def im_text_init_classifiers() -> None
IMGUI_API void ImTextInitClassifiers();

im_text_classifier_clear

def im_text_classifier_clear(bits: ImU32, codepoint_min: int, codepoint_end: int, char_class: ImWcharClass) -> None
IMGUI_API void ImTextClassifierClear(ImU32* bits, unsigned int codepoint_min, unsigned int codepoint_end, ImWcharClass char_class);

im_text_classifier_set_char_class

def im_text_classifier_set_char_class(bits: ImU32, codepoint_min: int, codepoint_end: int, char_class: ImWcharClass, c: int) -> None
IMGUI_API void ImTextClassifierSetCharClass(ImU32* bits, unsigned int codepoint_min, unsigned int codepoint_end, ImWcharClass char_class, unsigned int c);

Helpers: File System

im_min

def im_min(lhs: ImVec2Like, rhs: ImVec2Like) -> ImVec2
inline ImVec2 ImMin(const ImVec2& lhs, const ImVec2& rhs);

(private API)

im_max

def im_max(lhs: ImVec2Like, rhs: ImVec2Like) -> ImVec2
inline ImVec2 ImMax(const ImVec2& lhs, const ImVec2& rhs);

(private API)

im_clamp

def im_clamp(v: ImVec2Like, mn: ImVec2Like, mx: ImVec2Like) -> ImVec2
inline ImVec2 ImClamp(const ImVec2& v, const ImVec2&mn, const ImVec2&mx);

(private API)

im_lerp

@overload
def im_lerp(a: ImVec2Like, b: ImVec2Like, t: float) -> ImVec2

@overload
def im_lerp(a: ImVec2Like, b: ImVec2Like, t: ImVec2Like) -> ImVec2

@overload
def im_lerp(a: ImVec4Like, b: ImVec4Like, t: float) -> ImVec4
inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, float t);
inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t);
inline ImVec4 ImLerp(const ImVec4& a, const ImVec4& b, float t);

(private API)

im_saturate

def im_saturate(f: float) -> float
inline float ImSaturate(float f);

(private API)

im_length_sqr

@overload
def im_length_sqr(lhs: ImVec2Like) -> float

@overload
def im_length_sqr(lhs: ImVec4Like) -> float
inline float ImLengthSqr(const ImVec2& lhs);
inline float ImLengthSqr(const ImVec4& lhs);

(private API)

im_inv_length

def im_inv_length(lhs: ImVec2Like, fail_value: float) -> float
inline float ImInvLength(const ImVec2& lhs, float fail_value);

(private API)

im_trunc

@overload
def im_trunc(f: float) -> float

@overload
def im_trunc(v: ImVec2Like) -> ImVec2
inline float ImTrunc(float f);
inline ImVec2 ImTrunc(const ImVec2& v);

(private API)

im_floor

@overload
def im_floor(f: float) -> float

@overload
def im_floor(v: ImVec2Like) -> ImVec2
inline float ImFloor(float f);
inline ImVec2 ImFloor(const ImVec2& v);

(private API)

Decent replacement for floorf()

im_trunc64

def im_trunc64(f: float) -> float
inline float ImTrunc64(float f);

(private API)

im_round64

def im_round64(f: float) -> float
inline float ImRound64(float f);

(private API)

FIXME: Positive values only.

im_ceil_fast

def im_ceil_fast(f: float) -> float
inline float ImCeilFast(float f);

(private API)

Consider using the the bit-hack version (search for “0x1p120f”).

im_mod_positive

def im_mod_positive(a: int, b: int) -> int
inline int ImModPositive(int a, int b);

(private API)

im_dot

def im_dot(a: ImVec2Like, b: ImVec2Like) -> float
inline float ImDot(const ImVec2& a, const ImVec2& b);

(private API)

im_rotate

def im_rotate(v: ImVec2Like, cos_a: float, sin_a: float) -> ImVec2
inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a);

(private API)

im_linear_sweep

def im_linear_sweep(current: float, target: float, speed: float) -> float
inline float ImLinearSweep(float current, float target, float speed);

(private API)

im_linear_remap_clamp

def im_linear_remap_clamp(s0: float, s1: float, d0: float, d1: float, x: float) -> float
inline float ImLinearRemapClamp(float s0, float s1, float d0, float d1, float x);

(private API)

im_mul

def im_mul(lhs: ImVec2Like, rhs: ImVec2Like) -> ImVec2
inline ImVec2 ImMul(const ImVec2& lhs, const ImVec2& rhs);

(private API)

im_is_float_above_guaranteed_integer_precision

def im_is_float_above_guaranteed_integer_precision(f: float) -> bool
inline bool ImIsFloatAboveGuaranteedIntegerPrecision(float f);

(private API)

im_exponential_moving_average

def im_exponential_moving_average(avg: float, sample: float, n: int) -> float
inline float ImExponentialMovingAverage(float avg, float sample, int n);

(private API)

Helpers: Geometry

im_bezier_cubic_calc

def im_bezier_cubic_calc(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, p4: ImVec2Like, t: float) -> ImVec2
IMGUI_API ImVec2 ImBezierCubicCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, float t);

im_bezier_cubic_closest_point

def im_bezier_cubic_closest_point(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, p4: ImVec2Like, p: ImVec2Like, num_segments: int) -> ImVec2
IMGUI_API ImVec2 ImBezierCubicClosestPoint(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, int num_segments);

For curves with explicit number of segments

im_bezier_cubic_closest_point_casteljau

def im_bezier_cubic_closest_point_casteljau(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, p4: ImVec2Like, p: ImVec2Like, max_error: float) -> ImVec2
IMGUI_API ImVec2 ImBezierCubicClosestPointCasteljau(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, const ImVec2& p, float max_error);

For auto-tessellated curves you can use max_error = style.CurveTessellationMaxError

im_bezier_quadratic_calc

def im_bezier_quadratic_calc(p1: ImVec2Like, p2: ImVec2Like, p3: ImVec2Like, t: float) -> ImVec2
IMGUI_API ImVec2 ImBezierQuadraticCalc(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, float t);

im_line_closest_point

def im_line_closest_point(a: ImVec2Like, b: ImVec2Like, p: ImVec2Like) -> ImVec2
IMGUI_API ImVec2 ImLineClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& p);

im_triangle_contains_point

def im_triangle_contains_point(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like, p: ImVec2Like) -> bool
IMGUI_API bool ImTriangleContainsPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);

im_triangle_closest_point

def im_triangle_closest_point(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like, p: ImVec2Like) -> ImVec2
IMGUI_API ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p);

im_triangle_barycentric_coords

def im_triangle_barycentric_coords(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like, p: ImVec2Like, out_u: float, out_v: float, out_w: float) -> Tuple[float, float, float]
IMGUI_API void ImTriangleBarycentricCoords(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& p, float& out_u, float& out_v, float& out_w);

im_triangle_area

def im_triangle_area(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like) -> float
inline float ImTriangleArea(const ImVec2& a, const ImVec2& b, const ImVec2& c);

(private API)

im_triangle_is_clockwise

def im_triangle_is_clockwise(a: ImVec2Like, b: ImVec2Like, c: ImVec2Like) -> bool
inline bool ImTriangleIsClockwise(const ImVec2& a, const ImVec2& b, const ImVec2& c);

(private API)

ImVec1 (class)

AttributeC++
x: floatfloat x;
ImVec1.__init__
@overload
def __init__(self) -> None

@overload
def __init__(self, _x: float) -> None
constexpr inline ImVec1() : x(0.0f);
constexpr inline ImVec1(float _x) : x(_x);

ImVec2i (class)

Helper: ImVec2i (2D vector, integer)

AttributeC++
x: intint x,
y: inty;
ImVec2i.__init__
@overload
def __init__(self) -> None

@overload
def __init__(self, _x: int, _y: int) -> None
constexpr inline ImVec2i() : x(0), y(0);
constexpr inline ImVec2i(int _x, int _y) : x(_x), y(_y);

ImVec2ih (class)

Helper: ImVec2ih (2D vector, half-size integer, for long-term packed storage)

AttributeC++
x: intshort x,
y: inty;
ImVec2ih.__init__
@overload
def __init__(self) -> None

@overload
def __init__(self, _x: int, _y: int) -> None

@overload
def __init__(self, rhs: ImVec2Like) -> None
constexpr inline ImVec2ih() : x(0), y(0);
constexpr inline ImVec2ih(short _x, short _y) : x(_x), y(_y);
constexpr inline explicit ImVec2ih(const ImVec2& rhs) : x((short)rhs.x), y((short)rhs.y);

ImRect (class)

Helper: ImRect (2D axis aligned bounding-box)
NB: we can’t rely on ImVec2 math operators being available here!

AttributeC++
min: ImVec2ImVec2 Min;Upper-left
max: ImVec2ImVec2 Max;Lower-right
ImRect.__init__
@overload
def __init__(self) -> None

@overload
def __init__(self, min: ImVec2Like, max: ImVec2Like) -> None

@overload
def __init__(self, v: ImVec4Like) -> None

@overload
def __init__(self, x1: float, y1: float, x2: float, y2: float) -> None
constexpr inline ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f);
constexpr inline ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max);
constexpr inline ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w);
constexpr inline ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2);
ImRect.get_center
def get_center(self) -> ImVec2
ImVec2 GetCenter() const;

(private API)

ImRect.get_size
def get_size(self) -> ImVec2
ImVec2 GetSize() const;

(private API)

ImRect.get_width
def get_width(self) -> float
float GetWidth() const;

(private API)

ImRect.get_height
def get_height(self) -> float
float GetHeight() const;

(private API)

ImRect.get_area
def get_area(self) -> float
float GetArea() const;

(private API)

ImRect.get_tl
def get_tl(self) -> ImVec2
ImVec2 GetTL() const;

(private API)

Top-left

ImRect.get_tr
def get_tr(self) -> ImVec2
ImVec2 GetTR() const;

(private API)

Top-right

ImRect.get_bl
def get_bl(self) -> ImVec2
ImVec2 GetBL() const;

(private API)

Bottom-left

ImRect.get_br
def get_br(self) -> ImVec2
ImVec2 GetBR() const;

(private API)

Bottom-right

ImRect.contains
@overload
def contains(self, p: ImVec2Like) -> bool

@overload
def contains(self, r: ImRect) -> bool
bool Contains(const ImVec2& p) const;
bool Contains(const ImRect& r) const;

(private API)

ImRect.contains_with_pad
def contains_with_pad(self, p: ImVec2Like, pad: ImVec2Like) -> bool
bool ContainsWithPad(const ImVec2& p, const ImVec2& pad) const;

(private API)

ImRect.overlaps
def overlaps(self, r: ImRect) -> bool
bool Overlaps(const ImRect& r) const;

(private API)

ImRect.add
@overload
def add(self, p: ImVec2Like) -> None

@overload
def add(self, r: ImRect) -> None
void Add(const ImVec2& p);
void Add(const ImRect& r);

(private API)

ImRect.add_x
def add_x(self, x: float) -> None
void AddX(float x);

(private API)

ImRect.add_y
def add_y(self, y: float) -> None
void AddY(float y);

(private API)

ImRect.expand
@overload
def expand(self, amount: float) -> None

@overload
def expand(self, amount: ImVec2Like) -> None
void Expand(const float amount);
void Expand(const ImVec2& amount);

(private API)

ImRect.translate
def translate(self, d: ImVec2Like) -> None
void Translate(const ImVec2& d);

(private API)

ImRect.translate_x
def translate_x(self, dx: float) -> None
void TranslateX(float dx);

(private API)

ImRect.translate_y
def translate_y(self, dy: float) -> None
void TranslateY(float dy);

(private API)

ImRect.clip_with
def clip_with(self, r: ImRect) -> None
void ClipWith(const ImRect& r);

(private API)

Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.

ImRect.clip_with_full
def clip_with_full(self, r: ImRect) -> None
void ClipWithFull(const ImRect& r);

(private API)

Full version, ensure both points are fully clipped.

ImRect.is_inverted
def is_inverted(self) -> bool
bool IsInverted() const;

(private API)

ImRect.to_vec4
def to_vec4(self) -> ImVec4
ImVec4 ToVec4() const;

(private API)

ImRect.as_vec4
def as_vec4(self) -> ImVec4
const ImVec4& AsVec4() const;

(private API)

Helper: ImBitArray

im_bit_array_get_storage_size_in_bytes

def im_bit_array_get_storage_size_in_bytes(bitcount: int) -> int
inline size_t ImBitArrayGetStorageSizeInBytes(int bitcount);

(private API)

im_bit_array_clear_all_bits

def im_bit_array_clear_all_bits(arr: ImU32, bitcount: int) -> None
inline void ImBitArrayClearAllBits(ImU32* arr, int bitcount);

(private API)

im_bit_array_test_bit

def im_bit_array_test_bit(arr: ImU32, n: int) -> bool
inline bool ImBitArrayTestBit(const ImU32* arr, int n);

(private API)

im_bit_array_clear_bit

def im_bit_array_clear_bit(arr: ImU32, n: int) -> None
inline void ImBitArrayClearBit(ImU32* arr, int n);

(private API)

im_bit_array_set_bit

def im_bit_array_set_bit(arr: ImU32, n: int) -> None
inline void ImBitArraySetBit(ImU32* arr, int n);

(private API)

im_bit_array_set_bit_range

def im_bit_array_set_bit_range(arr: ImU32, n: int, n2: int) -> None
inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on range [n..n2);

(private API)

// Works on range [n..n2)

ImBitVector (class)

Helper: ImBitVector
Store 1-bit per value.

AttributeC++
storage: ImVector_ImU32ImVector<ImU32> Storage;
ImBitVector.create
def create(self, sz: int) -> None
void Create(int sz);

(private API)

ImBitVector.clear
def clear(self) -> None
void Clear();

(private API)

ImBitVector.test_bit
def test_bit(self, n: int) -> bool
bool TestBit(int n) const;

(private API)

ImBitVector.set_bit
def set_bit(self, n: int) -> None
void SetBit(int n);

(private API)

ImBitVector.clear_bit
def clear_bit(self, n: int) -> None
void ClearBit(int n);

(private API)

ImBitVector.__init__
def __init__(self, storage: Optional[ImVector_ImU32] = None) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If Storage is None, then its default value will be: ImVector_ImU32()

TextIndex (class)

Helper: ImGuiTextIndex
Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API.

AttributeC++
offsets: ImVector_intImVector<int> Offsets;
end_offset: intint EndOffset = 0;Because we don’t own text buffer we need to maintain EndOffset (may bake in LineOffsets?)
TextIndex.clear
def clear(self) -> None
void clear();

(private API)

TextIndex.size
def size(self) -> int
int size();

(private API)

TextIndex.get_line_begin
def get_line_begin(self, base: str, n: int) -> str
const char* get_line_begin(const char* base, int n);

(private API)

TextIndex.get_line_end
def get_line_end(self, base: str, n: int) -> str
const char* get_line_end(const char* base, int n);

(private API)

TextIndex.append
def append(self, base: str, old_size: int, new_size: int) -> None
void append(const char* base, int old_size, int new_size);

(private API)

TextIndex.__init__
def __init__(self, offsets: Optional[ImVector_int] = None, end_offset: int = 0) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If Offsets is None, then its default value will be: ImVector_int()

PackedDate (class)

Helper: ImGuiPackedDate (sizeof() == 2)
Store a date in a way that is efficient to read/write in text form. If we stored e.g. number of days since Epoch we’d need costlier back and forth.
This is specifically designed to be able to prune old .ini data.

PackedDate.__init__
@overload
def __init__(self) -> None

@overload
def __init__(self, yyyymmdd: int) -> None
ImGuiPackedDate();
ImGuiPackedDate(int yyyymmdd);

Pack

PackedDate.is_valid
def is_valid(self) -> bool
bool IsValid();

(private API)

PackedDate.unpack
def unpack(self) -> int
int Unpack() const;

(private API)

Unpack

PackedDate.subtract_months
def subtract_months(self, m: int) -> None
void SubtractMonths(int m);

(private API)

FIXME-OPT: Stupid but enough for what we do with it.

im_lower_bound

def im_lower_bound(in_begin: StoragePair, in_end: StoragePair, key: ID) -> StoragePair
IMGUI_API ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key);

Helper: ImGuiStorage

ImDrawList support

ImDrawListSharedData (class)

Data shared between all ImDrawList instances
Conceptually this could have been called e.g. ImDrawListSharedContext
Typically one ImGui context would create and maintain one of this.
You may want to create your own instance of you try to ImDrawList completely without ImGui. In that case, watch out for future changes to this structure.

AttributeC++
tex_uv_white_pixel: ImVec2ImVec2 TexUvWhitePixel;UV of white pixel in the atlas (== FontAtlas->TexUvWhitePixel)
tex_uv_lines: ImVec4const ImVec4* TexUvLines;UV of anti-aliased lines in the atlas (== FontAtlas->TexUvLines) # (const)
font_atlas: ImFontAtlasImFontAtlas* FontAtlas;Current font atlas
font: ImFontImFont* Font;Current font (used for simplified AddText overload)
font_size: floatfloat FontSize;Current font size (used for for simplified AddText overload)
font_scale: floatfloat FontScale;Current font scale (== FontSize / Font->FontSize)
curve_tessellation_max_error: floatfloat CurveTessellationMaxError;Tessellation tolerance when using PathBezierCurveTo()
circle_tessellation_max_error: floatfloat CircleTessellationMaxError;Number of circle segments to use per pixel of radius for AddCircle() etc
initial_flags: ImDrawListFlagsImDrawListFlags InitialFlags;Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
clip_rect_fullscreen: ImVec4ImVec4 ClipRectFullscreen;Value for PushClipRectFullscreen()
temp_buffer: ImVector_ImVec2ImVector<ImVec2> TempBuffer;Temporary write buffer
draw_lists: ImVector_ImDrawList_ptrImVector<ImDrawList*> DrawLists;All draw lists associated to this ImDrawListSharedData
context: ContextImGuiContext* Context;[OPTIONAL] Link to Dear ImGui context. 99% of ImDrawList/ImFontAtlas can function without an ImGui context, but this facilitate handling one legacy edge case.
arc_fast_radius_cutoff: floatfloat ArcFastRadiusCutoff;Cutoff radius after which arc drawing will fallback to slower PathArcTo()
circle_segment_counts: np.ndarrayImU8 CircleSegmentCounts[64];ndarray[type=ImU8, size=64] # Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead)
ImDrawListSharedData.__init__
def __init__(self) -> None
ImDrawListSharedData();
ImDrawListSharedData.set_circle_tessellation_max_error
def set_circle_tessellation_max_error(self, max_error: float) -> None
void SetCircleTessellationMaxError(float max_error);

(private API)

ImDrawDataBuilder (class)

AttributeC++
layer_data1: ImVector_ImDrawList_ptrImVector<ImDrawList*> LayerData1;
ImDrawDataBuilder.__init__
def __init__(self) -> None
ImDrawDataBuilder();

ImFontStackData (class)

AttributeC++
font: ImFontImFont* Font;
font_size_before_scaling: floatfloat FontSizeBeforeScaling;~~ style.FontSizeBase
font_size_after_scaling: floatfloat FontSizeAfterScaling;~~ g.FontSize
ImFontStackData.__init__
def __init__(self, font_size_before_scaling: float = float(), font_size_after_scaling: float = float()) -> None

Auto-generated default constructor with named params

Style support

StyleVarInfo (class)

StyleVarInfo.get_var_ptr
def get_var_ptr(self, parent: Any) -> Any
void* GetVarPtr(void* parent) const;

(private API)

StyleVarInfo.__init__
def __init__(self) -> None

Auto-generated default constructor

ColorMod (class)

Stacked color modifier, backup of modified data so we can restore it

AttributeC++
col: ColImGuiCol Col;
backup_value: ImVec4ImVec4 BackupValue;
ColorMod.__init__
def __init__(self, col: Optional[Col] = None, backup_value: Optional[ImVec4Like] = None) -> None

Auto-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: * Col: Col() * BackupValue: ImVec4()

StyleMod (class)

Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.

AttributeC++
var_idx: StyleVarImGuiStyleVar VarIdx;
StyleMod.__init__
@overload
def __init__(self, idx: StyleVar, v: int) -> None

@overload
def __init__(self, idx: StyleVar, v: float) -> None

@overload
def __init__(self, idx: StyleVar, v: ImVec2Like) -> None
ImGuiStyleMod(ImGuiStyleVar idx, int v);
ImGuiStyleMod(ImGuiStyleVar idx, float v);
ImGuiStyleMod(ImGuiStyleVar idx, ImVec2 v);

Data types support

DataTypeStorage (class)

AttributeC++
data: np.ndarrayImU8 Data[8];ndarray[type=ImU8, size=8] # Opaque storage to fit any data up to ImGuiDataType_COUNT
DataTypeStorage.__init__
def __init__(self) -> None

Auto-generated default constructor

DataTypeInfo (class)

Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().

AttributeC++
size: intsize_t Size;Size in bytes
name: strconst char* Name;Short descriptive name for the type, for debugging # (const)
print_fmt: strconst char* PrintFmt;Default printf format for the type # (const)
scan_fmt: strconst char* ScanFmt;Default scanf format for the type # (const)
DataTypeInfo.__init__
def __init__(self, size: int = int()) -> None

Auto-generated default constructor with named params

DataTypePrivate_ (enum)

Extend ImGuiDataType_

MemberValueC++
pointerDataType_COUNTImGuiDataType_Pointer = ImGuiDataType_COUNT
id_ImGuiDataType_ID, }

Widgets support: flags, enums, data structures

ItemFlagsPrivate_ (enum)

Extend ImGuiItemFlags

MemberValueC++
read_only1 << 11ImGuiItemFlags_ReadOnly = 1 << 11False // [ALPHA] Allow hovering interactions but underlying value is not changed.
no_window_hoverable_check1 << 13ImGuiItemFlags_NoWindowHoverableCheck = 1 << 13False // Disable hoverable check in ItemHoverable()
allow_overlap1 << 14ImGuiItemFlags_AllowOverlap = 1 << 14False // Allow being overlapped by another widget. Not-hovered to Hovered transition deferred by a frame.
no_nav_disable_mouse_hover1 << 15ImGuiItemFlags_NoNavDisableMouseHover = 1 << 15False // Nav keyboard/gamepad mode doesn’t disable hover highlight (behave as if NavHighlightItemUnderNav==False).
no_mark_edited1 << 16ImGuiItemFlags_NoMarkEdited = 1 << 16False // Skip calling MarkItemEdited()
no_focus1 << 17ImGuiItemFlags_NoFocus = 1 << 17False // [EXPERIMENTAL: Not very well specced] Clicking doesn’t take focus. Automatically sets ImGuiButtonFlags_NoFocus + ImGuiButtonFlags_NoNavFocus in ButtonBehavior().
inputable1 << 20ImGuiItemFlags_Inputable = 1 << 20False // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
has_selection_user_data1 << 21ImGuiItemFlags_HasSelectionUserData = 1 << 21False // Set by SetNextItemSelectionUserData()
is_multi_select1 << 22ImGuiItemFlags_IsMultiSelect = 1 << 22False // Set by SetNextItemSelectionUserData()
default_ItemFlags_AutoClosePopups | ItemFlags_LiveEditOnInputTextImGuiItemFlags_Default_ = ImGuiItemFlags_AutoClosePopups | ImGuiItemFlags_LiveEditOnInputTextPlease don’t change, use PushItemFlag() instead.

Obsolete

ImGuiItemFlags_SelectableDontClosePopup = !ImGuiItemFlags_AutoClosePopups, // Can’t have a redirect as we inverted the behavior

ItemStatusFlags_ (enum)

Status flags for an already submitted item

MemberValueC++
none0ImGuiItemStatusFlags_None = 0
hovered_rect1 << 0ImGuiItemStatusFlags_HoveredRect = 1 << 0Mouse position is within item rectangle (does NOT mean that the window is in correct z-order and can be hovered!, this is only one part of the most-common IsItemHovered test)
has_display_rect1 << 1ImGuiItemStatusFlags_HasDisplayRect = 1 << 1g.LastItemData.DisplayRect is valid
edited1 << 2ImGuiItemStatusFlags_Edited = 1 << 2Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
toggled_selection1 << 3ImGuiItemStatusFlags_ToggledSelection = 1 << 3Set when Selectable(), TreeNode() reports toggling a selection. We can’t report “Selected”, only state changes, in order to easily handle clipping with less issues.
toggled_open1 << 4ImGuiItemStatusFlags_ToggledOpen = 1 << 4Set when TreeNode() reports toggling their open state.
has_deactivated1 << 5ImGuiItemStatusFlags_HasDeactivated = 1 << 5Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
deactivated1 << 6ImGuiItemStatusFlags_Deactivated = 1 << 6Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
hovered_window1 << 7ImGuiItemStatusFlags_HoveredWindow = 1 << 7Override the HoveredWindow test to allow cross-window hover testing.
visible1 << 8ImGuiItemStatusFlags_Visible = 1 << 8[WIP] Set when item is overlapping the current clipping rectangle (Used internally. Please don’t use yet: API/system will change as we refactor Itemadd()).
has_clip_rect1 << 9ImGuiItemStatusFlags_HasClipRect = 1 << 9g.LastItemData.ClipRect is valid.
has_shortcut1 << 10ImGuiItemStatusFlags_HasShortcut = 1 << 10g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
edited_internal1 << 11ImGuiItemStatusFlags_EditedInternal = 1 << 11Similar to ImGuiItemStatusFlags_Edited but bypassing ImGuiItemFlags_NoMarkEdited.

Additional status + semantic for ImGuiTestEngine

HoveredFlagsPrivate_ (enum)

Extend ImGuiHoveredFlags_

MemberValueC++
delay_mask_HoveredFlags_DelayNone | HoveredFlags_DelayShort | HoveredFlags_DelayNormal | HoveredFlags_NoSharedDelayImGuiHoveredFlags_DelayMask_ = ImGuiHoveredFlags_DelayNone | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_NoSharedDelay
allowed_mask_for_is_window_hoveredHoveredFlags_ChildWindows | HoveredFlags_RootWindow | HoveredFlags_AnyWindow | HoveredFlags_NoPopupHierarchy | HoveredFlags_DockHierarchy | HoveredFlags_AllowWhenBlockedByPopup | HoveredFlags_AllowWhenBlockedByActiveItem | HoveredFlags_ForTooltip | HoveredFlags_StationaryImGuiHoveredFlags_AllowedMaskForIsWindowHovered = ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_NoPopupHierarchy | ImGuiHoveredFlags_DockHierarchy | ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary
allowed_mask_for_is_item_hoveredHoveredFlags_AllowWhenBlockedByPopup | HoveredFlags_AllowWhenBlockedByActiveItem | HoveredFlags_AllowWhenOverlapped | HoveredFlags_AllowWhenDisabled | HoveredFlags_NoNavOverride | HoveredFlags_ForTooltip | HoveredFlags_Stationary | HoveredFlags_DelayMask_ImGuiHoveredFlags_AllowedMaskForIsItemHovered = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_NoNavOverride | ImGuiHoveredFlags_ForTooltip | ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayMask_, }

InputTextFlagsPrivate_ (enum)

Extend ImGuiInputTextFlags_

MemberValueC++
multiline1 << 26ImGuiInputTextFlags_Multiline = 1 << 26For internal use by InputTextMultiline()
temp_input1 << 27ImGuiInputTextFlags_TempInput = 1 << 27For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
localize_decimal_point1 << 28ImGuiInputTextFlags_LocalizeDecimalPoint= 1 << 28For internal use by InputScalar() and TempInputScalar()

ButtonFlagsPrivate_ (enum)

Extend ImGuiButtonFlags_

MemberValueC++
pressed_on_click1 << 4ImGuiButtonFlags_PressedOnClick = 1 << 4return True on click (mouse down event)
pressed_on_click_release1 << 5ImGuiButtonFlags_PressedOnClickRelease = 1 << 5[Default] return True on click + release on same item <-- this is what the majority of Button are using
pressed_on_click_release_anywhere1 << 6ImGuiButtonFlags_PressedOnClickReleaseAnywhere = 1 << 6return True on click + release even if the release event is not done while hovering the item
pressed_on_release1 << 7ImGuiButtonFlags_PressedOnRelease = 1 << 7return True on release (default requires click+release). Prior to 2026/03/20 this implied ImGuiButtonFlags_NoHoldingActiveId but they are separate now.
pressed_on_double_click1 << 8ImGuiButtonFlags_PressedOnDoubleClick = 1 << 8return True on double-click (default requires click+release)
pressed_on_drag_drop_hold1 << 9ImGuiButtonFlags_PressedOnDragDropHold = 1 << 9return True when held into while we are drag and dropping another item (used by e.g. tree nodes, collapsing headers)
flatten_children1 << 11ImGuiButtonFlags_FlattenChildren = 1 << 11allow interactions even if a child window is overlapping
align_text_base_line1 << 15ImGuiButtonFlags_AlignTextBaseLine = 1 << 15vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
no_key_mods_allowed1 << 16ImGuiButtonFlags_NoKeyModsAllowed = 1 << 16disable mouse interaction if a key modifier is held
no_holding_active_id1 << 17ImGuiButtonFlags_NoHoldingActiveId = 1 << 17don’t set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
no_nav_focus1 << 18ImGuiButtonFlags_NoNavFocus = 1 << 18don’t override navigation focus when activated (FIXME: this is essentially used every time an item uses ImGuiItemFlags_NoNav, but because legacy specs don’t requires LastItemData to be set ButtonBehavior(), we can’t poll g.LastItemData.ItemFlags)
no_hovered_on_focus1 << 19ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19don’t report as hovered when nav focus is on this item
no_set_key_owner1 << 20ImGuiButtonFlags_NoSetKeyOwner = 1 << 20don’t set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
no_test_key_owner1 << 21ImGuiButtonFlags_NoTestKeyOwner = 1 << 21don’t test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
no_focus1 << 22ImGuiButtonFlags_NoFocus = 1 << 22[EXPERIMENTAL: Not very well specced]. Don’t focus parent window when clicking.
pressed_on_mask_ButtonFlags_PressedOnClick | ButtonFlags_PressedOnClickRelease | ButtonFlags_PressedOnClickReleaseAnywhere | ButtonFlags_PressedOnRelease | ButtonFlags_PressedOnDoubleClick | ButtonFlags_PressedOnDragDropHoldImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold
pressed_on_default_ButtonFlags_PressedOnClickReleaseImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease

SliderFlagsPrivate_ (enum)

Extend ImGuiSliderFlags_

MemberValueC++
vertical1 << 20ImGuiSliderFlags_Vertical = 1 << 20Should this slider be orientated vertically?
read_only1 << 21ImGuiSliderFlags_ReadOnly = 1 << 21Consider using g.NextItemData.ItemFlags |= ImGuiItemFlags_ReadOnly instead.

SelectableFlagsPrivate_ (enum)

Extend ImGuiSelectableFlags_

MemberValueC++
no_holding_active_id1 << 20ImGuiSelectableFlags_NoHoldingActiveID = 1 << 20
select_on_click1 << 22ImGuiSelectableFlags_SelectOnClick = 1 << 22Override button behavior to react on Click (default is Click+Release)
select_on_release1 << 23ImGuiSelectableFlags_SelectOnRelease = 1 << 23Override button behavior to react on Release (default is Click+Release)
span_avail_width1 << 24ImGuiSelectableFlags_SpanAvailWidth = 1 << 24Span all avail width even if we declared less for layout purpose. FIXME: We may be able to remove this (added in 6251d379, 2bcafc86 for menus)
set_nav_id_on_hover1 << 25ImGuiSelectableFlags_SetNavIdOnHover = 1 << 25Set Nav/Focus ID on mouse hover (used by MenuItem)
no_pad_with_half_spacing1 << 26ImGuiSelectableFlags_NoPadWithHalfSpacing = 1 << 26Disable padding each side with ItemSpacing * 0.5
no_set_key_owner1 << 27ImGuiSelectableFlags_NoSetKeyOwner = 1 << 27Don’t set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)

TreeNodeFlagsPrivate_ (enum)

Extend ImGuiTreeNodeFlags_

MemberValueC++
no_nav_focus1 << 27ImGuiTreeNodeFlags_NoNavFocus = 1 << 27Don’t claim nav focus when interacting with this item (#8551)
clip_label_for_trailing_button1 << 28ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 28FIXME-WIP: Hard-coded for CollapsingHeader()
upside_down_arrow1 << 29ImGuiTreeNodeFlags_UpsideDownArrow = 1 << 29FIXME-WIP: Turn Down arrow into an Up arrow, for reversed trees (#6517)
open_on_mask_TreeNodeFlags_OpenOnDoubleClick | TreeNodeFlags_OpenOnArrowImGuiTreeNodeFlags_OpenOnMask_ = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow
draw_lines_mask_TreeNodeFlags_DrawLinesNone | TreeNodeFlags_DrawLinesFull | TreeNodeFlags_DrawLinesToNodesImGuiTreeNodeFlags_DrawLinesMask_ = ImGuiTreeNodeFlags_DrawLinesNone | ImGuiTreeNodeFlags_DrawLinesFull | ImGuiTreeNodeFlags_DrawLinesToNodes, }

SeparatorFlags_ (enum)

MemberValueC++
none0ImGuiSeparatorFlags_None = 0
horizontal1 << 0ImGuiSeparatorFlags_Horizontal = 1 << 0Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
vertical1 << 1ImGuiSeparatorFlags_Vertical = 1 << 1
span_all_columns1 << 2ImGuiSeparatorFlags_SpanAllColumns = 1 << 2Make separator cover all columns of a legacy Columns() set.

FocusRequestFlags_ (enum)

Flags for FocusWindow(). This is not called ImGuiFocusFlags to avoid confusion with public-facing ImGuiFocusedFlags.
FIXME: Once we finishing replacing more uses of GetTopMostPopupModal()+IsWindowWithinBeginStackOf() and FindBlockingModal() with this, we may want to change the flag to be opt-out instead of opt-in.

MemberValueC++
none0ImGuiFocusRequestFlags_None = 0
restore_focused_child1 << 0ImGuiFocusRequestFlags_RestoreFocusedChild = 1 << 0Find last focused child (if any) and focus it instead.
unless_below_modal1 << 1ImGuiFocusRequestFlags_UnlessBelowModal = 1 << 1Do not set focus if the window is below a modal.

TextFlags_ (enum)

MemberValueC++
none0ImGuiTextFlags_None = 0
no_width_for_large_clipped_text1 << 0ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0, }

TooltipFlags_ (enum)

MemberValueC++
none0ImGuiTooltipFlags_None = 0
override_previous1 << 1ImGuiTooltipFlags_OverridePrevious = 1 << 1Clear/ignore previously submitted tooltip (defaults to append)

LayoutType_ (enum)

FIXME: this is in development, not exposed/functional as a generic feature yet.
Horizontal/Vertical enums are fixed to 0/1 so they may be used to index ImVec2

MemberValueC++
horizontal0ImGuiLayoutType_Horizontal = 0
vertical1ImGuiLayoutType_Vertical = 1

LogFlags_ (enum)

Flags for LogBegin() text capturing function

MemberValueC++
none0ImGuiLogFlags_None = 0
output_tty1 << 0ImGuiLogFlags_OutputTTY = 1 << 0
output_file1 << 1ImGuiLogFlags_OutputFile = 1 << 1
output_buffer1 << 2ImGuiLogFlags_OutputBuffer = 1 << 2
output_clipboard1 << 3ImGuiLogFlags_OutputClipboard = 1 << 3
output_mask_LogFlags_OutputTTY | LogFlags_OutputFile | LogFlags_OutputBuffer | LogFlags_OutputClipboardImGuiLogFlags_OutputMask_ = ImGuiLogFlags_OutputTTY | ImGuiLogFlags_OutputFile | ImGuiLogFlags_OutputBuffer | ImGuiLogFlags_OutputClipboard, }

Axis (enum)

X/Y enums are fixed to 0/1 so they may be used to index ImVec2

MemberValueC++
none-1ImGuiAxis_None = -1
x0ImGuiAxis_X = 0
y1ImGuiAxis_Y = 1

PlotType (enum)

MemberValueC++
lines0ImGuiPlotType_Lines
histogram1ImGuiPlotType_Histogram, }

ComboPreviewData (class)

Storage data for BeginComboPreview()/EndComboPreview()

AttributeC++
preview_rect: ImRectImRect PreviewRect;
backup_cursor_pos: ImVec2ImVec2 BackupCursorPos;
backup_cursor_max_pos: ImVec2ImVec2 BackupCursorMaxPos;
backup_cursor_pos_prev_line: ImVec2ImVec2 BackupCursorPosPrevLine;
backup_prev_line_text_base_offset: floatfloat BackupPrevLineTextBaseOffset;
backup_work_rect_max_x: floatfloat BackupWorkRectMaxX;
backup_content_rect_max_x: floatfloat BackupContentRectMaxX;
ComboPreviewData.__init__
def __init__(self) -> None
ImGuiComboPreviewData();

GroupData (class)

Stacked storage data for BeginGroup()/EndGroup()

AttributeC++
window_id: IDImGuiID WindowID;
backup_cursor_pos: ImVec2ImVec2 BackupCursorPos;
backup_cursor_max_pos: ImVec2ImVec2 BackupCursorMaxPos;
backup_cursor_pos_prev_line: ImVec2ImVec2 BackupCursorPosPrevLine;
backup_indent: ImVec1ImVec1 BackupIndent;
backup_group_offset: ImVec1ImVec1 BackupGroupOffset;
backup_curr_line_size: ImVec2ImVec2 BackupCurrLineSize;
backup_curr_line_text_base_offset: floatfloat BackupCurrLineTextBaseOffset;
backup_active_id_is_alive: IDImGuiID BackupActiveIdIsAlive;
backup_any_id_has_been_edited_this_frame: boolbool BackupAnyIdHasBeenEditedThisFrame;
backup_deactivated_id_is_alive: boolbool BackupDeactivatedIdIsAlive;
backup_hovered_id_is_alive: boolbool BackupHoveredIdIsAlive;
backup_is_same_line: boolbool BackupIsSameLine;
emit_item: boolbool EmitItem;
GroupData.__init__
def __init__(self, window_id: ID = ID(), backup_cursor_pos: Optional[ImVec2Like] = None, backup_cursor_max_pos: Optional[ImVec2Like] = None, backup_cursor_pos_prev_line: Optional[ImVec2Like] = None, backup_indent: Optional[ImVec1] = None, backup_group_offset: Optional[ImVec1] = None, backup_curr_line_size: Optional[ImVec2Like] = None, backup_curr_line_text_base_offset: float = float(), backup_active_id_is_alive: ID = ID(), backup_any_id_has_been_edited_this_frame: bool = bool(), backup_deactivated_id_is_alive: bool = bool(), backup_hovered_id_is_alive: bool = bool(), backup_is_same_line: bool = bool(), emit_item: bool = bool()) -> None

Auto-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: * BackupCursorPos: ImVec2() * BackupCursorMaxPos: ImVec2() * BackupCursorPosPrevLine: ImVec2() * BackupIndent: ImVec1() * BackupGroupOffset: ImVec1() * BackupCurrLineSize: ImVec2()

MenuColumns (class)

Simple column measurement, currently used for MenuItem() only.. This is very short-sighted/throw-away code and NOT a generic helper.

AttributeC++
total_width: ImU32ImU32 TotalWidth;
next_total_width: ImU32ImU32 NextTotalWidth;
spacing: ImU16ImU16 Spacing;
offset_icon: ImU16ImU16 OffsetIcon;Always zero for now
offset_label: ImU16ImU16 OffsetLabel;Offsets are locked in Update()
offset_shortcut: ImU16ImU16 OffsetShortcut;
offset_mark: ImU16ImU16 OffsetMark;
widths: np.ndarrayImU16 Widths[4];ndarray[type=ImU16, size=4] # Width of: Icon, Label, Shortcut, Mark (accumulators for current frame)
MenuColumns.__init__
def __init__(self) -> None
ImGuiMenuColumns();
MenuColumns.update
def update(self, spacing: float, window_reappearing: bool) -> None
void Update(float spacing, bool window_reappearing);

(private API)

MenuColumns.decl_columns
def decl_columns(self, w_icon: float, w_label: float, w_shortcut: float, w_mark: float) -> float
float DeclColumns(float w_icon, float w_label, float w_shortcut, float w_mark);

(private API)

MenuColumns.calc_next_total_width
def calc_next_total_width(self, update_offsets: bool) -> None
void CalcNextTotalWidth(bool update_offsets);

(private API)

InputTextDeactivatedState (class)

Internal temporary state for deactivating InputText() instances.
Store as part of ImGuiDeactivatedItemData?

AttributeC++
id_: IDImGuiID ID;widget id owning the text state (which just got deactivated)
elapse_frame: intint ElapseFrame;
text_a: ImVector_charImVector<char> TextA;text buffer
InputTextDeactivatedState.__init__
def __init__(self) -> None
ImGuiInputTextDeactivatedState();
InputTextDeactivatedState.clear_free_memory
def clear_free_memory(self) -> None
void ClearFreeMemory();

(private API)

InputTextState (class)

Internal state of the currently focused/edited text input box
For a given item ID, access with ImGui::GetInputTextState()

AttributeC++
ctx: ContextImGuiContext* Ctx;parent UI context (needs to be set explicitly by parent).
flags: InputTextFlagsImGuiInputTextFlags Flags;copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
id_: IDImGuiID ID;widget id owning the text state
text_len: intint TextLen;UTF-8 length of the string in TextA (in bytes)
text_src: strconst char* TextSrc;== TextA.Data unless read-only, in which case == buf passed to InputText(). For _ReadOnly fields, pointer will be null outside the InputText() call. # (const)
text_a: ImVector_charImVector<char> TextA;main UTF8 buffer. TextA.Size is a buffer size! Should always be >= buf_size passed by user (and of course >= CurLenA + 1).
text_to_revert_to: ImVector_charImVector<char> TextToRevertTo;value to revert to when pressing Escape = backup of end-user buffer at the time of focus (in UTF-8, unaltered)
callback_text_backup: ImVector_charImVector<char> CallbackTextBackup;temporary storage for callback to support automatic reconcile of undo-stack
buf_capacity: intint BufCapacity;end-user buffer capacity (include zero terminator)
scroll: ImVec2ImVec2 Scroll;horizontal offset (managed manually) + vertical scrolling (pulled from child window’s own Scroll.y)
line_count: intint LineCount;last line count (solely for debugging)
wrap_width: floatfloat WrapWidth;word-wrapping width
cursor_anim: floatfloat CursorAnim;timer for cursor blink, reset on every user action so the cursor reappears immediately
cursor_follow: boolbool CursorFollow;set when we want scrolling to follow the current cursor position (not always!)
cursor_center_y: boolbool CursorCenterY;set when we want scrolling to be centered over the cursor position (while resizing a word-wrapping field)
selected_all_mouse_lock: boolbool SelectedAllMouseLock;after a double-click to select all, we ignore further mouse drags to update selection
edited_before: boolbool EditedBefore;edited since activated
edited_this_frame: boolbool EditedThisFrame;edited this frame
validated_this_frame: boolbool ValidatedThisFrame;
want_reload_user_buf: boolbool WantReloadUserBuf;force a reload of user buf so it may be modified externally. may be automatic in future version.
last_move_direction_lr: ImS8ImS8 LastMoveDirectionLR;ImGuiDir_Left or ImGuiDir_Right. track last movement direction so when cursor cross over a word-wrapping boundaries we can display it on either line depending on last move.s
reload_selection_start: intint ReloadSelectionStart;
reload_selection_end: intint ReloadSelectionEnd;
InputTextState.__init__
def __init__(self) -> None
ImGuiInputTextState();
InputTextState.clear_text
def clear_text(self) -> None
void ClearText();

(private API)

InputTextState.clear_free_memory
def clear_free_memory(self) -> None
void ClearFreeMemory();

(private API)

InputTextState.on_key_pressed
def on_key_pressed(self, key: int) -> None
void OnKeyPressed(int key);

(private API)

Cannot be inline because we call in code in stb_textedit.h implementation

InputTextState.on_char_pressed
def on_char_pressed(self, c: int) -> None
void OnCharPressed(unsigned int c);

(private API)

InputTextState.get_preferred_offset_x
def get_preferred_offset_x(self) -> float
float GetPreferredOffsetX() const;

(private API)

InputTextState.get_text
def get_text(self) -> str
const char* GetText();

(private API)

InputTextState.cursor_anim_reset
def cursor_anim_reset(self) -> None
void CursorAnimReset();

(private API)

InputTextState.cursor_clamp
def cursor_clamp(self) -> None
void CursorClamp();

(private API)

InputTextState.has_selection
def has_selection(self) -> bool
bool HasSelection() const;

(private API)

InputTextState.clear_selection
def clear_selection(self) -> None
void ClearSelection();

(private API)

InputTextState.get_cursor_pos
def get_cursor_pos(self) -> int
int GetCursorPos() const;

(private API)

InputTextState.get_selection_start
def get_selection_start(self) -> int
int GetSelectionStart() const;

(private API)

InputTextState.get_selection_end
def get_selection_end(self) -> int
int GetSelectionEnd() const;

(private API)

InputTextState.set_selection
def set_selection(self, start: int, end: int) -> None
void SetSelection(int start, int end);

(private API)

InputTextState.select_all
def select_all(self) -> None
void SelectAll();

(private API)

InputTextState.reload_user_buf_and_select_all
def reload_user_buf_and_select_all(self) -> None
void ReloadUserBufAndSelectAll();

(private API)

InputTextState.reload_user_buf_and_keep_selection
def reload_user_buf_and_keep_selection(self) -> None
void ReloadUserBufAndKeepSelection();

(private API)

InputTextState.reload_user_buf_and_move_to_end
def reload_user_buf_and_move_to_end(self) -> None
void ReloadUserBufAndMoveToEnd();

(private API)

WindowRefreshFlags_ (enum)

MemberValueC++
none0ImGuiWindowRefreshFlags_None = 0
try_to_avoid_refresh1 << 0ImGuiWindowRefreshFlags_TryToAvoidRefresh = 1 << 0[EXPERIMENTAL] Try to keep existing contents, USER MUST NOT HONOR BEGIN() RETURNING FALSE AND NOT APPEND.
refresh_on_hover1 << 1ImGuiWindowRefreshFlags_RefreshOnHover = 1 << 1[EXPERIMENTAL] Always refresh on hover
refresh_on_focus1 << 2ImGuiWindowRefreshFlags_RefreshOnFocus = 1 << 2[EXPERIMENTAL] Always refresh on focus

WindowBgClickFlags_ (enum)

MemberValueC++
none0ImGuiWindowBgClickFlags_None = 0
move1 << 0ImGuiWindowBgClickFlags_Move = 1 << 0Click on bg/None + drag to move window. Cleared by default when using io.ConfigWindowsMoveFromTitleBarOnly.

NextWindowDataFlags_ (enum)

MemberValueC++
none0ImGuiNextWindowDataFlags_None = 0
has_pos1 << 0ImGuiNextWindowDataFlags_HasPos = 1 << 0
has_size1 << 1ImGuiNextWindowDataFlags_HasSize = 1 << 1
has_content_size1 << 2ImGuiNextWindowDataFlags_HasContentSize = 1 << 2
has_collapsed1 << 3ImGuiNextWindowDataFlags_HasCollapsed = 1 << 3
has_size_constraint1 << 4ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4
has_focus1 << 5ImGuiNextWindowDataFlags_HasFocus = 1 << 5
has_bg_alpha1 << 6ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6
has_scroll1 << 7ImGuiNextWindowDataFlags_HasScroll = 1 << 7
has_window_flags1 << 8ImGuiNextWindowDataFlags_HasWindowFlags = 1 << 8
has_child_flags1 << 9ImGuiNextWindowDataFlags_HasChildFlags = 1 << 9
has_refresh_policy1 << 10ImGuiNextWindowDataFlags_HasRefreshPolicy = 1 << 10
has_viewport1 << 11ImGuiNextWindowDataFlags_HasViewport = 1 << 11
has_dock1 << 12ImGuiNextWindowDataFlags_HasDock = 1 << 12
has_window_class1 << 13ImGuiNextWindowDataFlags_HasWindowClass = 1 << 13, }

NextWindowData (class)

Storage for SetNexWindow** functions

AttributeC++
has_flags: NextWindowDataFlagsImGuiNextWindowDataFlags HasFlags;
pos_cond: CondImGuiCond PosCond;
size_cond: CondImGuiCond SizeCond;
collapsed_cond: CondImGuiCond CollapsedCond;
dock_cond: CondImGuiCond DockCond;
pos_val: ImVec2ImVec2 PosVal;
pos_pivot_val: ImVec2ImVec2 PosPivotVal;
size_val: ImVec2ImVec2 SizeVal;
content_size_val: ImVec2ImVec2 ContentSizeVal;
scroll_val: ImVec2ImVec2 ScrollVal;
window_flags_set: WindowFlagsImGuiWindowFlags WindowFlagsSet;Flags to set. Use SetNextWindowFlags()!
window_flags_clear: WindowFlagsImGuiWindowFlags WindowFlagsClear;
child_flags_set: ChildFlagsImGuiChildFlags ChildFlagsSet;Flags to set. Use SetNextWindowChildFlags().
child_flags_clear: ChildFlagsImGuiChildFlags ChildFlagsClear;
pos_undock: boolbool PosUndock;
collapsed_val: boolbool CollapsedVal;
size_constraint_rect: ImRectImRect SizeConstraintRect;
size_callback: SizeCallbackImGuiSizeCallback SizeCallback;
size_callback_user_data: Anyvoid* SizeCallbackUserData;
bg_alpha_val: floatfloat BgAlphaVal;Override background alpha
viewport_id: IDImGuiID ViewportId;
dock_id: IDImGuiID DockId;
window_class: WindowClassImGuiWindowClass WindowClass;
menu_bar_offset_min_val: ImVec2ImVec2 MenuBarOffsetMinVal;(Always on) This is not exposed publicly, so we don’t clear it and it doesn’t have a corresponding flag (could we? for consistency?)
refresh_flags_val: WindowRefreshFlagsImGuiWindowRefreshFlags RefreshFlagsVal;
NextWindowData.__init__
def __init__(self) -> None
ImGuiNextWindowData();
NextWindowData.clear_flags
def clear_flags(self) -> None
inline void ClearFlags();

(private API)

NextItemDataFlags_ (enum)

MemberValueC++
none0ImGuiNextItemDataFlags_None = 0
has_width1 << 0ImGuiNextItemDataFlags_HasWidth = 1 << 0
has_open1 << 1ImGuiNextItemDataFlags_HasOpen = 1 << 1
has_shortcut1 << 2ImGuiNextItemDataFlags_HasShortcut = 1 << 2
has_ref_val1 << 3ImGuiNextItemDataFlags_HasRefVal = 1 << 3
has_storage_id1 << 4ImGuiNextItemDataFlags_HasStorageID = 1 << 4
has_color_marker1 << 5ImGuiNextItemDataFlags_HasColorMarker = 1 << 5, }

NextItemData (class)

AttributeC++
has_flags: NextItemDataFlagsImGuiNextItemDataFlags HasFlags;Called HasFlags instead of Flags to avoid mistaking this
item_flags_set: ItemFlagsImGuiItemFlags ItemFlagsSet;Currently only tested/used for ImGuiItemFlags_AllowOverlap and ImGuiItemFlags_HasSelectionUserData.
focus_scope_id: IDImGuiID FocusScopeId;Set by SetNextItemSelectionUserData()
selection_user_data: SelectionUserDataImGuiSelectionUserData SelectionUserData;Set by SetNextItemSelectionUserData() (note that None/0 is a valid value, we use -1 == ImGuiSelectionUserData_Invalid to mark invalid values)
width: floatfloat Width;Set by SetNextItemWidth()
shortcut: KeyChordImGuiKeyChord Shortcut;Set by SetNextItemShortcut()
shortcut_flags: InputFlagsImGuiInputFlags ShortcutFlags;Set by SetNextItemShortcut()
open_val: boolbool OpenVal;Set by SetNextItemOpen()
open_cond: ImU8ImU8 OpenCond;Set by SetNextItemOpen()
ref_val: DataTypeStorageImGuiDataTypeStorage RefVal;Not exposed yet, for ImGuiInputTextFlags_ParseEmptyAsRefVal
storage_id: IDImGuiID StorageId;Set by SetNextItemStorageID()
color_marker: ImU32ImU32 ColorMarker;Set by SetNextItemColorMarker(). Not exposed yet, supported by DragScalar,SliderScalar and for ImGuiSliderFlags_ColorMarkers.
NextItemData.__init__
def __init__(self) -> None
ImGuiNextItemData();
NextItemData.clear_flags
def clear_flags(self) -> None
inline void ClearFlags();

(private API)

Also cleared manually by ItemAdd()!

LastItemData (class)

Status storage for the last submitted item

AttributeC++
id_: IDImGuiID ID;
item_flags: ItemFlagsImGuiItemFlags ItemFlags;See ImGuiItemFlags_ (called ‘InFlags’ before v1.91.4).
status_flags: ItemStatusFlagsImGuiItemStatusFlags StatusFlags;See ImGuiItemStatusFlags_
rect: ImRectImRect Rect;Full rectangle
nav_rect: ImRectImRect NavRect;Navigation scoring rectangle (not displayed)
display_rect: ImRectImRect DisplayRect;Display rectangle. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) is set.
clip_rect: ImRectImRect ClipRect;Clip rectangle at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasClipRect) is set..
shortcut: KeyChordImGuiKeyChord Shortcut;Shortcut at the time of submitting item. ONLY VALID IF (StatusFlags & ImGuiItemStatusFlags_HasShortcut) is set..
LastItemData.__init__
def __init__(self) -> None
ImGuiLastItemData();

TreeNodeStackData (class)

Store data emitted by TreeNode() for usage by TreePop()

AttributeC++
id_: IDImGuiID ID;
tree_flags: TreeNodeFlagsImGuiTreeNodeFlags TreeFlags;
item_flags: ItemFlagsImGuiItemFlags ItemFlags;Used for nav landing
nav_rect: ImRectImRect NavRect;Used for nav landing
draw_lines_x1: floatfloat DrawLinesX1;
draw_lines_to_nodes_y2: floatfloat DrawLinesToNodesY2;
draw_lines_table_column: TableColumnIdxImGuiTableColumnIdx DrawLinesTableColumn;
TreeNodeStackData.__init__
def __init__(self, id_: ID = ID(), tree_flags: TreeNodeFlags = TreeNodeFlags(), item_flags: ItemFlags = ItemFlags(), nav_rect: Optional[ImRect] = None, draw_lines_x1: float = float(), draw_lines_to_nodes_y2: float = float(), draw_lines_table_column: Optional[TableColumnIdx] = None) -> None

Auto-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: * NavRect: ImRect() * DrawLinesTableColumn: TableColumnIdx()

ErrorRecoveryState (class)

sizeof() = 20

AttributeC++
size_of_window_stack: intshort SizeOfWindowStack;
size_of_id_stack: intshort SizeOfIDStack;
size_of_tree_stack: intshort SizeOfTreeStack;
size_of_color_stack: intshort SizeOfColorStack;
size_of_style_var_stack: intshort SizeOfStyleVarStack;
size_of_font_stack: intshort SizeOfFontStack;
size_of_focus_scope_stack: intshort SizeOfFocusScopeStack;
size_of_group_stack: intshort SizeOfGroupStack;
size_of_item_flags_stack: intshort SizeOfItemFlagsStack;
size_of_begin_popup_stack: intshort SizeOfBeginPopupStack;
size_of_disabled_stack: intshort SizeOfDisabledStack;
ErrorRecoveryState.__init__
def __init__(self) -> None
ImGuiErrorRecoveryState();

WindowStackData (class)

Storage for each window pushed into the stack.

AttributeC++
window: WindowImGuiWindow* Window;
parent_last_item_data_backup: LastItemDataImGuiLastItemData ParentLastItemDataBackup;
stack_sizes_in_begin: ErrorRecoveryStateImGuiErrorRecoveryState StackSizesInBegin;Store size of various stacks for asserting
disabled_override_reenable: boolbool DisabledOverrideReenable;Non-child window override disabled flag
disabled_override_reenable_alpha_backup: floatfloat DisabledOverrideReenableAlphaBackup;
parent_last_combo_preview_rect: ImRectImRect ParentLastComboPreviewRect;
WindowStackData.__init__
def __init__(self, parent_last_item_data_backup: Optional[LastItemData] = None, stack_sizes_in_begin: Optional[ErrorRecoveryState] = None, disabled_override_reenable: bool = bool(), disabled_override_reenable_alpha_backup: float = float(), parent_last_combo_preview_rect: Optional[ImRect] = None) -> None

Auto-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: * ParentLastItemDataBackup: LastItemData() * StackSizesInBegin: ErrorRecoveryState() * ParentLastComboPreviewRect: ImRect()

ShrinkWidthItem (class)

AttributeC++
index: intint Index;
width: floatfloat Width;
initial_width: floatfloat InitialWidth;
ShrinkWidthItem.__init__
def __init__(self, index: int = int(), width: float = float(), initial_width: float = float()) -> None

Auto-generated default constructor with named params

PtrOrIndex (class)

AttributeC++
ptr: Anyvoid* Ptr;Either field can be set, not both. e.g. Dock node tab bars are loose while BeginTabBar() ones are in a pool.
index: intint Index;Usually index in a main pool.
PtrOrIndex.__init__
@overload
def __init__(self, ptr: Any) -> None

@overload
def __init__(self, index: int) -> None
ImGuiPtrOrIndex(void* ptr);
ImGuiPtrOrIndex(int index);

DeactivatedItemData (class)

Data used by IsItemDeactivated()/IsItemDeactivatedAfterEdit() functions
Also see ImGuiInputTextDeactivatedState which is an extension for this for InputText()

AttributeC++
id_: IDImGuiID ID;
elapse_frame: intint ElapseFrame;
has_been_edited_before: boolbool HasBeenEditedBefore;
is_alive: boolbool IsAlive;
DeactivatedItemData.__init__
def __init__(self, id_: ID = ID(), elapse_frame: int = int(), has_been_edited_before: bool = bool(), is_alive: bool = bool()) -> None

Auto-generated default constructor with named params

PopupPositionPolicy (enum)

MemberValueC++
default0ImGuiPopupPositionPolicy_Default
combo_box1ImGuiPopupPositionPolicy_ComboBox
tooltip2ImGuiPopupPositionPolicy_Tooltip, }

PopupData (class)

Storage for popup stacks (g.OpenPopupStack and g.BeginPopupStack)

AttributeC++
popup_id: IDImGuiID PopupId;Set on OpenPopup()
window: WindowImGuiWindow* Window;Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
restore_nav_window: WindowImGuiWindow* RestoreNavWindow;Set on OpenPopup(), a NavWindow that will be restored on popup close
parent_nav_layer: intint ParentNavLayer;Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as “not any of layers” value
open_frame_count: intint OpenFrameCount;Set on OpenPopup()
open_parent_id: IDImGuiID OpenParentId;Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
open_popup_pos: ImVec2ImVec2 OpenPopupPos;Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
open_mouse_pos: ImVec2ImVec2 OpenMousePos;Set on OpenPopup(), copy of mouse position at the time of opening popup
PopupData.__init__
def __init__(self) -> None
ImGuiPopupData();

Inputs support

[Internal] Key ranges

[Internal] Named shortcuts for Navigation

InputEventType (enum)

MemberValueC++
none0ImGuiInputEventType_None = 0
mouse_pos1ImGuiInputEventType_MousePos
mouse_wheel2ImGuiInputEventType_MouseWheel
mouse_button3ImGuiInputEventType_MouseButton
mouse_viewport4ImGuiInputEventType_MouseViewport
key5ImGuiInputEventType_Key
text6ImGuiInputEventType_Text
focus7ImGuiInputEventType_Focus
count8ImGuiInputEventType_COUNT

InputSource (enum)

MemberValueC++
none0ImGuiInputSource_None = 0
mouse1ImGuiInputSource_MouseNote: may be Mouse or TouchScreen or Pen. See io.MouseSource to distinguish them.
keyboard2ImGuiInputSource_Keyboard
gamepad3ImGuiInputSource_Gamepad
count4ImGuiInputSource_COUNT

InputEventMousePos (class)

AttributeC++
pos_x: floatfloat PosX,
pos_y: floatPosY;
mouse_source: MouseSourceImGuiMouseSource MouseSource;
InputEventMousePos.__init__
def __init__(self, pos_x: float = float(), pos_y: float = float(), mouse_source: Optional[MouseSource] = None) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If MouseSource is None, then its default value will be: MouseSource()

InputEventMouseWheel (class)

AttributeC++
wheel_x: floatfloat WheelX,
wheel_y: floatWheelY;
mouse_source: MouseSourceImGuiMouseSource MouseSource;
InputEventMouseWheel.__init__
def __init__(self, wheel_x: float = float(), wheel_y: float = float(), mouse_source: Optional[MouseSource] = None) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If MouseSource is None, then its default value will be: MouseSource()

InputEventMouseButton (class)

AttributeC++
button: intint Button;
down: boolbool Down;
mouse_source: MouseSourceImGuiMouseSource MouseSource;
InputEventMouseButton.__init__
def __init__(self, button: int = int(), down: bool = bool(), mouse_source: Optional[MouseSource] = None) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If MouseSource is None, then its default value will be: MouseSource()

InputEventMouseViewport (class)

AttributeC++
hovered_viewport_id: IDImGuiID HoveredViewportID;
InputEventMouseViewport.__init__
def __init__(self, hovered_viewport_id: ID = ID()) -> None

Auto-generated default constructor with named params

InputEventKey (class)

AttributeC++
key: KeyImGuiKey Key;
down: boolbool Down;
analog_value: floatfloat AnalogValue;
InputEventKey.__init__
def __init__(self, key: Key = Key(), down: bool = bool(), analog_value: float = float()) -> None

Auto-generated default constructor with named params

InputEventText (class)

AttributeC++
char: intunsigned int Char;
InputEventText.__init__
def __init__(self) -> None

Auto-generated default constructor

InputEventAppFocused (class)

AttributeC++
focused: boolbool Focused;
InputEventAppFocused.__init__
def __init__(self, focused: bool = bool()) -> None

Auto-generated default constructor with named params

InputEvent (class)

AttributeC++
type: InputEventTypeImGuiInputEventType Type;
source: InputSourceImGuiInputSource Source;
event_id: ImU32ImU32 EventId;Unique, sequential increasing integer to identify an event (if you need to correlate them to other data).
added_by_test_engine: boolbool AddedByTestEngine;
InputEvent.__init__
def __init__(self) -> None
ImGuiInputEvent();

KeyRoutingData (class)

Routing table entry (sizeof() == 16 bytes)

AttributeC++
next_entry_index: KeyRoutingIndexImGuiKeyRoutingIndex NextEntryIndex;
mods: ImU16ImU16 Mods;Technically we’d only need 4-bits but for simplify we store ImGuiMod_ values which need 16-bits.
routing_curr_score: ImU16ImU16 RoutingCurrScore;[DEBUG] For debug display
routing_next_score: ImU16ImU16 RoutingNextScore;Lower is better (0: perfect score)
routing_curr: IDImGuiID RoutingCurr;
routing_next: IDImGuiID RoutingNext;
KeyRoutingData.__init__
def __init__(self) -> None
ImGuiKeyRoutingData();

KeyRoutingTable (class)

Routing table: maintain a desired owner for each possible key-chord (key + mods), and setup owner in NewFrame() when mods are matching.
Stored in main context (1 instance)

AttributeC++
entries: ImVector_KeyRoutingDataImVector<ImGuiKeyRoutingData> Entries;
entries_next: ImVector_KeyRoutingDataImVector<ImGuiKeyRoutingData> EntriesNext;Double-buffer to avoid reallocation (could use a shared buffer)
KeyRoutingTable.__init__
def __init__(self) -> None
ImGuiKeyRoutingTable();
KeyRoutingTable.clear
def clear(self) -> None
void Clear();

(private API)

KeyOwnerData (class)

This extends ImGuiKeyData but only for named keys (legacy keys don’t support the new features)
Stored in main context (1 per named key). In the future it might be merged into ImGuiKeyData.

AttributeC++
owner_curr: IDImGuiID OwnerCurr;
owner_next: IDImGuiID OwnerNext;
lock_this_frame: boolbool LockThisFrame;Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame.
lock_until_release: boolbool LockUntilRelease;Reading this key requires explicit owner id (until key is released). Set by ImGuiInputFlags_LockUntilRelease. When this is True LockThisFrame is always True as well.
KeyOwnerData.__init__
def __init__(self) -> None
ImGuiKeyOwnerData();

InputFlagsPrivate_ (enum)

Extend ImGuiInputFlags_
Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner()
Don’t mistake with ImGuiInputTextFlags! (which is for ImGui::InputText() function)

MemberValueC++
repeat_rate_default1 << 1ImGuiInputFlags_RepeatRateDefault = 1 << 1Repeat rate: Regular (default)
repeat_rate_nav_move1 << 2ImGuiInputFlags_RepeatRateNavMove = 1 << 2Repeat rate: Fast
repeat_rate_nav_tweak1 << 3ImGuiInputFlags_RepeatRateNavTweak = 1 << 3Repeat rate: Faster
repeat_until_release1 << 4ImGuiInputFlags_RepeatUntilRelease = 1 << 4Stop repeating when released (default for all functions except Shortcut). This only exists to allow overriding Shortcut() default behavior.
repeat_until_key_mods_change1 << 5ImGuiInputFlags_RepeatUntilKeyModsChange = 1 << 5Stop repeating when released OR if keyboard mods are changed (default for Shortcut)
repeat_until_key_mods_change_from_none1 << 6ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone = 1 << 6Stop repeating when released OR if keyboard mods are leaving the None state. Allows going from Mod+Key to Key by releasing Mod.
repeat_until_other_key_press1 << 7ImGuiInputFlags_RepeatUntilOtherKeyPress = 1 << 7Stop repeating when released OR if any other keyboard key is pressed during the repeat
lock_this_frame1 << 20ImGuiInputFlags_LockThisFrame = 1 << 20Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame.
lock_until_release1 << 21ImGuiInputFlags_LockUntilRelease = 1 << 21Further accesses to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released.
cond_hovered1 << 22ImGuiInputFlags_CondHovered = 1 << 22Only set if item is hovered (default to both)
cond_active1 << 23ImGuiInputFlags_CondActive = 1 << 23Only set if item is active (default to both)
cond_default_InputFlags_CondHovered | InputFlags_CondActiveImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive
repeat_rate_mask_InputFlags_RepeatRateDefault | InputFlags_RepeatRateNavMove | InputFlags_RepeatRateNavTweakImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak
repeat_until_mask_InputFlags_RepeatUntilRelease | InputFlags_RepeatUntilKeyModsChange | InputFlags_RepeatUntilKeyModsChangeFromNone | InputFlags_RepeatUntilOtherKeyPressImGuiInputFlags_RepeatUntilMask_ = ImGuiInputFlags_RepeatUntilRelease | ImGuiInputFlags_RepeatUntilKeyModsChange | ImGuiInputFlags_RepeatUntilKeyModsChangeFromNone | ImGuiInputFlags_RepeatUntilOtherKeyPress
repeat_mask_InputFlags_Repeat | InputFlags_RepeatRateMask_ | InputFlags_RepeatUntilMask_ImGuiInputFlags_RepeatMask_ = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RepeatUntilMask_
cond_mask_InputFlags_CondHovered | InputFlags_CondActiveImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive
route_type_mask_InputFlags_RouteActive | InputFlags_RouteFocused | InputFlags_RouteGlobal | InputFlags_RouteAlwaysImGuiInputFlags_RouteTypeMask_ = ImGuiInputFlags_RouteActive | ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteAlways
route_options_mask_InputFlags_RouteOverFocused | InputFlags_RouteOverActive | InputFlags_RouteUnlessBgFocused | InputFlags_RouteFromRootWindowImGuiInputFlags_RouteOptionsMask_ = ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive | ImGuiInputFlags_RouteUnlessBgFocused | ImGuiInputFlags_RouteFromRootWindow
supported_by_is_key_pressedInputFlags_RepeatMask_ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_RepeatMask_
supported_by_is_mouse_clickedInputFlags_RepeatImGuiInputFlags_SupportedByIsMouseClicked = ImGuiInputFlags_Repeat
supported_by_shortcutInputFlags_RepeatMask_ | InputFlags_RouteTypeMask_ | InputFlags_RouteOptionsMask_ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_
supported_by_set_next_item_shortcutInputFlags_RepeatMask_ | InputFlags_RouteTypeMask_ | InputFlags_RouteOptionsMask_ | InputFlags_TooltipImGuiInputFlags_SupportedBySetNextItemShortcut = ImGuiInputFlags_RepeatMask_ | ImGuiInputFlags_RouteTypeMask_ | ImGuiInputFlags_RouteOptionsMask_ | ImGuiInputFlags_Tooltip
supported_by_set_key_ownerInputFlags_LockThisFrame | InputFlags_LockUntilReleaseImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease
supported_by_set_item_key_ownerInputFlags_SupportedBySetKeyOwner | InputFlags_CondMask_ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_, }

Clipper support

ListClipperRange (class)

Note that Max is exclusive, so perhaps should be using a Begin/End convention.

AttributeC++
min: intint Min;
max: intint Max;
pos_to_index_convert: boolbool PosToIndexConvert;Begin/End are absolute position (will be converted to indices later)
pos_to_index_offset_min: ImS8ImS8 PosToIndexOffsetMin;Add to Min after converting to indices
pos_to_index_offset_max: ImS8ImS8 PosToIndexOffsetMax;Add to Min after converting to indices
ListClipperRange.from_indices
@staticmethod
def from_indices(min: int, max: int) -> ListClipperRange
static ImGuiListClipperRange FromIndices(int min, int max);

(private API)

ListClipperRange.from_positions
@staticmethod
def from_positions(y1: float, y2: float, off_min: int, off_max: int) -> ListClipperRange
static ImGuiListClipperRange FromPositions(float y1, float y2, int off_min, int off_max);

(private API)

ListClipperRange.__init__
def __init__(self, min: int = int(), max: int = int(), pos_to_index_convert: bool = bool(), pos_to_index_offset_min: ImS8 = ImS8(), pos_to_index_offset_max: ImS8 = ImS8()) -> None

Auto-generated default constructor with named params

ListClipperData (class)

Temporary clipper data, buffers shared/reused between instances

AttributeC++
list_clipper: ListClipperImGuiListClipper* ListClipper;
lossyness_offset: floatfloat LossynessOffset;
step_no: intint StepNo;
items_frozen: intint ItemsFrozen;
ranges: ImVector_ListClipperRangeImVector<ImGuiListClipperRange> Ranges;
ListClipperData.__init__
def __init__(self) -> None
ImGuiListClipperData();
ListClipperData.reset
def reset(self, clipper: ListClipper) -> None
void Reset(ImGuiListClipper* clipper);

(private API)

ActivateFlags_ (enum)

MemberValueC++
none0ImGuiActivateFlags_None = 0
prefer_input1 << 0ImGuiActivateFlags_PreferInput = 1 << 0Favor activation that requires keyboard text input (e.g. for Slider/Drag). Default for Enter key.
prefer_tweak1 << 1ImGuiActivateFlags_PreferTweak = 1 << 1Favor activation for tweaking with arrows or gamepad (e.g. for Slider/Drag). Default for Space key and if keyboard is not used.
try_to_preserve_state1 << 2ImGuiActivateFlags_TryToPreserveState = 1 << 2Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
from_tabbing1 << 3ImGuiActivateFlags_FromTabbing = 1 << 3Activation requested by a tabbing request (ImGuiNavMoveFlags_IsTabbing)
from_shortcut1 << 4ImGuiActivateFlags_FromShortcut = 1 << 4Activation requested by an item shortcut via SetNextItemShortcut() function.
from_focus_api1 << 5ImGuiActivateFlags_FromFocusApi = 1 << 5Activation requested by an api request (ImGuiNavMoveFlags_FocusApi)

ScrollFlags_ (enum)

Early work-in-progress API for ScrollToItem()
FIXME: Missing flags to request making both edges visible when possible.

MemberValueC++
none0ImGuiScrollFlags_None = 0
keep_visible_edge_x1 << 0ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0If item is not visible: scroll as little as possible on X axis to bring item back into view [default for X axis]
keep_visible_edge_y1 << 1ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1If item is not visible: scroll as little as possible on Y axis to bring item back into view [default for Y axis for windows that are already visible]
keep_visible_center_x1 << 2ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2If item is not visible: scroll to make the item centered on X axis [rarely used]
keep_visible_center_y1 << 3ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3If item is not visible: scroll to make the item centered on Y axis
always_center_x1 << 4ImGuiScrollFlags_AlwaysCenterX = 1 << 4Always center the result item on X axis [rarely used]
always_center_y1 << 5ImGuiScrollFlags_AlwaysCenterY = 1 << 5Always center the result item on Y axis [default for Y axis for appearing window)
no_scroll_parent1 << 6ImGuiScrollFlags_NoScrollParent = 1 << 6Disable forwarding scrolling to parent window if required to keep item/rect visible (only scroll window the function was applied to).
mask_x_ScrollFlags_KeepVisibleEdgeX | ScrollFlags_KeepVisibleCenterX | ScrollFlags_AlwaysCenterXImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX
mask_y_ScrollFlags_KeepVisibleEdgeY | ScrollFlags_KeepVisibleCenterY | ScrollFlags_AlwaysCenterYImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY, }

NavRenderCursorFlags_ (enum)

MemberValueC++
none0ImGuiNavRenderCursorFlags_None = 0
compact1 << 1ImGuiNavRenderCursorFlags_Compact = 1 << 1Compact highlight, no padding/distance from focused item
always_draw1 << 2ImGuiNavRenderCursorFlags_AlwaysDraw = 1 << 2Draw rectangular highlight if (g.NavId == id) even when g.NavCursorVisible == False, aka even when using the mouse.

NavMoveFlags_ (enum)

MemberValueC++
none0ImGuiNavMoveFlags_None = 0
loop_x1 << 0ImGuiNavMoveFlags_LoopX = 1 << 0On failed request, restart from opposite side
loop_y1 << 1ImGuiNavMoveFlags_LoopY = 1 << 1
wrap_x1 << 2ImGuiNavMoveFlags_WrapX = 1 << 2On failed request, request from opposite side one line down (when NavDir==right) or one line up (when NavDir==left)
wrap_y1 << 3ImGuiNavMoveFlags_WrapY = 1 << 3This is not super useful but provided for completeness
wrap_mask_NavMoveFlags_LoopX | NavMoveFlags_LoopY | NavMoveFlags_WrapX | NavMoveFlags_WrapYImGuiNavMoveFlags_WrapMask_ = ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_LoopY | ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_WrapY
allow_current_nav_id1 << 4ImGuiNavMoveFlags_AllowCurrentNavId = 1 << 4Allow scoring and considering the current NavId as a move target candidate. This is used when the move source is offset (e.g. pressing PageDown actually needs to send a Up move request, if we are pressing PageDown from the bottom-most item we need to stay in place)
also_score_visible_set1 << 5ImGuiNavMoveFlags_AlsoScoreVisibleSet = 1 << 5Store alternate result in NavMoveResultLocalVisible that only comprise elements that are already fully visible (used by PageUp/PageDown)
scroll_to_edge_y1 << 6ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword as ImGuiScrollFlags
forwarded1 << 7ImGuiNavMoveFlags_Forwarded = 1 << 7
debug_no_result1 << 8ImGuiNavMoveFlags_DebugNoResult = 1 << 8Dummy scoring for debug purpose, don’t apply result
focus_api1 << 9ImGuiNavMoveFlags_FocusApi = 1 << 9Requests from focus API can land/focus/activate items even if they are marked with _NoTabStop (see NavProcessItemForTabbingRequest() for details)
is_tabbing1 << 10ImGuiNavMoveFlags_IsTabbing = 1 << 10== Focus + Activate if item is Inputable + DontChangeNavHighlight
is_page_move1 << 11ImGuiNavMoveFlags_IsPageMove = 1 << 11Identify a PageDown/PageUp request.
activate1 << 12ImGuiNavMoveFlags_Activate = 1 << 12Activate/select target item.
no_select1 << 13ImGuiNavMoveFlags_NoSelect = 1 << 13Don’t trigger selection by not setting g.NavJustMovedTo
no_set_nav_cursor_visible1 << 14ImGuiNavMoveFlags_NoSetNavCursorVisible = 1 << 14Do not alter the nav cursor visible state
no_clear_active_id1 << 15ImGuiNavMoveFlags_NoClearActiveId = 1 << 15(Experimental) Do not clear active id when applying move result

NavLayer (enum)

MemberValueC++
main0ImGuiNavLayer_Main = 0Main scrolling layer
menu1ImGuiNavLayer_Menu = 1Menu layer (access with Alt)
count2ImGuiNavLayer_COUNT

NavItemData (class)

Storage for navigation query/results

AttributeC++
window: WindowImGuiWindow* Window;Init,Move // Best candidate window (result->ItemWindow->RootWindowForNav == request->Window)
id_: IDImGuiID ID;Init,Move // Best candidate item ID
focus_scope_id: IDImGuiID FocusScopeId;Init,Move // Best candidate focus scope ID
rect_rel: ImRectImRect RectRel;Init,Move // Best candidate bounding box in window relative space
item_flags: ItemFlagsImGuiItemFlags ItemFlags;????,Move // Best candidate item flags
dist_box: floatfloat DistBox;Move // Best candidate box distance to current NavId
dist_center: floatfloat DistCenter;Move // Best candidate center distance to current NavId
dist_axial: floatfloat DistAxial;Move // Best candidate axial distance to current NavId
selection_user_data: SelectionUserDataImGuiSelectionUserData SelectionUserData;I+Mov // Best candidate SetNextItemSelectionUserData() value. Valid if (ItemFlags & ImGuiItemFlags_HasSelectionUserData)
NavItemData.__init__
def __init__(self) -> None
ImGuiNavItemData();
NavItemData.clear
def clear(self) -> None
void Clear();

(private API)

FocusScopeData (class)

Storage for PushFocusScope(), g.FocusScopeStack[], g.NavFocusRoute[]

AttributeC++
id_: IDImGuiID ID;
window_id: IDImGuiID WindowID;
FocusScopeData.__init__
def __init__(self, id_: ID = ID(), window_id: ID = ID()) -> None

Auto-generated default constructor with named params

Typing-select support

TypingSelectFlags_ (enum)

Flags for GetTypingSelectRequest()

MemberValueC++
none0ImGuiTypingSelectFlags_None = 0
allow_backspace1 << 0ImGuiTypingSelectFlags_AllowBackspace = 1 << 0Backspace to delete character inputs. If using: ensure GetTypingSelectRequest() is not called more than once per frame (filter by e.g. focus state)
allow_single_char_mode1 << 1ImGuiTypingSelectFlags_AllowSingleCharMode = 1 << 1Allow “single char” search mode which is activated when pressing the same character multiple times.

TypingSelectRequest (class)

Returned by GetTypingSelectRequest(), designed to eventually be public.

AttributeC++
flags: TypingSelectFlagsImGuiTypingSelectFlags Flags;Flags passed to GetTypingSelectRequest()
search_buffer_len: intint SearchBufferLen;
search_buffer: strconst char* SearchBuffer;Search buffer contents (use full string. unless SingleCharMode is set, in which case use SingleCharSize). # (const)
select_request: boolbool SelectRequest;Set when buffer was modified this frame, requesting a selection.
single_char_mode: boolbool SingleCharMode;Notify when buffer contains same character repeated, to implement special mode. In this situation it preferred to not display any on-screen search indication.
single_char_size: ImS8ImS8 SingleCharSize;Length in bytes of first letter codepoint (1 for ascii, 2-4 for UTF-8). If (SearchBufferLen==RepeatCharSize) only 1 letter has been input.
TypingSelectRequest.__init__
def __init__(self, flags: TypingSelectFlags = TypingSelectFlags(), search_buffer_len: int = int(), select_request: bool = bool(), single_char_mode: bool = bool(), single_char_size: ImS8 = ImS8()) -> None

Auto-generated default constructor with named params

TypingSelectState (class)

Storage for GetTypingSelectRequest()

AttributeC++
request: TypingSelectRequestImGuiTypingSelectRequest Request;User-facing data
focus_scope: IDImGuiID FocusScope;
last_request_frame: intint LastRequestFrame = 0;
last_request_time: floatfloat LastRequestTime = 0.0f;
single_char_mode_lock: boolbool SingleCharModeLock = false;After a certain single char repeat count we lock into SingleCharMode. Two benefits: 1) buffer never fill, 2) we can provide an immediate SingleChar mode without timer elapsing.
TypingSelectState.__init__
def __init__(self) -> None
ImGuiTypingSelectState();
TypingSelectState.clear
def clear(self) -> None
void Clear();

(private API)

We preserve remaining data for easier debugging

Columns support

OldColumnFlags_ (enum)

Flags for internal’s BeginColumns(). This is an obsolete API. Prefer using BeginTable() nowadays!

MemberValueC++
none0ImGuiOldColumnFlags_None = 0
no_border1 << 0ImGuiOldColumnFlags_NoBorder = 1 << 0Disable column dividers
no_resize1 << 1ImGuiOldColumnFlags_NoResize = 1 << 1Disable resizing columns when clicking on the dividers
no_preserve_widths1 << 2ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2Disable column width preservation when adjusting columns
no_force_within_window1 << 3ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3Disable forcing columns to fit within window
grow_parent_contents_size1 << 4ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4Restore pre-1.51 behavior of extending the parent window contents size but without affecting the columns width at all. Will eventually remove.

Obsolete names (will be removed)

OldColumnData (class)

AttributeC++
offset_norm: floatfloat OffsetNorm;Column start offset, normalized 0.0 (far left) -> 1.0 (far right)
offset_norm_before_resize: floatfloat OffsetNormBeforeResize;
flags: OldColumnFlagsImGuiOldColumnFlags Flags;Not exposed
clip_rect: ImRectImRect ClipRect;
OldColumnData.__init__
def __init__(self) -> None
ImGuiOldColumnData();

OldColumns (class)

AttributeC++
id_: IDImGuiID ID;
flags: OldColumnFlagsImGuiOldColumnFlags Flags;
is_first_frame: boolbool IsFirstFrame;
is_being_resized: boolbool IsBeingResized;
current: intint Current;
count: intint Count;
off_min_x: floatfloat OffMinX,Offsets from HostWorkRect.Min.x
off_max_x: floatOffMaxX;Offsets from HostWorkRect.Min.x
line_min_y: floatfloat LineMinY,
line_max_y: floatLineMaxY;
host_cursor_pos_y: floatfloat HostCursorPosY;Backup of CursorPos at the time of BeginColumns()
host_cursor_max_pos_x: floatfloat HostCursorMaxPosX;Backup of CursorMaxPos at the time of BeginColumns()
host_initial_clip_rect: ImRectImRect HostInitialClipRect;Backup of ClipRect at the time of BeginColumns()
host_backup_clip_rect: ImRectImRect HostBackupClipRect;Backup of ClipRect during PushColumnsBackground()/PopColumnsBackground()
host_backup_parent_work_rect: ImRectImRect HostBackupParentWorkRect;Backup of WorkRect at the time of BeginColumns()
columns: ImVector_OldColumnDataImVector<ImGuiOldColumnData> Columns;
splitter: ImDrawListSplitterImDrawListSplitter Splitter;
OldColumns.__init__
def __init__(self) -> None
ImGuiOldColumns();

Box-select support

BoxSelectState (class)

AttributeC++
id_: IDImGuiID ID;
is_active: boolbool IsActive;
is_starting: boolbool IsStarting;
is_started_from_void: boolbool IsStartedFromVoid;Starting click was not from an item.
is_started_set_nav_id_once: boolbool IsStartedSetNavIdOnce;
request_clear: boolbool RequestClear;
start_pos_rel: ImVec2ImVec2 StartPosRel;Start position in window-contents relative space (to support scrolling)
end_pos_rel: ImVec2ImVec2 EndPosRel;End position in window-contents relative space
scroll_accum: ImVec2ImVec2 ScrollAccum;Scrolling accumulator (to behave at high-frame spaces)
window: WindowImGuiWindow* Window;
unclip_mode: boolbool UnclipMode;(Temp/Transient, here in hot area). Set/cleared by the BeginMultiSelect()/EndMultiSelect() owning active box-select.
unclip_rect: ImRectImRect UnclipRect;Rectangle where ItemAdd() clipping may be temporarily disabled. Need support by multi-select supporting widgets.
box_select_rect_prev: ImRectImRect BoxSelectRectPrev;Selection rectangle in absolute coordinates (derived every frame from BoxSelectStartPosRel and MousePos)
box_select_rect_curr: ImRectImRect BoxSelectRectCurr;
BoxSelectState.__init__
def __init__(self) -> None
ImGuiBoxSelectState();

Multi-select support

MultiSelectTempData (class)

Temporary storage for multi-select

AttributeC++
io: MultiSelectIOImGuiMultiSelectIO IO;MUST BE FIRST FIELD. Requests are set and returned by BeginMultiSelect()/EndMultiSelect() + written to by user during the loop.
storage: MultiSelectStateImGuiMultiSelectState* Storage;
focus_scope_id: IDImGuiID FocusScopeId;Copied from g.CurrentFocusScopeId (unless another selection scope was pushed manually)
flags: MultiSelectFlagsImGuiMultiSelectFlags Flags;
scope_rect_min: ImVec2ImVec2 ScopeRectMin;
backup_cursor_max_pos: ImVec2ImVec2 BackupCursorMaxPos;
box_select_id: IDImGuiID BoxSelectId;
key_mods: KeyChordImGuiKeyChord KeyMods;
loop_request_set_all: ImS8ImS8 LoopRequestSetAll;-1: no operation, 0: clear all, 1: select all.
is_end_io: boolbool IsEndIO;Set when switching IO from BeginMultiSelect() to EndMultiSelect() state.
is_focused: boolbool IsFocused;Set if currently focusing the selection scope (any item of the selection). May be used if you have custom shortcut associated to selection.
is_keyboard_set_range: boolbool IsKeyboardSetRange;Set by BeginMultiSelect() when using Shift+Navigation. Because scrolling may be affected we can’t afford a frame of lag with Shift+Navigation.
nav_id_passed_by: boolbool NavIdPassedBy;
range_src_passed_by: boolbool RangeSrcPassedBy;Set by the item that matches RangeSrcItem.
range_dst_passed_by: boolbool RangeDstPassedBy;Set by the item that matches NavJustMovedToId when IsSetRange is set.
is_sole_or_unknown_selection_size: boolbool IsSoleOrUnknownSelectionSize;
MultiSelectTempData.__init__
def __init__(self) -> None
ImGuiMultiSelectTempData();
MultiSelectTempData.clear
def clear(self) -> None
void Clear();

(private API)

Zero-clear except IO as we preserve IO.Requests[] buffer allocation.

MultiSelectTempData.clear_io
def clear_io(self) -> None
void ClearIO();

(private API)

MultiSelectState (class)

Persistent storage for multi-select (as long as selection is alive)

AttributeC++
window: WindowImGuiWindow* Window;
id_: IDImGuiID ID;
last_frame_active: intint LastFrameActive;Last used frame-count, for GC.
last_selection_size: intint LastSelectionSize;Set by BeginMultiSelect() based on optional info provided by user. May be -1 if unknown.
range_selected: ImS8ImS8 RangeSelected;-1 (don’t have) or True/False
nav_id_selected: ImS8ImS8 NavIdSelected;-1 (don’t have) or True/False
range_src_item: SelectionUserDataImGuiSelectionUserData RangeSrcItem;
nav_id_item: SelectionUserDataImGuiSelectionUserData NavIdItem;SetNextItemSelectionUserData() value for NavId (if part of submitted items)
MultiSelectState.__init__
def __init__(self) -> None
ImGuiMultiSelectState();

Docking support

DockNodeFlagsPrivate_ (enum)

Extend ImGuiDockNodeFlags_

MemberValueC++
dock_space1 << 10ImGuiDockNodeFlags_DockSpace = 1 << 10Saved // A dockspace is a node that occupy space within an existing user window. Otherwise the node is floating and create its own window.
central_node1 << 11ImGuiDockNodeFlags_CentralNode = 1 << 11Saved // The central node has 2 main properties: stay visible when empty, only use “remaining” spaces from its neighbor.
no_tab_bar1 << 12ImGuiDockNodeFlags_NoTabBar = 1 << 12Saved // Tab bar is completely unavailable. No triangle in the corner to enable it back.
hidden_tab_bar1 << 13ImGuiDockNodeFlags_HiddenTabBar = 1 << 13Saved // Tab bar is hidden, with a triangle in the corner to show it again (NB: actual tab-bar instance may be destroyed as this is only used for single-window tab bar)
no_window_menu_button1 << 14ImGuiDockNodeFlags_NoWindowMenuButton = 1 << 14Saved // Disable window/docking menu (that one that appears instead of the collapse button)
no_close_button1 << 15ImGuiDockNodeFlags_NoCloseButton = 1 << 15Saved // Disable close button
no_resize_x1 << 16ImGuiDockNodeFlags_NoResizeX = 1 << 16//
no_resize_y1 << 17ImGuiDockNodeFlags_NoResizeY = 1 << 17//
docked_windows_in_focus_route1 << 18ImGuiDockNodeFlags_DockedWindowsInFocusRoute= 1 << 18// Any docked window will be automatically be focus-route chained (window->ParentWindowForFocusRoute set to this) so Shortcut() in this window can run when any docked window is focused.
no_docking_split_other1 << 19ImGuiDockNodeFlags_NoDockingSplitOther = 1 << 19// Disable this node from splitting other windows/nodes.
no_docking_over_me1 << 20ImGuiDockNodeFlags_NoDockingOverMe = 1 << 20// Disable other windows/nodes from being docked over this node.
no_docking_over_other1 << 21ImGuiDockNodeFlags_NoDockingOverOther = 1 << 21// Disable this node from being docked over another window or non-empty node.
no_docking_over_empty1 << 22ImGuiDockNodeFlags_NoDockingOverEmpty = 1 << 22// Disable this node from being docked over an empty node (e.g. DockSpace with no other windows)
no_dockingDockNodeFlags_NoDockingOverMe | DockNodeFlags_NoDockingOverOther | DockNodeFlags_NoDockingOverEmpty | DockNodeFlags_NoDockingSplit | DockNodeFlags_NoDockingSplitOtherImGuiDockNodeFlags_NoDocking = ImGuiDockNodeFlags_NoDockingOverMe | ImGuiDockNodeFlags_NoDockingOverOther | ImGuiDockNodeFlags_NoDockingOverEmpty | ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoDockingSplitOther
shared_flags_inherit_mask_~0ImGuiDockNodeFlags_SharedFlagsInheritMask_ = ~0
no_resize_flags_mask_(intImGuiDockNodeFlags_NoResizeFlagsMask_ = (int)ImGuiDockNodeFlags_NoResize | ImGuiDockNodeFlags_NoResizeX | ImGuiDockNodeFlags_NoResizeYDockNodeFlags_NoResize | DockNodeFlags_NoResizeX | DockNodeFlags_NoResizeY)
local_flags_transfer_mask_(intImGuiDockNodeFlags_LocalFlagsTransferMask_ = (int)ImGuiDockNodeFlags_NoDockingSplit | ImGuiDockNodeFlags_NoResizeFlagsMask_ | (int)ImGuiDockNodeFlags_AutoHideTabBar | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButtonDockNodeFlags_NoDockingSplit | DockNodeFlags_NoResizeFlagsMask_ | (int)DockNodeFlags_AutoHideTabBar | DockNodeFlags_CentralNode | DockNodeFlags_NoTabBar | DockNodeFlags_HiddenTabBar | DockNodeFlags_NoWindowMenuButton | DockNodeFlags_NoCloseButton)
saved_flags_mask_DockNodeFlags_NoResizeFlagsMask_ | DockNodeFlags_DockSpace | DockNodeFlags_CentralNode | DockNodeFlags_NoTabBar | DockNodeFlags_HiddenTabBar | DockNodeFlags_NoWindowMenuButton | DockNodeFlags_NoCloseButtonImGuiDockNodeFlags_SavedFlagsMask_ = ImGuiDockNodeFlags_NoResizeFlagsMask_ | ImGuiDockNodeFlags_DockSpace | ImGuiDockNodeFlags_CentralNode | ImGuiDockNodeFlags_NoTabBar | ImGuiDockNodeFlags_HiddenTabBar | ImGuiDockNodeFlags_NoWindowMenuButton | ImGuiDockNodeFlags_NoCloseButton, }

DataAuthority_ (enum)

Store the source authority (dock node vs window) of a field

MemberValueC++
auto0ImGuiDataAuthority_Auto
dock_node1ImGuiDataAuthority_DockNode
window2ImGuiDataAuthority_Window, }

DockNodeState (enum)

MemberValueC++
unknown0ImGuiDockNodeState_Unknown
host_window_hidden_because_single_window1ImGuiDockNodeState_HostWindowHiddenBecauseSingleWindow
host_window_hidden_because_windows_are_resizing2ImGuiDockNodeState_HostWindowHiddenBecauseWindowsAreResizing
host_window_visible3ImGuiDockNodeState_HostWindowVisible, }

DockNode (class)

sizeof() 176~216

AttributeC++
id_: IDImGuiID ID;
shared_flags: DockNodeFlagsImGuiDockNodeFlags SharedFlags;(Write) Flags shared by all nodes of a same dockspace hierarchy (inherited from the root node)
local_flags: DockNodeFlagsImGuiDockNodeFlags LocalFlags;(Write) Flags specific to this node
local_flags_in_windows: DockNodeFlagsImGuiDockNodeFlags LocalFlagsInWindows;(Write) Flags specific to this node, applied from windows
merged_flags: DockNodeFlagsImGuiDockNodeFlags MergedFlags;(Read) Effective flags (== SharedFlags | LocalFlagsInNode | LocalFlagsInWindows)
state: DockNodeStateImGuiDockNodeState State;
parent_node: DockNodeImGuiDockNode* ParentNode;
windows: ImVector_Window_ptrImVector<ImGuiWindow*> Windows;Note: unordered list! Iterate TabBar->Tabs for user-order.
tab_bar: TabBarImGuiTabBar* TabBar;
pos: ImVec2ImVec2 Pos;Current position
size: ImVec2ImVec2 Size;Current size
size_ref: ImVec2ImVec2 SizeRef;[Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size.
split_axis: AxisImGuiAxis SplitAxis;[Split node only] Split axis (X or Y)
last_bg_color: ImU32ImU32 LastBgColor;
window_class: WindowClassImGuiWindowClass WindowClass;[Root node only]
host_window: WindowImGuiWindow* HostWindow;
visible_window: WindowImGuiWindow* VisibleWindow;Generally point to window which is ID is == SelectedTabID, but when CTRL+Tabbing this can be a different window.
central_node: DockNodeImGuiDockNode* CentralNode;[Root node only] Pointer to central node.
only_node_with_windows: DockNodeImGuiDockNode* OnlyNodeWithWindows;[Root node only] Set when there is a single visible node within the hierarchy.
count_node_with_windows: intint CountNodeWithWindows;[Root node only]
last_frame_alive: intint LastFrameAlive;Last frame number the node was updated or kept alive explicitly with DockSpace() + ImGuiDockNodeFlags_KeepAliveOnly
last_frame_active: intint LastFrameActive;Last frame number the node was updated.
last_frame_focused: intint LastFrameFocused;Last frame number the node was focused.
last_focused_node_id: IDImGuiID LastFocusedNodeId;[Root node only] Which of our child docking node (any ancestor in the hierarchy) was last focused.
selected_tab_id: IDImGuiID SelectedTabId;[Leaf node only] Which of our tab/window is selected.
want_close_tab_id: IDImGuiID WantCloseTabId;[Leaf node only] Set when closing a specific tab/window.
ref_viewport_id: IDImGuiID RefViewportId;Reference viewport ID from visible window when HostWindow == None.
DockNode.__init__
def __init__(self, id_: ID) -> None
ImGuiDockNode(ImGuiID id);
DockNode.is_root_node
def is_root_node(self) -> bool
bool IsRootNode() const;

(private API)

DockNode.is_dock_space
def is_dock_space(self) -> bool
bool IsDockSpace() const;

(private API)

DockNode.is_floating_node
def is_floating_node(self) -> bool
bool IsFloatingNode() const;

(private API)

DockNode.is_central_node
def is_central_node(self) -> bool
bool IsCentralNode() const;

(private API)

DockNode.is_hidden_tab_bar
def is_hidden_tab_bar(self) -> bool
bool IsHiddenTabBar() const;

(private API)

Hidden tab bar can be shown back by clicking the small triangle

DockNode.is_no_tab_bar
def is_no_tab_bar(self) -> bool
bool IsNoTabBar() const;

(private API)

Never show a tab bar

DockNode.is_split_node
def is_split_node(self) -> bool
bool IsSplitNode() const;

(private API)

DockNode.is_leaf_node
def is_leaf_node(self) -> bool
bool IsLeafNode() const;

(private API)

DockNode.is_empty
def is_empty(self) -> bool
bool IsEmpty() const;

(private API)

DockNode.rect
def rect(self) -> ImRect
ImRect Rect() const;

(private API)

DockNode.set_local_flags
def set_local_flags(self, flags: DockNodeFlags) -> None
void SetLocalFlags(ImGuiDockNodeFlags flags);

(private API)

DockNode.update_merged_flags
def update_merged_flags(self) -> None
void UpdateMergedFlags();

(private API)

WindowDockStyleCol (enum)

List of colors that are stored at the time of Begin() into Docked Windows.
We currently store the packed colors in a simple array window->DockStyle.Colors[].
A better solution may involve appending into a log of colors in ImGuiContext + store offsets into those arrays in ImGuiWindow, but it would be more complex as we’d need to double-buffer both as e.g. drop target may refer to window from last frame.

MemberValueC++
text0ImGuiWindowDockStyleCol_Text
tab_hovered1ImGuiWindowDockStyleCol_TabHovered
tab_focused2ImGuiWindowDockStyleCol_TabFocused
tab_selected3ImGuiWindowDockStyleCol_TabSelected
tab_selected_overline4ImGuiWindowDockStyleCol_TabSelectedOverline
tab_dimmed5ImGuiWindowDockStyleCol_TabDimmed
tab_dimmed_selected6ImGuiWindowDockStyleCol_TabDimmedSelected
tab_dimmed_selected_overline7ImGuiWindowDockStyleCol_TabDimmedSelectedOverline
unsaved_marker8ImGuiWindowDockStyleCol_UnsavedMarker
count9ImGuiWindowDockStyleCol_COUNT

WindowDockStyle (class)

We don’t store style.Alpha: dock_node->LastBgColor embeds it and otherwise it would only affect the docking tab, which intuitively I would say we don’t want to.

WindowDockStyle.__init__
def __init__(self) -> None

Auto-generated default constructor

DockContext (class)

AttributeC++
nodes: StorageImGuiStorage Nodes;Map ID -> ImGuiDockNode*: Active nodes
want_full_rebuild: boolbool WantFullRebuild;
DockContext.__init__
def __init__(self) -> None
ImGuiDockContext();

Viewport support

ViewportP (class)

ImGuiViewport Private/Internals fields (cardinal sin: we are using inheritance!)
Every instance of ImGuiViewport is in fact a ImGuiViewportP.

AttributeC++
window: WindowImGuiWindow* Window;Set when the viewport is owned by a window (and ImGuiViewportFlags_CanHostOtherWindows is NOT set)
idx: intint Idx;
last_frame_active: intint LastFrameActive;Last frame number this viewport was activated by a window
last_focused_stamp_count: intint LastFocusedStampCount;Last stamp number from when a window hosted by this viewport was focused (by comparing this value between two viewport we have an implicit viewport z-order we use as fallback)
last_name_hash: IDImGuiID LastNameHash;
last_pos: ImVec2ImVec2 LastPos;
last_size: ImVec2ImVec2 LastSize;
alpha: floatfloat Alpha;Window opacity (when dragging dockable windows/viewports we make them transparent)
last_alpha: floatfloat LastAlpha;
last_focused_had_nav_window: boolbool LastFocusedHadNavWindow;Instead of maintaining a LastFocusedWindow (which may harder to correctly maintain), we merely store weither NavWindow != None last time the viewport was focused.
platform_monitor: intshort PlatformMonitor;
bg_fg_draw_lists_last_frame_active: np.ndarrayint BgFgDrawListsLastFrameActive[2];ndarray[type=int, size=2] # Last frame the background (0) and foreground (1) draw lists were used.
bg_fg_draw_lists_last_time_active: np.ndarrayfloat BgFgDrawListsLastTimeActive[2];ndarray[type=float, size=2] # Timestamps for Gc.
draw_data_p: ImDrawDataImDrawData DrawDataP;
draw_data_builder: ImDrawDataBuilderImDrawDataBuilder DrawDataBuilder;Temporary data while building final ImDrawData
last_platform_pos: ImVec2ImVec2 LastPlatformPos;
last_platform_size: ImVec2ImVec2 LastPlatformSize;
last_renderer_size: ImVec2ImVec2 LastRendererSize;
work_inset_min: ImVec2ImVec2 WorkInsetMin;Work Area inset locked for the frame. GetWorkRect() always fits within GetMainRect().
work_inset_max: ImVec2ImVec2 WorkInsetMax;"
build_work_inset_min: ImVec2ImVec2 BuildWorkInsetMin;Work Area inset accumulator for current frame, to become next frame’s WorkInset
build_work_inset_max: ImVec2ImVec2 BuildWorkInsetMax;"
ViewportP.__init__
def __init__(self) -> None
ImGuiViewportP();
ViewportP.clear_request_flags
def clear_request_flags(self) -> None
void ClearRequestFlags();

(private API)

ViewportP.calc_work_rect_pos
def calc_work_rect_pos(self, inset_min: ImVec2Like) -> ImVec2
ImVec2 CalcWorkRectPos(const ImVec2& inset_min) const;

(private API)

Calculate work rect pos/size given a set of offset (we have 1 pair of offset for rect locked from last frame data, and 1 pair for currently building rect)

ViewportP.calc_work_rect_size
def calc_work_rect_size(self, inset_min: ImVec2Like, inset_max: ImVec2Like) -> ImVec2
ImVec2 CalcWorkRectSize(const ImVec2& inset_min, const ImVec2& inset_max) const;

(private API)

ViewportP.update_work_rect
def update_work_rect(self) -> None
void UpdateWorkRect();

(private API)

Update public fields

ViewportP.get_main_rect
def get_main_rect(self) -> ImRect
ImRect GetMainRect() const;

(private API)

Helpers to retrieve ImRect (we don’t need to store BuildWorkRect as every access tend to change it, hence the code asymmetry)

ViewportP.get_work_rect
def get_work_rect(self) -> ImRect
ImRect GetWorkRect() const;

(private API)

ViewportP.get_build_work_rect
def get_build_work_rect(self) -> ImRect
ImRect GetBuildWorkRect() const;

(private API)

Settings support

WindowSettings (class)

Windows data saved in imgui.ini file
Because we never destroy or rename ImGuiWindowSettings, we can store the names in a separate buffer easily. (this is designed to be stored in a ImChunkStream buffer, with the variable-length Name following our structure)

AttributeC++
id_: IDImGuiID ID;
pos: ImVec2ihImVec2ih Pos;NB: Settings position are stored RELATIVE to the viewport! Whereas runtime ones are absolute positions.
size: ImVec2ihImVec2ih Size;
viewport_pos: ImVec2ihImVec2ih ViewportPos;
viewport_id: IDImGuiID ViewportId;
dock_id: IDImGuiID DockId;ID of last known DockNode (even if the DockNode is invisible because it has only 1 active window), or 0 if none.
class_id: IDImGuiID ClassId;ID of window class if specified
dock_order: intshort DockOrder;Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
last_used_date: PackedDateImGuiPackedDate LastUsedDate;
WindowSettings.__init__
def __init__(self) -> None
ImGuiWindowSettings();
WindowSettings.get_name_str
def get_name_str(self) -> str

SettingsCleanupArgs (class)

AttributeC++
type_hash_filter: IDImGuiID TypeHashFilter = 0;Set to restrict cleanup to a given .ini type, e.g. == ImHashStr(“Window”), ImHashStr(“Table”). Otherwise every types supporting Cleanup will be affected.
discard_older_than_months: intint DiscardOlderThanMonths = 0;Enable to discard entries older than XX months.
discard_when_missing_date: boolbool DiscardWhenMissingDate = false;Enable to discard entries missing a date.
discard_all: boolbool DiscardAll = false;Enable to discard all entries = same as calling ClearIniSettings() except it may be filtered.
set_current_session_date_to_all: boolbool SetCurrentSessionDateToAll = false;Enable to write current SessionDate to all supporting entries. // Let us know in #9460 if you use this.
set_current_session_date_when_missing_date: boolbool SetCurrentSessionDateWhenMissingDate = false;Enable to write current SessionDate to all supporting entries missing a date. // Let us know in #9460 if you use this.
_discard_older_than_date: intint _DiscardOlderThanDate = 0;[Internal]
SettingsCleanupArgs.__init__
def __init__(self, type_hash_filter: ID = 0, discard_older_than_months: int = 0, discard_when_missing_date: bool = False, discard_all: bool = False, set_current_session_date_to_all: bool = False, set_current_session_date_when_missing_date: bool = False, _discard_older_than_date: int = 0) -> None

Auto-generated default constructor with named params

SettingsHandler (class)

AttributeC++
type_name: strconst char* TypeName;Short description stored in .ini file. Disallowed characters: ‘[’ ‘]’ # (const)
type_hash: IDImGuiID TypeHash;== ImHashStr(TypeName)
user_data: Anyvoid* UserData;
SettingsHandler.__init__
def __init__(self) -> None
ImGuiSettingsHandler();

Localization support

LocKey (enum)

This is experimental and not officially supported, it’ll probably fall short of features, if/when it does we may backtrack.

MemberValueC++
version_str0ImGuiLocKey_VersionStr
table_size_one1ImGuiLocKey_TableSizeOne
table_size_all_fit2ImGuiLocKey_TableSizeAllFit
table_size_all_default3ImGuiLocKey_TableSizeAllDefault
table_reset4ImGuiLocKey_TableReset
table_reset_order5ImGuiLocKey_TableResetOrder
table_reset_visibility6ImGuiLocKey_TableResetVisibility
windowing_main_menu_bar7ImGuiLocKey_WindowingMainMenuBar
windowing_popup8ImGuiLocKey_WindowingPopup
windowing_untitled9ImGuiLocKey_WindowingUntitled
open_link_s10ImGuiLocKey_OpenLink_s
copy_link11ImGuiLocKey_CopyLink
docking_hide_tab_bar12ImGuiLocKey_DockingHideTabBar
docking_hold_shift_to_dock13ImGuiLocKey_DockingHoldShiftToDock
docking_drag_to_undock_or_move_node14ImGuiLocKey_DockingDragToUndockOrMoveNode
count15ImGuiLocKey_COUNT

LocEntry (class)

AttributeC++
key: LocKeyImGuiLocKey Key;
text: strconst char* Text;(const)
LocEntry.__init__
def __init__(self, key: LocKey = LocKey()) -> None

Auto-generated default constructor with named params

Metrics, Debug Tools

DebugLogFlags_ (enum)

See IMGUI_DEBUG_LOG() and IMGUI_DEBUG_LOG_XXX() macros.

MemberValueC++
none0ImGuiDebugLogFlags_None = 0
event_error1 << 0ImGuiDebugLogFlags_EventError = 1 << 0Error submitted by IM_ASSERT_USER_ERROR()
event_active_id1 << 1ImGuiDebugLogFlags_EventActiveId = 1 << 1
event_focus1 << 2ImGuiDebugLogFlags_EventFocus = 1 << 2
event_popup1 << 3ImGuiDebugLogFlags_EventPopup = 1 << 3
event_nav1 << 4ImGuiDebugLogFlags_EventNav = 1 << 4
event_clipper1 << 5ImGuiDebugLogFlags_EventClipper = 1 << 5
event_selection1 << 6ImGuiDebugLogFlags_EventSelection = 1 << 6
event_io1 << 7ImGuiDebugLogFlags_EventIO = 1 << 7
event_font1 << 8ImGuiDebugLogFlags_EventFont = 1 << 8
event_input_routing1 << 9ImGuiDebugLogFlags_EventInputRouting = 1 << 9
event_docking1 << 10ImGuiDebugLogFlags_EventDocking = 1 << 10
event_viewport1 << 11ImGuiDebugLogFlags_EventViewport = 1 << 11
event_table1 << 12ImGuiDebugLogFlags_EventTable = 1 << 12
event_mask_DebugLogFlags_EventError | DebugLogFlags_EventActiveId | DebugLogFlags_EventFocus | DebugLogFlags_EventPopup | DebugLogFlags_EventNav | DebugLogFlags_EventClipper | DebugLogFlags_EventSelection | DebugLogFlags_EventTable | DebugLogFlags_EventIO | DebugLogFlags_EventFont | DebugLogFlags_EventInputRouting | DebugLogFlags_EventDocking | DebugLogFlags_EventViewportImGuiDebugLogFlags_EventMask_ = ImGuiDebugLogFlags_EventError | ImGuiDebugLogFlags_EventActiveId | ImGuiDebugLogFlags_EventFocus | ImGuiDebugLogFlags_EventPopup | ImGuiDebugLogFlags_EventNav | ImGuiDebugLogFlags_EventClipper | ImGuiDebugLogFlags_EventSelection | ImGuiDebugLogFlags_EventTable | ImGuiDebugLogFlags_EventIO | ImGuiDebugLogFlags_EventFont | ImGuiDebugLogFlags_EventInputRouting | ImGuiDebugLogFlags_EventDocking | ImGuiDebugLogFlags_EventViewport
output_to_tty1 << 20ImGuiDebugLogFlags_OutputToTTY = 1 << 20Also send output to TTY
output_to_debugger1 << 21ImGuiDebugLogFlags_OutputToDebugger = 1 << 21Also send output to Debugger Console [Windows only]
output_to_test_engine1 << 22ImGuiDebugLogFlags_OutputToTestEngine = 1 << 22Also send output to Dear ImGui Test Engine

DebugAllocEntry (class)

AttributeC++
frame_count: intint FrameCount;
alloc_count: ImS16ImS16 AllocCount;
free_count: ImS16ImS16 FreeCount;
DebugAllocEntry.__init__
def __init__(self, frame_count: int = int(), alloc_count: ImS16 = ImS16(), free_count: ImS16 = ImS16()) -> None

Auto-generated default constructor with named params

DebugAllocInfo (class)

AttributeC++
total_alloc_count: intint TotalAllocCount;Number of call to MemAlloc().
total_free_count: intint TotalFreeCount;
last_entries_idx: ImS16ImS16 LastEntriesIdx;Current index in buffer
DebugAllocInfo.__init__
def __init__(self) -> None
ImGuiDebugAllocInfo();

MetricsConfig (class)

AttributeC++
show_debug_log: boolbool ShowDebugLog = false;
show_id_stack_tool: boolbool ShowIDStackTool = false;
show_windows_rects: boolbool ShowWindowsRects = false;
show_windows_begin_order: boolbool ShowWindowsBeginOrder = false;
show_tables_rects: boolbool ShowTablesRects = false;
show_draw_cmd_mesh: boolbool ShowDrawCmdMesh = true;
show_draw_cmd_bounding_boxes: boolbool ShowDrawCmdBoundingBoxes = true;
show_text_encoding_viewer: boolbool ShowTextEncodingViewer = false;
show_texture_used_rect: boolbool ShowTextureUsedRect = false;
show_docking_nodes: boolbool ShowDockingNodes = false;
show_windows_rects_type: intint ShowWindowsRectsType = -1;
show_tables_rects_type: intint ShowTablesRectsType = -1;
highlight_monitor_idx: intint HighlightMonitorIdx = -1;
highlight_viewport_id: IDImGuiID HighlightViewportID = 0;
settings_discard_months: intint SettingsDiscardMonths = 6;
settings_highlight_old_entries: boolbool SettingsHighlightOldEntries = false;
show_font_preview: boolbool ShowFontPreview = true;
MetricsConfig.__init__
def __init__(self, show_debug_log: bool = False, show_id_stack_tool: bool = False, show_windows_rects: bool = False, show_windows_begin_order: bool = False, show_tables_rects: bool = False, show_draw_cmd_mesh: bool = True, show_draw_cmd_bounding_boxes: bool = True, show_text_encoding_viewer: bool = False, show_texture_used_rect: bool = False, show_docking_nodes: bool = False, show_windows_rects_type: int = -1, show_tables_rects_type: int = -1, highlight_monitor_idx: int = -1, highlight_viewport_id: ID = 0, settings_discard_months: int = 6, settings_highlight_old_entries: bool = False, show_font_preview: bool = True) -> None

Auto-generated default constructor with named params

StackLevelInfo (class)

AttributeC++
id_: IDImGuiID ID;
query_frame_count: ImS8ImS8 QueryFrameCount;>= 1: Sub-query in progress
query_success: boolbool QuerySuccess;Sub-query obtained result from DebugHookIdInfo()
data_type: ImS8ImS8 DataType;ImGuiDataType
desc_offset: intint DescOffset;-1 or offset into parent’s ResultsPathsBuf
StackLevelInfo.__init__
def __init__(self) -> None
ImGuiStackLevelInfo();

DebugItemPathQuery (class)

AttributeC++
main_id: IDImGuiID MainID;ID to query details for.
active: boolbool Active;Used to disambiguate the case when ID == 0 and e.g. some code calls PushOverrideID(0).
complete: boolbool Complete;All sub-queries are finished (some may have failed).
step: ImS8ImS8 Step;-1: query stack + init Results, >= 0: filling individual stack level.
results: ImVector_StackLevelInfoImVector<ImGuiStackLevelInfo> Results;
results_desc_buf: TextBufferImGuiTextBuffer ResultsDescBuf;
result_path_buf: TextBufferImGuiTextBuffer ResultPathBuf;
DebugItemPathQuery.__init__
def __init__(self) -> None
ImGuiDebugItemPathQuery();

IDStackTool (class)

State for ID Stack tool queries

AttributeC++
opt_hex_encode_non_ascii_chars: boolbool OptHexEncodeNonAsciiChars;
opt_copy_to_clipboard_on_ctrl_c: boolbool OptCopyToClipboardOnCtrlC;
last_active_frame: intint LastActiveFrame;
copy_to_clipboard_last_time: floatfloat CopyToClipboardLastTime;
IDStackTool.__init__
def __init__(self) -> None
ImGuiIDStackTool();

Generic context hooks

ContextHookType (enum)

[ADAPT_IMGUI_BUNDLE]: added ImGuiContextHookType_BeginWindow, ImGuiContextHookType_EndWindow (called at the start of Begin() and at the end of End())
They let a library that changes the coordinate space (e.g. the zoomable canvas of imgui-node-editor) know when a window is begun from inside it. cf thedmd/imgui-node-editor#242

MemberValueC++
new_frame_pre0ImGuiContextHookType_NewFramePre
new_frame_post1ImGuiContextHookType_NewFramePost
end_frame_pre2ImGuiContextHookType_EndFramePre
end_frame_post3ImGuiContextHookType_EndFramePost
render_pre4ImGuiContextHookType_RenderPre
render_post5ImGuiContextHookType_RenderPost
shutdown6ImGuiContextHookType_Shutdown
pending_removal_7ImGuiContextHookType_PendingRemoval_
begin_window8ImGuiContextHookType_BeginWindow
end_window9ImGuiContextHookType_EndWindow }

ContextHook (class)

AttributeC++
hook_id: IDImGuiID HookId;A unique ID assigned by AddContextHook()
type: ContextHookTypeImGuiContextHookType Type;
owner: IDImGuiID Owner;
user_data: Anyvoid* UserData;
ContextHook.__init__
def __init__(self) -> None
ImGuiContextHook();

ImGuiContext

Context (class)

AttributeC++
initialized: boolbool Initialized;
within_frame_scope: boolbool WithinFrameScope;Set by NewFrame(), cleared by EndFrame()
within_frame_scope_with_implicit_window: boolbool WithinFrameScopeWithImplicitWindow;Set by NewFrame(), cleared by EndFrame() when the implicit debug window has been pushed
test_engine_hook_items: boolbool TestEngineHookItems;Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
frame_count: intint FrameCount;
frame_count_ended: intint FrameCountEnded;
frame_count_platform_ended: intint FrameCountPlatformEnded;
frame_count_rendered: intint FrameCountRendered;
time: floatdouble Time;
io: IOImGuiIO IO;
platform_io: PlatformIOImGuiPlatformIO PlatformIO;
style: StyleImGuiStyle Style;
config_flags_curr_frame: ConfigFlagsImGuiConfigFlags ConfigFlagsCurrFrame;= g.IO.ConfigFlags at the time of NewFrame()
config_flags_last_frame: ConfigFlagsImGuiConfigFlags ConfigFlagsLastFrame;
font_atlases: ImVector_ImFontAtlas_ptrImVector<ImFontAtlas*> FontAtlases;List of font atlases used by the context (generally only contains g.IO.Fonts aka the main font atlas)
font: ImFontImFont* Font;Currently bound font. (== FontStack.back().Font)
font_baked: ImFontBakedImFontBaked* FontBaked;Currently bound font at currently bound size. (== Font->GetFontBaked(FontSize))
font_size: floatfloat FontSize;Currently bound font size == line height (== FontSizeBase + externals scales applied in the UpdateCurrentFontSize() function).
font_size_base: floatfloat FontSizeBase;Font size before scaling == style.FontSizeBase == value passed to PushFont() when specified.
font_baked_scale: floatfloat FontBakedScale;== FontBaked->Size / FontSize. Scale factor over baked size. Rarely used nowadays, very often == 1.0.
current_pixel_density: floatfloat CurrentPixelDensity;Current font density. Used by all calls to GetFontBaked().
current_dpi_scale: floatfloat CurrentDpiScale;Current window/viewport DpiScale == CurrentViewport->DpiScale
draw_list_shared_data: ImDrawListSharedDataImDrawListSharedData DrawListSharedData;
within_end_child_id: IDImGuiID WithinEndChildID;Set within EndChild()
within_end_popup_id: IDImGuiID WithinEndPopupID;Set within EndPopup()
test_engine: Anyvoid* TestEngine;Test engine user data
input_events_queue: ImVector_InputEventImVector<ImGuiInputEvent> InputEventsQueue;Input events which will be trickled/written into IO structure.
input_events_trail: ImVector_InputEventImVector<ImGuiInputEvent> InputEventsTrail;Past input events processed in NewFrame(). This is to allow domain-specific application to access e.g mouse/pen trail.
input_events_next_mouse_source: MouseSourceImGuiMouseSource InputEventsNextMouseSource;
input_events_next_event_id: ImU32ImU32 InputEventsNextEventId;
windows: ImVector_Window_ptrImVector<ImGuiWindow*> Windows;Windows, sorted in display order, back to front
windows_focus_order: ImVector_Window_ptrImVector<ImGuiWindow*> WindowsFocusOrder;Root windows, sorted in focus order, back to front.
windows_temp_sort_buffer: ImVector_Window_ptrImVector<ImGuiWindow*> WindowsTempSortBuffer;Temporary buffer used in EndFrame() to reorder windows so parents are kept before their child
current_window_stack: ImVector_WindowStackDataImVector<ImGuiWindowStackData> CurrentWindowStack;
windows_by_id: StorageImGuiStorage WindowsById;Map window’s ImGuiID to ImGuiWindow*
windows_active_count: intint WindowsActiveCount;Number of unique windows submitted by frame
windows_border_hover_padding: floatfloat WindowsBorderHoverPadding;Padding around resizable windows for which hovering on counts as hovering the window == ImMax(style.TouchExtraPadding, style.WindowBorderHoverPadding). This isn’t so multi-dpi friendly.
debug_break_in_window: IDImGuiID DebugBreakInWindow;Set to break in Begin() call.
current_window: WindowImGuiWindow* CurrentWindow;Window being drawn into
hovered_window: WindowImGuiWindow* HoveredWindow;Window the mouse is hovering. Will typically catch mouse inputs.
hovered_window_under_moving_window: WindowImGuiWindow* HoveredWindowUnderMovingWindow;Hovered window ignoring MovingWindow. Only set if MovingWindow is set.
hovered_window_before_clear: WindowImGuiWindow* HoveredWindowBeforeClear;Window the mouse is hovering. Filled even with _NoMouse. This is currently useful for multi-context compositors.
moving_window: WindowImGuiWindow* MovingWindow;Track the window we clicked on (in order to preserve focus). The actual window that is moved is generally MovingWindow->RootWindowDockTree.
wheeling_window: WindowImGuiWindow* WheelingWindow;Track the window we started mouse-wheeling on. Until a timer elapse or mouse has moved, generally keep scrolling the same window even if during the course of scrolling the mouse ends up hovering a child window.
wheeling_window_ref_mouse_pos: ImVec2ImVec2 WheelingWindowRefMousePos;
wheeling_window_start_frame: intint WheelingWindowStartFrame;This may be set one frame before WheelingWindow is != None
wheeling_window_scrolled_frame: intint WheelingWindowScrolledFrame;
wheeling_window_release_timer: floatfloat WheelingWindowReleaseTimer;
wheeling_window_wheel_remainder: ImVec2ImVec2 WheelingWindowWheelRemainder;
wheeling_axis_avg: ImVec2ImVec2 WheelingAxisAvg;
mixed_value_label: strconst char* MixedValueLabel;Value replacement when displaying a mixed value. Default to “-” (Unreal uses “Multiple values”, Unity uses “---”). May be interpreted as a format: must not contain single %. Set to None to display original value. # (const)
debug_draw_id_conflicts_id: IDImGuiID DebugDrawIdConflictsId;Set when we detect multiple items with the same identifier
debug_hook_id_info_id: IDImGuiID DebugHookIdInfoId;Will call core hooks: DebugHookIdInfo() from GetID functions, used by ID Stack Tool [next HoveredId/ActiveId to not pull in an extra cache-line]
hovered_id: IDImGuiID HoveredId;Hovered widget, filled during the frame
hovered_id_previous_frame: IDImGuiID HoveredIdPreviousFrame;
hovered_id_previous_frame_item_count: intint HoveredIdPreviousFrameItemCount;Count numbers of items using the same ID as last frame’s hovered id
hovered_id_timer: floatfloat HoveredIdTimer;Measure contiguous hovering time
hovered_id_not_active_timer: floatfloat HoveredIdNotActiveTimer;Measure contiguous hovering time where the item has not been active
hovered_id_allow_overlap: boolbool HoveredIdAllowOverlap;
hovered_id_is_disabled: boolbool HoveredIdIsDisabled;At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be True even if HoveredId == 0.
item_unclip_by_log: boolbool ItemUnclipByLog;Disable ItemAdd() clipping, essentially a memory-locality friendly copy of LogEnabled
any_id_has_been_edited_this_frame: boolbool AnyIdHasBeenEditedThisFrame;
active_id: IDImGuiID ActiveId;Active widget
active_id_is_alive: IDImGuiID ActiveIdIsAlive;Active widget has been seen this frame (we can’t use a bool as the ActiveId may change within the frame)
active_id_timer: floatfloat ActiveIdTimer;
active_id_is_just_activated: boolbool ActiveIdIsJustActivated;Set at the time of activation for one frame
active_id_was_selected: boolbool ActiveIdWasSelected;Active ID was selected at the time of activating
active_id_was_sole_selected: boolbool ActiveIdWasSoleSelected;Active ID was sole selection at the time of activating
active_id_allow_overlap: boolbool ActiveIdAllowOverlap;Active widget allows another widget to steal active id (generally for overlapping widgets, but not always)
active_id_no_clear_on_focus_loss: boolbool ActiveIdNoClearOnFocusLoss;Disable losing active id if the active id window gets unfocused.
active_id_has_been_pressed_before: boolbool ActiveIdHasBeenPressedBefore;Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch.
active_id_has_been_edited_before: boolbool ActiveIdHasBeenEditedBefore;Was the value associated to the widget Edited over the course of the Active state.
active_id_has_been_edited_this_frame: boolbool ActiveIdHasBeenEditedThisFrame;
active_id_from_shortcut: boolbool ActiveIdFromShortcut;
active_id_mouse_button: ImS8ImS8 ActiveIdMouseButton;
active_id_disabled_id: IDImGuiID ActiveIdDisabledId;When clicking a disabled item we set ActiveId=window->MoveId to avoid interference with widget code. Actual item ID is stored here.
active_id_click_offset: ImVec2ImVec2 ActiveIdClickOffset;Clicked offset from upper-left corner, if applicable (currently only set by ButtonBehavior)
active_id_source: InputSourceImGuiInputSource ActiveIdSource;Activating source: ImGuiInputSource_Mouse OR ImGuiInputSource_Keyboard OR ImGuiInputSource_Gamepad
active_id_window: WindowImGuiWindow* ActiveIdWindow;
active_id_previous_frame: IDImGuiID ActiveIdPreviousFrame;
deactivated_item_data: DeactivatedItemDataImGuiDeactivatedItemData DeactivatedItemData;
active_id_value_on_activation: DataTypeStorageImGuiDataTypeStorage ActiveIdValueOnActivation;Backup of initial value at the time of activation. ONLY SET BY SPECIFIC WIDGETS: DragXXX and SliderXXX.
last_active_id: IDImGuiID LastActiveId;Store the last non-zero ActiveId, useful for animation.
last_active_id_timer: floatfloat LastActiveIdTimer;Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
last_active_id_was_selected: boolbool LastActiveIdWasSelected;
last_active_id_was_sole_selected: boolbool LastActiveIdWasSoleSelected;
last_key_mods_change_time: floatdouble LastKeyModsChangeTime;Record the last time key mods changed (affect repeat delay when using shortcut logic)
last_key_mods_change_from_none_time: floatdouble LastKeyModsChangeFromNoneTime;Record the last time key mods changed away from being 0 (affect repeat delay when using shortcut logic)
last_keyboard_key_press_time: floatdouble LastKeyboardKeyPressTime;Record the last time a keyboard key (ignore mouse/gamepad ones) was pressed.
keys_routing_table: KeyRoutingTableImGuiKeyRoutingTable KeysRoutingTable;
active_id_using_nav_dir_mask: ImU32ImU32 ActiveIdUsingNavDirMask;Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
active_id_using_all_keyboard_keys: boolbool ActiveIdUsingAllKeyboardKeys;Active widget will want to read all keyboard keys inputs. (this is a shortcut for not taking ownership of 100+ keys, frequently used by drag operations)
debug_break_in_shortcut_routing: KeyChordImGuiKeyChord DebugBreakInShortcutRouting;Set to break in SetShortcutRouting()/Shortcut() calls.
current_focus_scope_id: IDImGuiID CurrentFocusScopeId;Value for currently appending items == g.FocusScopeStack.back(). Not to be mistaken with g.NavFocusScopeId.
current_item_flags: ItemFlagsImGuiItemFlags CurrentItemFlags;Value for currently appending items == g.ItemFlagsStack.back()
debug_locate_id: IDImGuiID DebugLocateId;Storage for DebugLocateItemOnHover() feature: this is read by ItemAdd() so we keep it in a hot/cached location
next_item_data: NextItemDataImGuiNextItemData NextItemData;Storage for SetNextItem** functions
last_item_data: LastItemDataImGuiLastItemData LastItemData;Storage for last submitted item (setup by ItemAdd)
next_window_data: NextWindowDataImGuiNextWindowData NextWindowData;Storage for SetNextWindow** functions
debug_show_group_rects: boolbool DebugShowGroupRects;
gc_compact_all: boolbool GcCompactAll;Request full GC
debug_flash_style_color_idx: ColImGuiCol DebugFlashStyleColorIdx;(Keep close to ColorStack to share cache line)
color_stack: ImVector_ColorModImVector<ImGuiColorMod> ColorStack;Stack for PushStyleColor()/PopStyleColor() - inherited by Begin()
style_var_stack: ImVector_StyleModImVector<ImGuiStyleMod> StyleVarStack;Stack for PushStyleVar()/PopStyleVar() - inherited by Begin()
focus_scope_stack: ImVector_FocusScopeDataImVector<ImGuiFocusScopeData> FocusScopeStack;Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin()
item_flags_stack: ImVector_ItemFlagsImVector<ImGuiItemFlags> ItemFlagsStack;Stack for PushItemFlag()/PopItemFlag() - inherited by Begin()
group_stack: ImVector_GroupDataImVector<ImGuiGroupData> GroupStack;Stack for BeginGroup()/EndGroup() - not inherited by Begin()
open_popup_stack: ImVector_PopupDataImVector<ImGuiPopupData> OpenPopupStack;Which popups are open (persistent)
begin_popup_stack: ImVector_PopupDataImVector<ImGuiPopupData> BeginPopupStack;Which level of BeginPopup() we are in (reset every frame)
tree_node_stack: ImVector_TreeNodeStackDataImVector<ImGuiTreeNodeStackData>TreeNodeStack;Stack for TreeNode()
viewports: ImVector_ViewportP_ptrImVector<ImGuiViewportP*> Viewports;Active viewports (always 1+, and generally 1 unless multi-viewports are enabled). Each viewports hold their copy of ImDrawData.
current_viewport: ViewportPImGuiViewportP* CurrentViewport;We track changes of viewport (happening in Begin) so we can call Platform_OnChangedViewport()
mouse_viewport: ViewportPImGuiViewportP* MouseViewport;
mouse_last_hovered_viewport: ViewportPImGuiViewportP* MouseLastHoveredViewport;Last known viewport that was hovered by mouse (even if we are not hovering any viewport any more) + honoring the _NoInputs flag.
platform_last_focused_viewport_id: IDImGuiID PlatformLastFocusedViewportId;
fallback_monitor: PlatformMonitorImGuiPlatformMonitor FallbackMonitor;Virtual monitor used as fallback if backend doesn’t provide monitor information.
platform_monitors_full_work_rect: ImRectImRect PlatformMonitorsFullWorkRect;Bounding box of all platform monitors
viewport_created_count: intint ViewportCreatedCount;Unique sequential creation counter (mostly for testing/debugging)
platform_windows_created_count: intint PlatformWindowsCreatedCount;Unique sequential creation counter (mostly for testing/debugging)
viewport_focused_stamp_count: intint ViewportFocusedStampCount;Every time the front-most window changes, we stamp its viewport with an incrementing counter
nav_cursor_visible: boolbool NavCursorVisible;Nav focus cursor/rectangle is visible? We hide it after a mouse click. We show it after a nav move.
nav_highlight_item_under_nav: boolbool NavHighlightItemUnderNav;Disable mouse hovering highlight. Highlight navigation focused item instead of mouse hovered item.
nav_mouse_pos_dirty: boolbool NavMousePosDirty;When set we will update mouse position if io.ConfigNavMoveSetMousePos is set (not enabled by default)
nav_id_is_alive: boolbool NavIdIsAlive;Nav widget has been seen this frame ~~ NavRectRel is valid
nav_id: IDImGuiID NavId;Focused item for navigation
nav_window: WindowImGuiWindow* NavWindow;Focused window for navigation. Could be called ‘FocusedWindow’
nav_focus_scope_id: IDImGuiID NavFocusScopeId;Focused focus scope (e.g. selection code often wants to “clear other items” when landing on an item of the same scope)
nav_layer: NavLayerImGuiNavLayer NavLayer;Focused layer (main scrolling layer, or menu/title bar layer)
nav_id_item_flags: ItemFlagsImGuiItemFlags NavIdItemFlags;
nav_activate_id: IDImGuiID NavActivateId;~~ (g.ActiveId == 0) && (IsKeyPressed(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate)) ? NavId : 0, also set when calling ActivateItemByID()
nav_activate_down_id: IDImGuiID NavActivateDownId;~~ IsKeyDown(ImGuiKey_Space) || IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_NavGamepadActivate) ? NavId : 0
nav_activate_pressed_id: IDImGuiID NavActivatePressedId;~~ IsKeyPressed(ImGuiKey_Space) || IsKeyPressed(ImGuiKey_Enter) || IsKeyPressed(ImGuiKey_NavGamepadActivate) ? NavId : 0 (no repeat)
nav_activate_flags: ActivateFlagsImGuiActivateFlags NavActivateFlags;
nav_focus_route: ImVector_FocusScopeDataImVector<ImGuiFocusScopeData> NavFocusRoute;Reversed copy focus scope stack for NavId (should contains NavFocusScopeId). This essentially follow the window->ParentWindowForFocusRoute chain.
nav_highlight_activated_id: IDImGuiID NavHighlightActivatedId;
nav_highlight_activated_timer: floatfloat NavHighlightActivatedTimer;
nav_open_context_menu_item_id: IDImGuiID NavOpenContextMenuItemId;
nav_open_context_menu_window_id: IDImGuiID NavOpenContextMenuWindowId;
nav_next_activate_id: IDImGuiID NavNextActivateId;Set by ActivateItemByID(), queued until next frame.
nav_next_activate_flags: ActivateFlagsImGuiActivateFlags NavNextActivateFlags;
nav_input_source: InputSourceImGuiInputSource NavInputSource;Keyboard or Gamepad mode? THIS CAN ONLY BE ImGuiInputSource_Keyboard or ImGuiInputSource_Gamepad
nav_last_valid_selection_user_data: SelectionUserDataImGuiSelectionUserData NavLastValidSelectionUserData;Last valid data passed to SetNextItemSelectionUser(), or -1. For current window. Not reset when focusing an item that doesn’t have selection data.
nav_cursor_hide_frames: ImS8ImS8 NavCursorHideFrames;
nav_any_request: boolbool NavAnyRequest;~~ NavMoveRequest || NavInitRequest this is to perform early out in ItemAdd()
nav_init_request: boolbool NavInitRequest;Init request for appearing window to select first item
nav_init_request_from_move: boolbool NavInitRequestFromMove;
nav_init_result: NavItemDataImGuiNavItemData NavInitResult;Init request result (first item of the window, or one for which SetItemDefaultFocus() was called)
nav_move_submitted: boolbool NavMoveSubmitted;Move request submitted, will process result on next NewFrame()
nav_move_scoring_items: boolbool NavMoveScoringItems;Move request submitted, still scoring incoming items
nav_move_forward_to_next_frame: boolbool NavMoveForwardToNextFrame;
nav_move_flags: NavMoveFlagsImGuiNavMoveFlags NavMoveFlags;
nav_move_scroll_flags: ScrollFlagsImGuiScrollFlags NavMoveScrollFlags;
nav_move_key_mods: KeyChordImGuiKeyChord NavMoveKeyMods;
nav_move_dir: DirImGuiDir NavMoveDir;Direction of the move request (left/right/up/down)
nav_move_dir_for_debug: DirImGuiDir NavMoveDirForDebug;
nav_move_clip_dir: DirImGuiDir NavMoveClipDir;FIXME-NAV: Describe the purpose of this better. Might want to rename?
nav_scoring_rect: ImRectImRect NavScoringRect;Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
nav_scoring_no_clip_rect: ImRectImRect NavScoringNoClipRect;Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted. Unset/invalid if inverted.
nav_scoring_debug_count: intint NavScoringDebugCount;Metrics for debugging
nav_tabbing_dir: intint NavTabbingDir;Generally -1 or +1, 0 when tabbing without a nav id
nav_tabbing_counter: intint NavTabbingCounter;>0 when counting items for tabbing
nav_move_result_local: NavItemDataImGuiNavItemData NavMoveResultLocal;Best move request candidate within NavWindow
nav_move_result_local_visible: NavItemDataImGuiNavItemData NavMoveResultLocalVisible;Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
nav_move_result_other: NavItemDataImGuiNavItemData NavMoveResultOther;Best move request candidate within NavWindow’s flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
nav_tabbing_result_first: NavItemDataImGuiNavItemData NavTabbingResultFirst;First tabbing request candidate within NavWindow and flattened hierarchy
nav_just_moved_from_focus_scope_id: IDImGuiID NavJustMovedFromFocusScopeId;Just navigated from this focus scope id (result of a successfully MoveRequest).
nav_just_moved_to_id: IDImGuiID NavJustMovedToId;Just navigated to this id (result of a successfully MoveRequest).
nav_just_moved_to_focus_scope_id: IDImGuiID NavJustMovedToFocusScopeId;Just navigated to this focus scope id (result of a successfully MoveRequest).
nav_just_moved_to_key_mods: KeyChordImGuiKeyChord NavJustMovedToKeyMods;
nav_just_moved_to_is_tabbing: boolbool NavJustMovedToIsTabbing;Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
nav_just_moved_to_has_selection_data: boolbool NavJustMovedToHasSelectionData;Copy of move result’s ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
config_nav_enable_tabbing: boolbool ConfigNavEnableTabbing;= True. Enable tabbing (Tab, Shift+Tab). PLEASE LET ME KNOW IF YOU USE THIS.
config_nav_windowing_with_gamepad: boolbool ConfigNavWindowingWithGamepad;= True. Enable Ctrl+Tab by holding ImGuiKey_GamepadFaceLeft (== ImGuiKey_NavGamepadMenu). When False, the button may still be used to toggle Menu layer.
config_nav_windowing_key_next: KeyChordImGuiKeyChord ConfigNavWindowingKeyNext;= ImGuiMod_Ctrl | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiKey_Tab on OS X). Set to 0 to disable. For reconfiguration (see #4828)
config_nav_windowing_key_prev: KeyChordImGuiKeyChord ConfigNavWindowingKeyPrev;= ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab (or ImGuiMod_Super | ImGuiMod_Shift | ImGuiKey_Tab on OS X)
nav_windowing_target: WindowImGuiWindow* NavWindowingTarget;Target window when doing Ctrl+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most!
nav_windowing_target_anim: WindowImGuiWindow* NavWindowingTargetAnim;Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0, so the fade-out can stay on it.
nav_windowing_list_window: WindowImGuiWindow* NavWindowingListWindow;Internal window actually listing the Ctrl+Tab contents
nav_windowing_timer: floatfloat NavWindowingTimer;
nav_windowing_highlight_alpha: floatfloat NavWindowingHighlightAlpha;
nav_windowing_input_source: InputSourceImGuiInputSource NavWindowingInputSource;
nav_windowing_toggle_layer: boolbool NavWindowingToggleLayer;Set while Alt or GamepadMenu is held, may be cleared by other operations, and processed when releasing the key.
nav_windowing_toggle_key: KeyImGuiKey NavWindowingToggleKey;Keyboard/gamepad key used when toggling to menu layer.
nav_windowing_accum_delta_pos: ImVec2ImVec2 NavWindowingAccumDeltaPos;
nav_windowing_accum_delta_size: ImVec2ImVec2 NavWindowingAccumDeltaSize;
dim_bg_ratio: floatfloat DimBgRatio;0.0..1.0 animation when fading in a dimming background (for modal window and Ctrl+Tab list)
drag_drop_active: boolbool DragDropActive;
drag_drop_within_source: boolbool DragDropWithinSource;Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag source.
drag_drop_within_target: boolbool DragDropWithinTarget;Set when within a BeginDragDropXXX/EndDragDropXXX block for a drag target.
drag_drop_source_flags: DragDropFlagsImGuiDragDropFlags DragDropSourceFlags;
drag_drop_source_frame_count: intint DragDropSourceFrameCount;
drag_drop_mouse_button: intint DragDropMouseButton;
drag_drop_payload: PayloadImGuiPayload DragDropPayload;
drag_drop_target_rect: ImRectImRect DragDropTargetRect;Store rectangle of current target candidate (we favor small targets when overlapping)
drag_drop_target_clip_rect: ImRectImRect DragDropTargetClipRect;Store ClipRect at the time of item’s drawing
drag_drop_target_id: IDImGuiID DragDropTargetId;
drag_drop_target_full_viewport: IDImGuiID DragDropTargetFullViewport;
drag_drop_accept_flags_curr: DragDropFlagsImGuiDragDropFlags DragDropAcceptFlagsCurr;
drag_drop_accept_flags_prev: DragDropFlagsImGuiDragDropFlags DragDropAcceptFlagsPrev;
drag_drop_accept_id_curr_rect_surface: floatfloat DragDropAcceptIdCurrRectSurface;Target item surface (we resolve overlapping targets by prioritizing the smaller surface)
drag_drop_accept_id_curr: IDImGuiID DragDropAcceptIdCurr;Target item id (set at the time of accepting the payload)
drag_drop_accept_id_prev: IDImGuiID DragDropAcceptIdPrev;Target item id from previous frame (we need to store this to allow for overlapping drag and drop targets)
drag_drop_accept_frame_count: intint DragDropAcceptFrameCount;Last time a target expressed a desire to accept the source
drag_drop_hold_just_pressed_id: IDImGuiID DragDropHoldJustPressedId;Set when holding a payload just made ButtonBehavior() return a press.
drag_drop_payload_buf_heap: ImVector_ucharImVector<uchar> DragDropPayloadBufHeap;We don’t expose the ImVector<> directly, ImGuiPayload only holds pointer+size
clipper_temp_data_stacked: intint ClipperTempDataStacked;
clipper_temp_data: ImVector_ListClipperDataImVector<ImGuiListClipperData> ClipperTempData;
current_table: TableImGuiTable* CurrentTable;
debug_break_in_table: IDImGuiID DebugBreakInTable;Set to break in BeginTable() call.
tables_temp_data_stacked: intint TablesTempDataStacked;Temporary table data size (because we leave previous instances undestructed, we generally don’t use TablesTempData.Size)
tables_temp_data: ImVector_TableTempDataImVector<ImGuiTableTempData> TablesTempData;Temporary table data (buffers reused/shared across instances, support nesting)
tables_last_time_active: ImVector_floatImVector<float> TablesLastTimeActive;Last used timestamp of each tables (SOA, for efficient GC)
draw_channels_temp_merge_buffer: ImVector_ImDrawChannelImVector<ImDrawChannel> DrawChannelsTempMergeBuffer;
current_tab_bar: TabBarImGuiTabBar* CurrentTabBar;
current_tab_bar_stack: ImVector_PtrOrIndexImVector<ImGuiPtrOrIndex> CurrentTabBarStack;
shrink_width_buffer: ImVector_ShrinkWidthItemImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer;
box_select_state: BoxSelectStateImGuiBoxSelectState BoxSelectState;
current_multi_select: MultiSelectTempDataImGuiMultiSelectTempData* CurrentMultiSelect;
multi_select_temp_data_stacked: intint MultiSelectTempDataStacked;Temporary multi-select data size (because we leave previous instances undestructed, we generally don’t use MultiSelectTempData.Size)
multi_select_temp_data: ImVector_MultiSelectTempDataImVector<ImGuiMultiSelectTempData> MultiSelectTempData;
hover_item_delay_id: IDImGuiID HoverItemDelayId;
hover_item_delay_id_previous_frame: IDImGuiID HoverItemDelayIdPreviousFrame;
hover_item_delay_timer: floatfloat HoverItemDelayTimer;Currently used by IsItemHovered()
hover_item_delay_clear_timer: floatfloat HoverItemDelayClearTimer;Currently used by IsItemHovered(): grace time before g.TooltipHoverTimer gets cleared.
hover_item_unlocked_stationary_id: IDImGuiID HoverItemUnlockedStationaryId;Mouse has once been stationary on this item. Only reset after departing the item.
hover_window_unlocked_stationary_id: IDImGuiID HoverWindowUnlockedStationaryId;Mouse has once been stationary on this window. Only reset after departing the window.
mouse_cursor: MouseCursorImGuiMouseCursor MouseCursor;
mouse_stationary_timer: floatfloat MouseStationaryTimer;Time the mouse has been stationary (with some loose heuristic)
mouse_last_valid_pos: ImVec2ImVec2 MouseLastValidPos;
input_text_state: InputTextStateImGuiInputTextState InputTextState;
input_text_line_index: TextIndexImGuiTextIndex InputTextLineIndex;Temporary storage
input_text_deactivated_state: InputTextDeactivatedStateImGuiInputTextDeactivatedState InputTextDeactivatedState;
input_text_password_font_backup_baked: ImFontBakedImFontBaked InputTextPasswordFontBackupBaked;
input_text_password_font_backup_flags: ImFontFlagsImFontFlags InputTextPasswordFontBackupFlags;
input_text_reactivate_id: IDImGuiID InputTextReactivateId;ID of InputText to reactivate on next frame (for io.ConfigInputTextEnterKeepActive behavior)
temp_input_id: IDImGuiID TempInputId;Temporary text input when using Ctrl+Click on a slider, etc.
data_type_zero_value: DataTypeStorageImGuiDataTypeStorage DataTypeZeroValue;0 for all data types
begin_menu_depth: intint BeginMenuDepth;
begin_combo_depth: intint BeginComboDepth;
color_edit_current_id: IDImGuiID ColorEditCurrentID;Set temporarily while inside of the parent-most ColorEdit4/ColorPicker4 (because they call each others).
color_edit_saved_id: IDImGuiID ColorEditSavedID;ID we are saving/restoring HS for
color_edit_saved_hue: floatfloat ColorEditSavedHue;Backup of last Hue associated to LastColor, so we can restore Hue in lossy RGB<>HSV round trips
color_edit_saved_sat: floatfloat ColorEditSavedSat;Backup of last Saturation associated to LastColor, so we can restore Saturation in lossy RGB<>HSV round trips
color_edit_saved_color: ImU32ImU32 ColorEditSavedColor;RGB value with alpha set to 0.
color_picker_ref: ImVec4ImVec4 ColorPickerRef;Initial/reference color at the time of opening the color picker.
combo_preview_data: ComboPreviewDataImGuiComboPreviewData ComboPreviewData;
window_resize_border_expected_rect: ImRectImRect WindowResizeBorderExpectedRect;Expected border rect, switch to relative edit if moving
window_resize_relative_mode: boolbool WindowResizeRelativeMode;
scrollbar_seek_mode: intshort ScrollbarSeekMode;0: scroll to clicked location, -1/+1: prev/next page.
scrollbar_click_delta_to_grab_center: floatfloat ScrollbarClickDeltaToGrabCenter;When scrolling to mouse location: distance between mouse and center of grab box, normalized in parent space.
slider_grab_click_offset: floatfloat SliderGrabClickOffset;
slider_current_accum: floatfloat SliderCurrentAccum;Accumulated slider delta when using navigation controls.
slider_current_accum_dirty: boolbool SliderCurrentAccumDirty;Has the accumulated slider delta changed since last time we tried to apply it?
drag_current_accum_dirty: boolbool DragCurrentAccumDirty;
drag_current_accum: floatfloat DragCurrentAccum;Accumulator for dragging modification. Always high-precision, not rounded by end-user precision settings
drag_speed_default_ratio: floatfloat DragSpeedDefaultRatio;If speed == 0.0, uses (max-min) * DragSpeedDefaultRatio
disabled_alpha_backup: floatfloat DisabledAlphaBackup;Backup for style.Alpha for BeginDisabled()
disabled_stack_size: intshort DisabledStackSize;
tooltip_override_count: intshort TooltipOverrideCount;
tooltip_previous_window: WindowImGuiWindow* TooltipPreviousWindow;Window of last tooltip submitted during the frame
clipboard_handler_data: ImVector_charImVector<char> ClipboardHandlerData;If no custom clipboard handler is defined
menus_id_submitted_this_frame: ImVector_IDImVector<ImGuiID> MenusIdSubmittedThisFrame;A list of menu IDs that were rendered at least once
typing_select_state: TypingSelectStateImGuiTypingSelectState TypingSelectState;State for GetTypingSelectRequest()
platform_ime_data: PlatformImeDataImGuiPlatformImeData PlatformImeData;Data updated by current frame. Will be applied at end of the frame. For some backends, this is required to have WantVisible=True in order to receive text message.
platform_ime_data_prev: PlatformImeDataImGuiPlatformImeData PlatformImeDataPrev;Previous frame data. When changed we call the platform_io.Platform_SetImeDataFn() handler.
user_textures: ImVector_ImTextureData_ptrImVector<ImTextureData*> UserTextures;List of textures created/managed by user or third-party extension. Automatically appended into platform_io.Textures[].
dock_context: DockContextImGuiDockContext DockContext;
session_date: PackedDateImGuiPackedDate SessionDate;Packed copy of platform_io.Platform_SessionDate, when valid.
settings_loaded: boolbool SettingsLoaded;
settings_dirty_timer: floatfloat SettingsDirtyTimer;Save .ini Settings to memory when time reaches zero
settings_ini_data: TextBufferImGuiTextBuffer SettingsIniData;In memory .ini settings
settings_handlers: ImVector_SettingsHandlerImVector<ImGuiSettingsHandler> SettingsHandlers;List of .ini settings handlers
hook_id_next: IDImGuiID HookIdNext;Next available HookId
log_enabled: boolbool LogEnabled;Currently capturing
log_line_first_item: boolbool LogLineFirstItem;
log_flags: LogFlagsImGuiLogFlags LogFlags;Capture flags/type
log_window: WindowImGuiWindow* LogWindow;
log_buffer: TextBufferImGuiTextBuffer LogBuffer;Accumulation buffer when log to clipboard. This is pointer so our GImGui static constructor doesn’t call heap allocators.
log_next_prefix: strconst char* LogNextPrefix;See comment in LogSetNextTextDecoration(): doesn’t copy underlying data, use carefully! # (const)
log_next_suffix: strconst char* LogNextSuffix;(const)
log_line_pos_y: floatfloat LogLinePosY;
log_depth_ref: intint LogDepthRef;
log_depth_to_expand: intint LogDepthToExpand;
log_depth_to_expand_default: intint LogDepthToExpandDefault;Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call.
error_callback_user_data: Anyvoid* ErrorCallbackUserData;= None
error_tooltip_locked_pos: ImVec2ImVec2 ErrorTooltipLockedPos;
error_first: boolbool ErrorFirst;
error_count_current_frame: intint ErrorCountCurrentFrame;[Internal] Number of errors submitted this frame.
stack_sizes_in_new_frame: ErrorRecoveryStateImGuiErrorRecoveryState StackSizesInNewFrame;[Internal]
stack_sizes_in_begin_for_current_window: ErrorRecoveryStateImGuiErrorRecoveryState*StackSizesInBeginForCurrentWindow;[Internal]
debug_draw_id_conflicts_count: intint DebugDrawIdConflictsCount;Locked count (preserved when holding Ctrl)
debug_log_flags: DebugLogFlagsImGuiDebugLogFlags DebugLogFlags;
debug_log_buf: TextBufferImGuiTextBuffer DebugLogBuf;
debug_log_index: TextIndexImGuiTextIndex DebugLogIndex;
debug_log_skipped_errors: intint DebugLogSkippedErrors;
debug_log_auto_disable_flags: DebugLogFlagsImGuiDebugLogFlags DebugLogAutoDisableFlags;
debug_log_auto_disable_frames: ImU8ImU8 DebugLogAutoDisableFrames;
debug_locate_frames: ImU8ImU8 DebugLocateFrames;For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
debug_break_in_locate_id: boolbool DebugBreakInLocateId;Debug break in ItemAdd() call for g.DebugLocateId.
debug_break_key_chord: KeyChordImGuiKeyChord DebugBreakKeyChord;= ImGuiKey_Pause
debug_begin_return_value_cull_depth: ImS8ImS8 DebugBeginReturnValueCullDepth;Cycle between 0..9 then wrap around.
debug_item_picker_active: boolbool DebugItemPickerActive;Item picker is active (started with DebugStartItemPicker())
debug_item_picker_mouse_button: ImU8ImU8 DebugItemPickerMouseButton;
debug_item_picker_break_id: IDImGuiID DebugItemPickerBreakId;Will call IM_DEBUG_BREAK() when encountering this ID
debug_flash_style_color_time: floatfloat DebugFlashStyleColorTime;
debug_flash_style_color_backup: ImVec4ImVec4 DebugFlashStyleColorBackup;
debug_metrics_config: MetricsConfigImGuiMetricsConfig DebugMetricsConfig;
debug_item_path_query: DebugItemPathQueryImGuiDebugItemPathQuery DebugItemPathQuery;
debug_id_stack_tool: IDStackToolImGuiIDStackTool DebugIDStackTool;
debug_alloc_info: DebugAllocInfoImGuiDebugAllocInfo DebugAllocInfo;
debug_hovered_dock_node: DockNodeImGuiDockNode* DebugHoveredDockNode;Hovered dock node.
framerate_sec_per_frame: np.ndarrayfloat FramerateSecPerFrame[60];ndarray[type=float, size=60] # Calculate estimate of framerate for user over the last 60 frames..
framerate_sec_per_frame_idx: intint FramerateSecPerFrameIdx;
framerate_sec_per_frame_count: intint FramerateSecPerFrameCount;
framerate_sec_per_frame_accum: floatfloat FramerateSecPerFrameAccum;
want_capture_mouse_next_frame: intint WantCaptureMouseNextFrame;Explicit capture override via SetNextFrameWantCaptureMouse()/SetNextFrameWantCaptureKeyboard(). Default to -1.
want_capture_keyboard_next_frame: intint WantCaptureKeyboardNextFrame;"
want_text_input_next_frame: intint WantTextInputNextFrame;Copied in EndFrame() from g.PlatformImeData.WantTextInput. Needs to be set for some backends (SDL3) to emit character inputs.
temp_buffer: ImVector_charImVector<char> TempBuffer;Temporary text buffer
Context.__init__
def __init__(self, shared_font_atlas: ImFontAtlas) -> None
ImGuiContext(ImFontAtlas* shared_font_atlas);

ImGuiWindowTempData, ImGuiWindow

WindowTempData (class)

Transient per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the DC variable name in ImGuiWindow. (That’s theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered..) (This doesn’t need a constructor because we zero-clear it as part of ImGuiWindow and all frame-temporary data are setup on Begin)

AttributeC++
cursor_pos: ImVec2ImVec2 CursorPos;Current emitting position, in absolute coordinates.
cursor_pos_prev_line: ImVec2ImVec2 CursorPosPrevLine;
cursor_start_pos: ImVec2ImVec2 CursorStartPos;Initial position after Begin(), generally ~ window position + WindowPadding.
cursor_max_pos: ImVec2ImVec2 CursorMaxPos;Used to implicitly calculate ContentSize at the beginning of next frame, for scrolling range and auto-resize. Always growing during the frame.
ideal_max_pos: ImVec2ImVec2 IdealMaxPos;Used to implicitly calculate ContentSizeIdeal at the beginning of next frame, for auto-resize only. Always growing during the frame.
curr_line_size: ImVec2ImVec2 CurrLineSize;
prev_line_size: ImVec2ImVec2 PrevLineSize;
curr_line_text_base_offset: floatfloat CurrLineTextBaseOffset;Baseline offset (0.0 by default on a new line, generally == style.FramePadding.y when a framed item has been added).
prev_line_text_base_offset: floatfloat PrevLineTextBaseOffset;
is_same_line: boolbool IsSameLine;
is_set_pos: boolbool IsSetPos;
indent: ImVec1ImVec1 Indent;Indentation / start position from left of window (increased by TreePush/TreePop, etc.)
columns_offset: ImVec1ImVec1 ColumnsOffset;Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
group_offset: ImVec1ImVec1 GroupOffset;
cursor_start_pos_lossyness: ImVec2ImVec2 CursorStartPosLossyness;Record the loss of precision of CursorStartPos due to really large scrolling amount. This is used by clipper to compensate and fix the most common use case of large scroll area.
nav_layer_current: NavLayerImGuiNavLayer NavLayerCurrent;Current layer, 0..31 (we currently only use 0..1)
nav_layers_active_mask: intshort NavLayersActiveMask;Which layers have been written to (result from previous frame)
nav_layers_active_mask_next: intshort NavLayersActiveMaskNext;Which layers have been written to (accumulator for current frame)
nav_is_scroll_pushable_x: boolbool NavIsScrollPushableX;Set when current work location may be scrolled horizontally when moving left / right. This is generally always True UNLESS within a column.
nav_hide_highlight_one_frame: boolbool NavHideHighlightOneFrame;
nav_window_has_scroll_y: boolbool NavWindowHasScrollY;Set per window when scrolling can be used (== ScrollMax.y > 0.0)
menu_bar_appending: boolbool MenuBarAppending;FIXME: Remove this
menu_bar_offset: ImVec2ImVec2 MenuBarOffset;MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
menu_columns: MenuColumnsImGuiMenuColumns MenuColumns;Simplified columns storage for menu items measurement
tree_depth: intint TreeDepth;Current tree depth.
tree_has_stack_data_depth_mask: ImU32ImU32 TreeHasStackDataDepthMask;Store whether given depth has ImGuiTreeNodeStackData data. Could be turned into a ImU64 if necessary. Sync any changes with TREE_NODE_MAX_DEPTH/TREE_NODE_GET_DEPTH_MASK!
tree_records_clipped_nodes_y2_mask: ImU32ImU32 TreeRecordsClippedNodesY2Mask;Store whether we should keep recording Y2. Cleared when passing clip max. Equivalent TreeHasStackDataDepthMask value should always be set.
child_windows: ImVector_Window_ptrImVector<ImGuiWindow*> ChildWindows;
state_storage: StorageImGuiStorage* StateStorage;Current persistent per-window storage (store e.g. tree node open/close state)
current_columns: OldColumnsImGuiOldColumns* CurrentColumns;Current columns set
current_table_idx: intint CurrentTableIdx;Current table index (into g.Tables)
layout_type: LayoutTypeImGuiLayoutType LayoutType;
parent_layout_type: LayoutTypeImGuiLayoutType ParentLayoutType;Layout type of parent window at the time of Begin()
modal_dim_bg_color: ImU32ImU32 ModalDimBgColor;
window_item_status_flags: ItemStatusFlagsImGuiItemStatusFlags WindowItemStatusFlags;
child_item_status_flags: ItemStatusFlagsImGuiItemStatusFlags ChildItemStatusFlags;
dock_tab_item_status_flags: ItemStatusFlagsImGuiItemStatusFlags DockTabItemStatusFlags;
dock_tab_item_rect: ImRectImRect DockTabItemRect;
item_width: floatfloat ItemWidth;Current item width (>0.0: width in pixels, <0.0: align xx pixels to the right of window).
item_width_default: floatfloat ItemWidthDefault;
text_wrap_pos: floatfloat TextWrapPos;Current text wrap pos.
item_width_stack: ImVector_floatImVector<float> ItemWidthStack;Store item widths to restore (attention: .back() is not == ItemWidth)
text_wrap_pos_stack: ImVector_floatImVector<float> TextWrapPosStack;Store text wrap pos to restore (attention: .back() is not == TextWrapPos)
WindowTempData.__init__
def __init__(self, cursor_pos: Optional[ImVec2Like] = None, cursor_pos_prev_line: Optional[ImVec2Like] = None, cursor_start_pos: Optional[ImVec2Like] = None, cursor_max_pos: Optional[ImVec2Like] = None, ideal_max_pos: Optional[ImVec2Like] = None, curr_line_size: Optional[ImVec2Like] = None, prev_line_size: Optional[ImVec2Like] = None, curr_line_text_base_offset: float = float(), prev_line_text_base_offset: float = float(), is_same_line: bool = bool(), is_set_pos: bool = bool(), indent: Optional[ImVec1] = None, columns_offset: Optional[ImVec1] = None, group_offset: Optional[ImVec1] = None, cursor_start_pos_lossyness: Optional[ImVec2Like] = None, nav_layer_current: NavLayer = NavLayer(), nav_layers_active_mask: int = int(), nav_layers_active_mask_next: int = int(), nav_is_scroll_pushable_x: bool = bool(), nav_hide_highlight_one_frame: bool = bool(), nav_window_has_scroll_y: bool = bool(), menu_bar_appending: bool = bool(), menu_bar_offset: Optional[ImVec2Like] = None, menu_columns: Optional[MenuColumns] = None, tree_depth: int = int(), tree_has_stack_data_depth_mask: ImU32 = ImU32(), tree_records_clipped_nodes_y2_mask: ImU32 = ImU32(), child_windows: Optional[ImVector_Window] = None, current_table_idx: int = int(), layout_type: Optional[LayoutType] = None, parent_layout_type: Optional[LayoutType] = None, modal_dim_bg_color: ImU32 = ImU32(), window_item_status_flags: ItemStatusFlags = ItemStatusFlags(), child_item_status_flags: ItemStatusFlags = ItemStatusFlags(), dock_tab_item_status_flags: ItemStatusFlags = ItemStatusFlags(), dock_tab_item_rect: Optional[ImRect] = None, item_width: float = float(), item_width_default: float = float(), text_wrap_pos: float = float(), item_width_stack: Optional[ImVector_float] = None, text_wrap_pos_stack: Optional[ImVector_float] = None) -> None

Auto-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: * CursorPos: ImVec2() * CursorPosPrevLine: ImVec2() * CursorStartPos: ImVec2() * CursorMaxPos: ImVec2() * IdealMaxPos: ImVec2() * CurrLineSize: ImVec2() * PrevLineSize: ImVec2() * Indent: ImVec1() * ColumnsOffset: ImVec1() * GroupOffset: ImVec1() * CursorStartPosLossyness: ImVec2() * MenuBarOffset: ImVec2() * MenuColumns: MenuColumns() * ChildWindows: ImVector_Window_ptr() * LayoutType: LayoutType() * ParentLayoutType: LayoutType() * DockTabItemRect: ImRect() * ItemWidthStack: ImVector_float() * TextWrapPosStack: ImVector_float()

Window (class)

Storage for one window

AttributeC++
ctx: ContextImGuiContext* Ctx;Parent UI context (needs to be set explicitly by parent).
name: charchar* Name;Window name, owned by the window. # (read-only)
id_: IDImGuiID ID;== ImHashStr(Name)
flags: WindowFlagsImGuiWindowFlags Flags,See enum ImGuiWindowFlags_
flags_previous_frame: WindowFlagsFlagsPreviousFrame;See enum ImGuiWindowFlags_
child_flags: ChildFlagsImGuiChildFlags ChildFlags;Set when window is a child window. See enum ImGuiChildFlags_
window_class: WindowClassImGuiWindowClass WindowClass;Advanced users only. Set with SetNextWindowClass()
viewport: ViewportPImGuiViewportP* Viewport;Always set in Begin(). Inactive windows may have a None value here if their viewport was discarded.
viewport_id: IDImGuiID ViewportId;We backup the viewport id (since the viewport may disappear or never be created if the window is inactive)
viewport_pos: ImVec2ImVec2 ViewportPos;We backup the viewport position (since the viewport may disappear or never be created if the window is inactive)
viewport_allow_platform_monitor_extend: intint ViewportAllowPlatformMonitorExtend;Reset to -1 every frame (index is guaranteed to be valid between NewFrame..EndFrame), only used in the Appearing frame of a tooltip/popup to enforce clamping to a given monitor
pos: ImVec2ImVec2 Pos;Position (always rounded-up to nearest pixel)
size: ImVec2ImVec2 Size;Current size (==SizeFull or collapsed title bar size)
size_full: ImVec2ImVec2 SizeFull;Size when non collapsed
content_size: ImVec2ImVec2 ContentSize;Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding.
content_size_ideal: ImVec2ImVec2 ContentSizeIdeal;
content_size_explicit: ImVec2ImVec2 ContentSizeExplicit;Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize().
window_padding: ImVec2ImVec2 WindowPadding;Window padding at the time of Begin().
window_rounding: floatfloat WindowRounding;Window rounding at the time of Begin(). May be clamped lower to avoid rendering artifacts with title bar, menu bar etc.
window_border_size: floatfloat WindowBorderSize;Window border size at the time of Begin().
title_bar_height: floatfloat TitleBarHeight,Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight.
menu_bar_height: floatMenuBarHeight;Note that those used to be function before 2024/05/28. If you have old code calling TitleBarHeight() you can change it to TitleBarHeight.
deco_outer_size_x1: floatfloat DecoOuterSizeX1,Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
deco_outer_size_y1: floatDecoOuterSizeY1;Left/Up offsets. Sum of non-scrolling outer decorations (X1 generally == 0.0. Y1 generally = TitleBarHeight + MenuBarHeight). Locked during Begin().
deco_outer_size_x2: floatfloat DecoOuterSizeX2,Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
deco_outer_size_y2: floatDecoOuterSizeY2;Right/Down offsets (X2 generally == ScrollbarSize.x, Y2 == ScrollbarSizes.y).
deco_inner_size_x1: floatfloat DecoInnerSizeX1,Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes).
deco_inner_size_y1: floatDecoInnerSizeY1;Applied AFTER/OVER InnerRect. Specialized for Tables as they use specialized form of clipping and frozen rows/columns are inside InnerRect (and not part of regular decoration sizes).
name_buf_len: intint NameBufLen;Size of buffer storing Name. May be larger than strlen(Name)!
move_id: IDImGuiID MoveId;== window->GetID(“#MOVE”)
tab_id: IDImGuiID TabId;== window->GetID(“#TAB”)
child_id: IDImGuiID ChildId;ID of corresponding item in parent window (for navigation to return from child window to parent window)
popup_id: IDImGuiID PopupId;ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
scroll: ImVec2ImVec2 Scroll;
scroll_max: ImVec2ImVec2 ScrollMax;
scroll_target: ImVec2ImVec2 ScrollTarget;target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0. (FLT_MAX for no change)
scroll_target_center_ratio: ImVec2ImVec2 ScrollTargetCenterRatio;0.0 = scroll so that target position is at top, 0.5 = scroll so that target position is centered
scroll_target_edge_snap_dist: ImVec2ImVec2 ScrollTargetEdgeSnapDist;0.0 = no snapping, >0.0 snapping threshold
scrollbar_sizes: ImVec2ImVec2 ScrollbarSizes;Size taken by each scrollbars on their smaller axis. Pay attention! ScrollbarSizes.x == width of the vertical scrollbar, ScrollbarSizes.y = height of the horizontal scrollbar.
scrollbar_x: boolbool ScrollbarX,Are scrollbars visible?
scrollbar_y: boolScrollbarY;Are scrollbars visible?
scrollbar_x_stabilize_enabled: boolbool ScrollbarXStabilizeEnabled;Was ScrollbarX previously auto-stabilized?
scrollbar_x_stabilize_toggled_history: ImU8ImU8 ScrollbarXStabilizeToggledHistory;Used to stabilize scrollbar visibility in case of feedback loops
viewport_owned: boolbool ViewportOwned;
active: boolbool Active;Set to True on Begin(), unless Collapsed
was_active: boolbool WasActive;
write_accessed: boolbool WriteAccessed;Set to True when any widget access the current window
collapsed: boolbool Collapsed;Set when collapsing window to become only title-bar
want_collapse_toggle: boolbool WantCollapseToggle;
skip_items: boolbool SkipItems;Set when items can safely be all clipped (e.g. window not visible or collapsed)
skip_refresh: boolbool SkipRefresh;[EXPERIMENTAL] Reuse previous frame drawn contents, Begin() returns False.
appearing: boolbool Appearing;Set during the frame where the window is appearing (or re-appearing)
hidden: boolbool Hidden;Do not display (== HiddenFrames*** > 0)
is_fallback_window: boolbool IsFallbackWindow;Set on the “Debug##Default” window.
is_explicit_child: boolbool IsExplicitChild;Set when passed _ChildWindow, left to False by BeginDocked()
has_close_button: boolbool HasCloseButton;Set when the window has a close button (p_open != None)
resize_border_hovered: intsigned char ResizeBorderHovered;Current border being hovered for resize (-1: none, otherwise 0-3)
resize_border_held: intsigned char ResizeBorderHeld;Current border being held for resize (-1: none, otherwise 0-3)
begin_count: intshort BeginCount;Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
begin_count_previous_frame: intshort BeginCountPreviousFrame;Number of Begin() during the previous frame
begin_order_within_parent: intshort BeginOrderWithinParent;Begin() order within immediate parent window, if we are a child window. Otherwise 0.
begin_order_within_context: intshort BeginOrderWithinContext;Begin() order within entire imgui context. This is mostly used for debugging submission order related issues.
focus_order: intshort FocusOrder;Order within WindowsFocusOrder[], altered when windows are focused.
auto_pos_last_direction: DirImGuiDir AutoPosLastDirection;
auto_fit_frames_x: ImS8ImS8 AutoFitFramesX,
auto_fit_frames_y: ImS8AutoFitFramesY;
auto_fit_only_grows: boolbool AutoFitOnlyGrows;
hidden_frames_can_skip_items: ImS8ImS8 HiddenFramesCanSkipItems;Hide the window for N frames
hidden_frames_cannot_skip_items: ImS8ImS8 HiddenFramesCannotSkipItems;Hide the window for N frames while allowing items to be submitted so we can measure their size
hidden_frames_for_render_only: ImS8ImS8 HiddenFramesForRenderOnly;Hide the window until frame N at Render() time only
disable_inputs_frames: ImS8ImS8 DisableInputsFrames;Disable window interactions for N frames
set_window_pos_val: ImVec2ImVec2 SetWindowPosVal;store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
set_window_pos_pivot: ImVec2ImVec2 SetWindowPosPivot;store window pivot for positioning. ImVec2(0, 0) when positioning from top-left corner; ImVec2(0.5, 0.5) for centering; ImVec2(1, 1) for bottom right.
id_stack: ImVector_IDImVector<ImGuiID> IDStack;ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure)
dc: WindowTempDataImGuiWindowTempData DC;Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the “DC” variable name.
outer_rect_clipped: ImRectImRect OuterRectClipped;== Window->Rect() just after setup in Begin(). == window->Rect() for root window.
inner_rect: ImRectImRect InnerRect;Inner rectangle (omit title bar, menu bar, scroll bar)
inner_clip_rect: ImRectImRect InnerClipRect;== InnerRect shrunk by WindowPadding*0.5 on each side, clipped within viewport or parent clip rect.
work_rect: ImRectImRect WorkRect;Initially covers the whole scrolling region. Reduced by containers e.g columns/tables when active. Shrunk by WindowPadding*1.0 on each side. This is meant to replace ContentRegionRect over time (from 1.71+ onward).
parent_work_rect: ImRectImRect ParentWorkRect;Backup of WorkRect before entering a container such as columns/tables. Used by e.g. SpanAllColumns functions to easily access. Stacked containers are responsible for maintaining this. // FIXME-WORKRECT: Could be a stack?
clip_rect: ImRectImRect ClipRect;Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back().
content_region_rect: ImRectImRect ContentRegionRect;FIXME: This is currently confusing/misleading. It is essentially WorkRect but not handling of scrolling. We currently rely on it as right/bottom aligned sizing operation need some size to rely on.
hit_test_hole_size: ImVec2ihImVec2ih HitTestHoleSize;Define an optional rectangular hole where mouse will pass-through the window.
hit_test_hole_offset: ImVec2ihImVec2ih HitTestHoleOffset;
last_frame_active: intint LastFrameActive;Last frame number the window was Active.
last_frame_just_focused: intint LastFrameJustFocused;Last frame number the window was made Focused.
last_time_active: floatfloat LastTimeActive;Last timestamp the window was Active (using float as we don’t need high precision there)
state_storage: StorageImGuiStorage StateStorage;
columns_storage: ImVector_OldColumnsImVector<ImGuiOldColumns> ColumnsStorage;
font_window_scale: floatfloat FontWindowScale;User scale multiplier per-window, via SetWindowFontScale()
font_window_scale_parents: floatfloat FontWindowScaleParents;
font_ref_size: floatfloat FontRefSize;This is a copy of window->CalcFontSize() at the time of Begin(), trying to phase out CalcFontSize() especially as it may be called on non-current window.
settings_offset: intint SettingsOffset;Offset into SettingsWindows[] (offsets are always valid as we only grow the array from the back)
draw_list: ImDrawListImDrawList* DrawList;== &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
draw_list_inst: ImDrawListImDrawList DrawListInst;
parent_window: WindowImGuiWindow* ParentWindow;If we are a child or popup or docked window, this is pointing to our parent. Otherwise None.
parent_window_in_begin_stack: WindowImGuiWindow* ParentWindowInBeginStack;
root_window: WindowImGuiWindow* RootWindow;Point to ourself or first ancestor that is not a child window. Doesn’t cross through popups/dock nodes.
root_window_popup_tree: WindowImGuiWindow* RootWindowPopupTree;Point to ourself or first ancestor that is not a child window. Cross through popups parent<>child.
root_window_dock_tree: WindowImGuiWindow* RootWindowDockTree;Point to ourself or first ancestor that is not a child window. Cross through dock nodes.
root_window_for_title_bar_highlight: WindowImGuiWindow* RootWindowForTitleBarHighlight;Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
root_window_for_nav: WindowImGuiWindow* RootWindowForNav;Point to ourself or first ancestor which doesn’t have the NavFlattened flag.
parent_window_for_focus_route: WindowImGuiWindow* ParentWindowForFocusRoute;Set to manual link a window to its logical parent so that Shortcut() chain are honored (e.g. Tool linked to Document)
nav_last_child_nav_window: WindowImGuiWindow* NavLastChildNavWindow;When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
nav_root_focus_scope_id: IDImGuiID NavRootFocusScopeId;Focus Scope ID at the time of Begin()
memory_draw_list_idx_capacity: intint MemoryDrawListIdxCapacity;Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy
memory_draw_list_vtx_capacity: intint MemoryDrawListVtxCapacity;
memory_compacted: boolbool MemoryCompacted;Set when window extraneous data have been garbage collected
dock_order: intshort DockOrder;Order of the last time the window was visible within its DockNode. This is used to reorder windows that are reappearing on the same frame. Same value between windows that were active and windows that were none are possible.
dock_style: WindowDockStyleImGuiWindowDockStyle DockStyle;
dock_node: DockNodeImGuiDockNode* DockNode;Which node are we docked into. Important: Prefer testing DockIsActive in many cases as this will still be set when the dock node is hidden.
dock_node_as_host: DockNodeImGuiDockNode* DockNodeAsHost;Which node are we owning (for parent windows)
dock_id: IDImGuiID DockId;Backup of last valid DockNode->ID, so single window remember their dock node id even when they are not bound any more
Window.__init__
def __init__(self, context: Context, name: str) -> None
ImGuiWindow(ImGuiContext* context, const char* name);
Window.get_id
@overload
def get_id(self, str: str, str_end: Optional[str] = None) -> ID

@overload
def get_id(self, ptr: Any) -> ID

@overload
def get_id(self, n: int) -> ID
ImGuiID GetID(const char* str, const char* str_end = NULL);
ImGuiID GetID(const void* ptr);
ImGuiID GetID(int n);

(private API)

Window.get_id_from_pos
def get_id_from_pos(self, p_abs: ImVec2Like) -> ID
ImGuiID GetIDFromPos(const ImVec2& p_abs);

(private API)

Window.get_id_from_rectangle
def get_id_from_rectangle(self, r_abs: ImRect) -> ID
ImGuiID GetIDFromRectangle(const ImRect& r_abs);

(private API)

Window.rect
def rect(self) -> ImRect
ImRect Rect() const;

(private API)

We don’t use g.FontSize because the window may be != g.CurrentWindow.

Window.title_bar_rect
def title_bar_rect(self) -> ImRect
ImRect TitleBarRect() const;

(private API)

Window.menu_bar_rect
def menu_bar_rect(self) -> ImRect
ImRect MenuBarRect() const;

(private API)

TabBarFlagsPrivate_ (enum)

Extend ImGuiTabBarFlags_

MemberValueC++
dock_node1 << 20ImGuiTabBarFlags_DockNode = 1 << 20Part of a dock node [we don’t use this in the master branch but it facilitate branch syncing to keep this around]
is_focused1 << 21ImGuiTabBarFlags_IsFocused = 1 << 21
save_settings1 << 22ImGuiTabBarFlags_SaveSettings = 1 << 22FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs

TabItemFlagsPrivate_ (enum)

Extend ImGuiTabItemFlags_

MemberValueC++
section_mask_TabItemFlags_Leading | TabItemFlags_TrailingImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing
no_close_button1 << 20ImGuiTabItemFlags_NoCloseButton = 1 << 20Track whether p_open was set or not (we’ll need this info on the next frame to recompute ContentWidth during layout)
button1 << 21ImGuiTabItemFlags_Button = 1 << 21Used by TabItemButton, change the tab item behavior to mimic a button
invisible1 << 22ImGuiTabItemFlags_Invisible = 1 << 22To reserve space e.g. with ImGuiTabItemFlags_Leading
unsorted1 << 23ImGuiTabItemFlags_Unsorted = 1 << 23[Docking] Trailing tabs with the _Unsorted flag will be sorted based on the DockOrder of their Window.

TabItem (class)

Storage for one active tab item (sizeof() 48 bytes)

AttributeC++
id_: IDImGuiID ID;
flags: TabItemFlagsImGuiTabItemFlags Flags;
window: WindowImGuiWindow* Window;When TabItem is part of a DockNode’s TabBar, we hold on to a window.
last_frame_visible: intint LastFrameVisible;
last_frame_selected: intint LastFrameSelected;This allows us to infer an ordered list of the last activated tabs with little maintenance
offset: floatfloat Offset;Position relative to beginning of tab bar
width: floatfloat Width;Width currently displayed
content_width: floatfloat ContentWidth;Width of label + padding, stored during BeginTabItem() call (misnamed as “Content” would normally imply width of label only)
requested_width: floatfloat RequestedWidth;Width optionally requested by caller, -1.0 is unused
name_offset: ImS32ImS32 NameOffset;When Window==None, offset to name within parent ImGuiTabBar::TabsNames
begin_order: ImS16ImS16 BeginOrder;BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable
index_during_layout: ImS16ImS16 IndexDuringLayout;Index only used during TabBarLayout(). Tabs gets reordered so ‘Tabs[n].IndexDuringLayout == n’ but may mismatch during additions.
want_close: boolbool WantClose;Marked as closed by SetTabItemClosed()
TabItem.__init__
def __init__(self) -> None
ImGuiTabItem();

TabBar (class)

Storage for a tab bar (sizeof() 160 bytes)

AttributeC++
window: WindowImGuiWindow* Window;
tabs: ImVector_TabItemImVector<ImGuiTabItem> Tabs;
flags: TabBarFlagsImGuiTabBarFlags Flags;
id_: IDImGuiID ID;Zero for tab-bars used by docking
selected_tab_id: IDImGuiID SelectedTabId;Selected tab/window
next_selected_tab_id: IDImGuiID NextSelectedTabId;Next selected tab/window. Will also trigger a scrolling animation
next_scroll_to_tab_id: IDImGuiID NextScrollToTabId;
visible_tab_id: IDImGuiID VisibleTabId;Can occasionally be != SelectedTabId (e.g. when previewing contents for Ctrl+Tab preview)
curr_frame_visible: intint CurrFrameVisible;
prev_frame_visible: intint PrevFrameVisible;
bar_rect: ImRectImRect BarRect;
bar_rect_prev_width: floatfloat BarRectPrevWidth;Backup of previous width. When width change we enforce keep horizontal scroll on focused tab.
curr_tabs_contents_height: floatfloat CurrTabsContentsHeight;
prev_tabs_contents_height: floatfloat PrevTabsContentsHeight;Record the height of contents submitted below the tab bar
width_all_tabs: floatfloat WidthAllTabs;Actual width of all tabs (locked during layout)
width_all_tabs_ideal: floatfloat WidthAllTabsIdeal;Ideal width if all tabs were visible and not clipped
scrolling_anim: floatfloat ScrollingAnim;
scrolling_target: floatfloat ScrollingTarget;
scrolling_target_dist_to_visibility: floatfloat ScrollingTargetDistToVisibility;
scrolling_speed: floatfloat ScrollingSpeed;
scrolling_rect_min_x: floatfloat ScrollingRectMinX;
scrolling_rect_max_x: floatfloat ScrollingRectMaxX;
separator_min_x: floatfloat SeparatorMinX;
separator_max_x: floatfloat SeparatorMaxX;
reorder_request_tab_id: IDImGuiID ReorderRequestTabId;
reorder_request_offset: ImS16ImS16 ReorderRequestOffset;
begin_count: ImS8ImS8 BeginCount;
want_layout: boolbool WantLayout;
visible_tab_was_submitted: boolbool VisibleTabWasSubmitted;
tabs_added_new: boolbool TabsAddedNew;Set to True when a new tab item or button has been added to the tab bar during last frame
scroll_button_enabled: boolbool ScrollButtonEnabled;
tabs_active_count: ImS16ImS16 TabsActiveCount;Number of tabs submitted this frame.
last_tab_item_idx: ImS16ImS16 LastTabItemIdx;Index of last BeginTabItem() tab for use by EndTabItem()
item_spacing_y: floatfloat ItemSpacingY;
frame_padding: ImVec2ImVec2 FramePadding;style.FramePadding locked at the time of BeginTabBar()
backup_cursor_pos: ImVec2ImVec2 BackupCursorPos;
tabs_names: TextBufferImGuiTextBuffer TabsNames;For non-docking tab bar we re-append names in a contiguous buffer.
TabBar.__init__
def __init__(self) -> None
ImGuiTabBar();

Table support + internal API

TableColumn (class)

[Internal] sizeof() ~ 120
We use the terminology “Enabled” to refer to a column that is not Hidden by user/api.
We use the terminology “Clipped” to refer to a column that is out of sight because of scrolling/clipping.
This is in contrast with some user-facing api such as IsItemVisible() / IsRectVisible() which use “Visible” to mean “not clipped”.

AttributeC++
flags: TableColumnFlagsImGuiTableColumnFlags Flags;Flags after some patching (not directly same as provided by user). See ImGuiTableColumnFlags_
width_given: floatfloat WidthGiven;Final/actual width visible == (MaxX - MinX), locked in TableUpdateLayout(). May be > WidthRequest to honor minimum width, may be < WidthRequest to honor shrinking columns down in tight space.
min_x: floatfloat MinX;Absolute positions
max_x: floatfloat MaxX;
width_request: floatfloat WidthRequest;Master width absolute value when !(Flags & _WidthStretch). When Stretch this is derived every frame from StretchWeight in TableUpdateLayout()
width_auto: floatfloat WidthAuto;Automatic width
width_max: floatfloat WidthMax;Maximum width (FIXME: overwritten by each instance)
stretch_weight: floatfloat StretchWeight;Master width weight when (Flags & _WidthStretch). Often around ~1.0 initially.
init_stretch_weight_or_width: floatfloat InitStretchWeightOrWidth;Value passed to TableSetupColumn(). For Width it is a content width (without padding).
clip_rect: ImRectImRect ClipRect;Clipping rectangle for the column
id_: IDImGuiID ID;Hash of column name (ignoring top of ID stack), used for .ini persistence when available.
user_data: IDImGuiID UserData;(Optional) User data value passed to TableSetupColumn()
work_min_x: floatfloat WorkMinX;Contents region min ~(MinX + CellPaddingX + CellSpacingX1) == cursor start position when entering column
work_max_x: floatfloat WorkMaxX;Contents region max ~(MaxX - CellPaddingX - CellSpacingX2)
item_width: floatfloat ItemWidth;Current item width for the column, preserved across rows
content_max_x_frozen: floatfloat ContentMaxXFrozen;Contents maximum position for frozen rows (apart from headers), from which we can infer content width.
content_max_x_unfrozen: floatfloat ContentMaxXUnfrozen;
content_max_x_headers_used: floatfloat ContentMaxXHeadersUsed;Contents maximum position for headers rows (regardless of freezing). TableHeader() automatically softclip itself + report ideal desired size, to avoid creating extraneous draw calls
content_max_x_headers_ideal: floatfloat ContentMaxXHeadersIdeal;
name_offset: ImS16ImS16 NameOffset;Offset into parent ColumnsNames[]
display_order: TableColumnIdxImGuiTableColumnIdx DisplayOrder;Index within Table’s IndexToDisplayOrder[] (column may be reordered by users)
index_within_enabled_set: TableColumnIdxImGuiTableColumnIdx IndexWithinEnabledSet;Index within enabled/visible set (<= IndexToDisplayOrder)
prev_enabled_column: TableColumnIdxImGuiTableColumnIdx PrevEnabledColumn;Index of prev enabled/visible column within Columns[], -1 if first enabled/visible column
next_enabled_column: TableColumnIdxImGuiTableColumnIdx NextEnabledColumn;Index of next enabled/visible column within Columns[], -1 if last enabled/visible column
sort_order: TableColumnIdxImGuiTableColumnIdx SortOrder;Index of this column within sort specs, -1 if not sorting on this column, 0 for single-sort, may be >0 on multi-sort
draw_channel_current: TableDrawChannelIdxImGuiTableDrawChannelIdx DrawChannelCurrent;Index within DrawSplitter.Channels[]
draw_channel_frozen: TableDrawChannelIdxImGuiTableDrawChannelIdx DrawChannelFrozen;Draw channels for frozen rows (often headers)
draw_channel_unfrozen: TableDrawChannelIdxImGuiTableDrawChannelIdx DrawChannelUnfrozen;Draw channels for unfrozen rows
is_enabled: boolbool IsEnabled;IsUserEnabled && (Flags & ImGuiTableColumnFlags_Disabled) == 0
is_user_enabled: boolbool IsUserEnabled;Is the column not marked Hidden by the user? (unrelated to being off view, e.g. clipped by scrolling).
is_user_enabled_next_frame: boolbool IsUserEnabledNextFrame;
is_visible_x: boolbool IsVisibleX;Is actually in view (e.g. overlapping the host window clipping rectangle, not scrolled).
is_visible_y: boolbool IsVisibleY;
is_request_output: boolbool IsRequestOutput;Return value for TableSetColumnIndex() / TableNextColumn(): whether we request user to output contents or not.
is_skip_items: boolbool IsSkipItems;Do we want item submissions to this column to be completely ignored (no layout will happen).
nav_layer_current: ImS8ImS8 NavLayerCurrent;ImGuiNavLayer in 1 byte
sort_directions_avail_list: ImU8ImU8 SortDirectionsAvailList;Ordered list of available sort directions (2-bits each, total 8-bits)
TableColumn.__init__
def __init__(self) -> None
ImGuiTableColumn();

TableReconcileColumnData (class)

Passed to TableSetupColumn() sizeof() ~ 24+120 bytes

AttributeC++
id_: IDImGuiID ID;
name_offset: ImS16ImS16 NameOffset;
flags: TableColumnFlagsImGuiTableColumnFlags Flags;
init_width_or_weight: floatfloat InitWidthOrWeight;
user_data: IDImGuiID UserData;
column_new_idx: TableColumnIdxImGuiTableColumnIdx ColumnNewIdx;Index in the current table.
column_old_idx: TableColumnIdxImGuiTableColumnIdx ColumnOldIdx;Index in the previous frame table.
column_old_data: TableColumnImGuiTableColumn ColumnOldData;Full backup of the column. Could be avoided by storing 1 of them and applying reconcile in the right order. Not worth bothering.
TableReconcileColumnData.__init__
def __init__(self, id_: ID = ID(), name_offset: ImS16 = ImS16(), flags: TableColumnFlags = TableColumnFlags(), init_width_or_weight: float = float(), user_data: ID = ID(), column_new_idx: Optional[TableColumnIdx] = None, column_old_idx: Optional[TableColumnIdx] = None, column_old_data: Optional[TableColumn] = None) -> None

Auto-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: * ColumnNewIdx: TableColumnIdx() * ColumnOldIdx: TableColumnIdx() * ColumnOldData: TableColumn()

TableCellData (class)

Transient cell data stored per row. sizeof() ~ 6 bytes

AttributeC++
bg_color: ImU32ImU32 BgColor;Actual color
column: TableColumnIdxImGuiTableColumnIdx Column;Column number
TableCellData.__init__
def __init__(self, bg_color: ImU32 = ImU32(), column: Optional[TableColumnIdx] = None) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If Column is None, then its default value will be: TableColumnIdx()

TableHeaderData (class)

Parameters for TableAngledHeadersRowEx()
This may end up being refactored for more general purpose. sizeof() ~ 12 bytes

AttributeC++
index: TableColumnIdxImGuiTableColumnIdx Index;Column index
text_color: ImU32ImU32 TextColor;
bg_color0: ImU32ImU32 BgColor0;
bg_color1: ImU32ImU32 BgColor1;
TableHeaderData.__init__
def __init__(self, index: Optional[TableColumnIdx] = None, text_color: ImU32 = ImU32(), bg_color0: ImU32 = ImU32(), bg_color1: ImU32 = ImU32()) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If Index is None, then its default value will be: TableColumnIdx()

TableInstanceData (class)

Per-instance data that needs preserving across frames (seemingly most others do not need to be preserved aside from debug needs. Does that means they could be moved to ImGuiTableTempData?) sizeof() ~ 24 bytes

AttributeC++
table_instance_id: IDImGuiID TableInstanceID;
last_outer_height: floatfloat LastOuterHeight;Outer height from last frame
last_top_headers_row_height: floatfloat LastTopHeadersRowHeight;Height of first consecutive header rows from last frame (FIXME: this is used assuming consecutive headers are in same frozen set)
last_frozen_height: floatfloat LastFrozenHeight;Height of frozen section from last frame
hovered_row_last: intint HoveredRowLast;Index of row which was hovered last frame.
hovered_row_next: intint HoveredRowNext;Index of row hovered this frame, set after encountering it.
TableInstanceData.__init__
def __init__(self) -> None
ImGuiTableInstanceData();

Table (class)

sizeof() ~ 592 bytes + heap allocs described in TableBeginInitMemory()

AttributeC++
id_: IDImGuiID ID;
flags: TableFlagsImGuiTableFlags Flags;
raw_data: Anyvoid* RawData;Single allocation to hold Columns[], DisplayOrderToIndex[], and RowCellData[]
temp_data: TableTempDataImGuiTableTempData* TempData;Transient data while table is active. Point within g.CurrentTableStack[]
settings_loaded_flags: TableFlagsImGuiTableFlags SettingsLoadedFlags;Which data were loaded from the .ini file (e.g. when order is not altered we won’t save order)
settings_offset: intint SettingsOffset;Offset in g.SettingsTables
last_frame_active: intint LastFrameActive;
columns_count: intint ColumnsCount;Number of columns declared in BeginTable()
current_row: intint CurrentRow;
current_column: intint CurrentColumn;
instance_current: ImS16ImS16 InstanceCurrent;Count of BeginTable() calls with same ID in the same frame (generally 0). This is a little bit similar to BeginCount for a window, but multiple tables with the same ID are multiple tables, they are just synced.
instance_interacted: ImS16ImS16 InstanceInteracted;Mark which instance (generally 0) of the same ID is being interacted with
row_pos_y1: floatfloat RowPosY1;
row_pos_y2: floatfloat RowPosY2;
row_min_height: floatfloat RowMinHeight;Height submitted to TableNextRow()
row_cell_padding_y: floatfloat RowCellPaddingY;Top and bottom padding. Reloaded during row change.
row_text_baseline: floatfloat RowTextBaseline;
row_indent_offset_x: floatfloat RowIndentOffsetX;
row_bg_color_counter: intint RowBgColorCounter;Counter for alternating background colors (can be fast-forwarded by e.g clipper), not same as CurrentRow because header rows typically don’t increase this.
row_bg_color: np.ndarrayImU32 RowBgColor[2];ndarray[type=ImU32, size=2] # Background color override for current row.
border_color_strong: ImU32ImU32 BorderColorStrong;
border_color_light: ImU32ImU32 BorderColorLight;
border_x1: floatfloat BorderX1;
border_x2: floatfloat BorderX2;
host_indent_x: floatfloat HostIndentX;
min_column_width: floatfloat MinColumnWidth;
outer_padding_x: floatfloat OuterPaddingX;
cell_padding_x: floatfloat CellPaddingX;Padding from each borders. Locked in BeginTable()/Layout.
cell_spacing_x1: floatfloat CellSpacingX1;Spacing between non-bordered cells. Locked in BeginTable()/Layout.
cell_spacing_x2: floatfloat CellSpacingX2;
inner_width: floatfloat InnerWidth;User value passed to BeginTable(), see comments at the top of BeginTable() for details.
columns_given_width: floatfloat ColumnsGivenWidth;Sum of current column width
columns_auto_fit_width: floatfloat ColumnsAutoFitWidth;Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
columns_stretch_sum_weights: floatfloat ColumnsStretchSumWeights;Sum of weight of all enabled stretching columns
resized_column_next_width: floatfloat ResizedColumnNextWidth;
resize_lock_min_contents_x2: floatfloat ResizeLockMinContentsX2;Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table.
ref_scale: floatfloat RefScale;Reference scale to be able to rescale columns on font/dpi changes.
angled_headers_height: floatfloat AngledHeadersHeight;Set by TableAngledHeadersRow(), used in TableUpdateLayout()
angled_headers_slope: floatfloat AngledHeadersSlope;Set by TableAngledHeadersRow(), used in TableUpdateLayout()
outer_rect: ImRectImRect OuterRect;Note: for non-scrolling table, OuterRect.Max.y is often FLT_MAX until EndTable(), unless a height has been specified in BeginTable().
inner_rect: ImRectImRect InnerRect;InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is "
work_rect: ImRectImRect WorkRect;
inner_clip_rect: ImRectImRect InnerClipRect;
bg_clip_rect: ImRectImRect BgClipRect;We use this to cpu-clip cell background color fill, evolve during the frame as we cross frozen rows boundaries
bg0_clip_rect_for_draw_cmd: ImRectImRect Bg0ClipRectForDrawCmd;Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped
bg2_clip_rect_for_draw_cmd: ImRectImRect Bg2ClipRectForDrawCmd;Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect.
host_clip_rect: ImRectImRect HostClipRect;This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window.
host_backup_inner_clip_rect: ImRectImRect HostBackupInnerClipRect;Backup of InnerWindow->ClipRect during PushTableBackground()/PopTableBackground()
outer_window: WindowImGuiWindow* OuterWindow;Parent window for the table
inner_window: WindowImGuiWindow* InnerWindow;Window holding the table data (== OuterWindow or a child window)
columns_names: TextBufferImGuiTextBuffer ColumnsNames;Contiguous buffer holding columns names
draw_splitter: ImDrawListSplitterImDrawListSplitter* DrawSplitter;Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly
instance_data_first: TableInstanceDataImGuiTableInstanceData InstanceDataFirst;
instance_data_extra: ImVector_TableInstanceDataImVector<ImGuiTableInstanceData> InstanceDataExtra;FIXME-OPT: Using a small-vector pattern would be good.
sort_specs_single: TableColumnSortSpecsImGuiTableColumnSortSpecs SortSpecsSingle;
sort_specs_multi: ImVector_TableColumnSortSpecsImVector<ImGuiTableColumnSortSpecs> SortSpecsMulti;FIXME-OPT: Using a small-vector pattern would be good.
sort_specs: TableSortSpecsImGuiTableSortSpecs SortSpecs;Public facing sorts specs, this is what we return in TableGetSortSpecs()
sort_specs_count: TableColumnIdxImGuiTableColumnIdx SortSpecsCount;
columns_enabled_count: TableColumnIdxImGuiTableColumnIdx ColumnsEnabledCount;Number of enabled columns (<= ColumnsCount)
columns_enabled_fixed_count: TableColumnIdxImGuiTableColumnIdx ColumnsEnabledFixedCount;Number of enabled columns using fixed width (<= ColumnsCount)
decl_columns_count: TableColumnIdxImGuiTableColumnIdx DeclColumnsCount;Count calls to TableSetupColumn()
angled_headers_count: TableColumnIdxImGuiTableColumnIdx AngledHeadersCount;Count columns with angled headers
hovered_column_body: TableColumnIdxImGuiTableColumnIdx HoveredColumnBody;Index of column whose visible region is being hovered. Important: == ColumnsCount when hovering empty region after the right-most column!
hovered_column_border: TableColumnIdxImGuiTableColumnIdx HoveredColumnBorder;Index of column whose right-border is being hovered (for resizing).
highlight_column_header: TableColumnIdxImGuiTableColumnIdx HighlightColumnHeader;Index of column which should be highlighted.
auto_fit_single_column: TableColumnIdxImGuiTableColumnIdx AutoFitSingleColumn;Index of single column requesting auto-fit.
resized_column: TableColumnIdxImGuiTableColumnIdx ResizedColumn;Index of column being resized. Reset when InstanceCurrent==0.
last_resized_column: TableColumnIdxImGuiTableColumnIdx LastResizedColumn;Index of column being resized from previous frame.
held_header_column: TableColumnIdxImGuiTableColumnIdx HeldHeaderColumn;Index of column header being held.
last_held_header_column: TableColumnIdxImGuiTableColumnIdx LastHeldHeaderColumn;Index of column header being held from previous frame.
reorder_column: TableColumnIdxImGuiTableColumnIdx ReorderColumn;Index of column being reordered. (not cleared)
reorder_column_dst_order: TableColumnIdxImGuiTableColumnIdx ReorderColumnDstOrder;Requested display order of column being reordered.
left_most_enabled_column: TableColumnIdxImGuiTableColumnIdx LeftMostEnabledColumn;Index of left-most non-hidden column.
right_most_enabled_column: TableColumnIdxImGuiTableColumnIdx RightMostEnabledColumn;Index of right-most non-hidden column.
left_most_stretched_column: TableColumnIdxImGuiTableColumnIdx LeftMostStretchedColumn;Index of left-most stretched column.
right_most_stretched_column: TableColumnIdxImGuiTableColumnIdx RightMostStretchedColumn;Index of right-most stretched column.
context_popup_column: TableColumnIdxImGuiTableColumnIdx ContextPopupColumn;Column right-clicked on, of -1 if opening context menu from a neutral/empty spot
freeze_rows_request: TableColumnIdxImGuiTableColumnIdx FreezeRowsRequest;Requested frozen rows count
freeze_rows_count: TableColumnIdxImGuiTableColumnIdx FreezeRowsCount;Actual frozen row count (== FreezeRowsRequest, or == 0 when no scrolling offset)
freeze_columns_request: TableColumnIdxImGuiTableColumnIdx FreezeColumnsRequest;Requested frozen columns count
freeze_columns_count: TableColumnIdxImGuiTableColumnIdx FreezeColumnsCount;Actual frozen columns count (== FreezeColumnsRequest, or == 0 when no scrolling offset)
row_cell_data_current: TableColumnIdxImGuiTableColumnIdx RowCellDataCurrent;Index of current RowCellData[] entry in current row
dummy_draw_channel: TableDrawChannelIdxImGuiTableDrawChannelIdx DummyDrawChannel;Redirect non-visible columns here.
bg2_draw_channel_current: TableDrawChannelIdxImGuiTableDrawChannelIdx Bg2DrawChannelCurrent;For Selectable() and other widgets drawing across columns after the freezing line. Index within DrawSplitter.Channels[]
bg2_draw_channel_unfrozen: TableDrawChannelIdxImGuiTableDrawChannelIdx Bg2DrawChannelUnfrozen;
nav_layer: ImS8ImS8 NavLayer;ImGuiNavLayer at the time of BeginTable().
is_layout_locked: boolbool IsLayoutLocked;Set by TableUpdateLayout() which is called when beginning the first row.
is_inside_row: boolbool IsInsideRow;Set when inside TableBeginRow()/TableEndRow().
is_initializing: boolbool IsInitializing;
is_reconcile_mode: boolbool IsReconcileMode;
is_sort_specs_dirty: boolbool IsSortSpecsDirty;
is_using_headers: boolbool IsUsingHeaders;Set when the first row had the ImGuiTableRowFlags_Headers flag.
is_context_popup_open: boolbool IsContextPopupOpen;Set when default context menu is open (also see: ContextPopupColumn, InstanceInteracted).
disable_default_context_menu: boolbool DisableDefaultContextMenu;Disable default context menu. You may submit your own using TableBeginContextMenuPopup()/EndPopup()
is_settings_request_load: boolbool IsSettingsRequestLoad;
is_settings_dirty: boolbool IsSettingsDirty;Set when table settings have changed and needs to be reported into ImGuiTableSettings data.
is_default_display_order: boolbool IsDefaultDisplayOrder;Set when display order is unchanged from default (DisplayOrder contains 0...Count-1)
is_default_visibility: boolbool IsDefaultVisibility;Set when enabled/visibility is unchanged from default
is_reset_all_request: boolbool IsResetAllRequest;Set to queue a call to TableResetSettings() in BeginTable()
is_reset_display_order_request: boolbool IsResetDisplayOrderRequest;
is_reset_visibility_request: boolbool IsResetVisibilityRequest;
is_unfrozen_rows: boolbool IsUnfrozenRows;Set when we got past the frozen row.
is_default_sizing_policy: boolbool IsDefaultSizingPolicy;Set if user didn’t explicitly set a sizing policy in BeginTable()
is_active_id_alive_before_table: boolbool IsActiveIdAliveBeforeTable;
is_active_id_in_table: boolbool IsActiveIdInTable;
has_scrollbar_y_curr: boolbool HasScrollbarYCurr;Whether ANY instance of this table had a vertical scrollbar during the current frame.
has_scrollbar_y_prev: boolbool HasScrollbarYPrev;Whether ANY instance of this table had a vertical scrollbar during the previous.
memory_compacted: boolbool MemoryCompacted;
host_skip_items: boolbool HostSkipItems;Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
Table.__init__
def __init__(self) -> None
ImGuiTable();

TableTempData (class)

Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).

AttributeC++
window_id: IDImGuiID WindowID;Shortcut to g.Tables[TableIndex]->OuterWindow->ID.
table_index: intint TableIndex;Index in g.Tables.Buf[] pool
last_time_active: floatfloat LastTimeActive;Last timestamp this structure was used
angled_headers_extra_width: floatfloat AngledHeadersExtraWidth;Used in EndTable()
angled_headers_requests: ImVector_TableHeaderDataImVector<ImGuiTableHeaderData> AngledHeadersRequests;Used in TableAngledHeadersRow() // FIXME: Single instance is enough?
old_columns_raw_data: Anyvoid* OldColumnsRawData;Used in BeginTable() -> TableUpdateLayout() when resizing.
user_outer_size: ImVec2ImVec2 UserOuterSize;outer_size.x passed to BeginTable()
draw_splitter: ImDrawListSplitterImDrawListSplitter DrawSplitter;
host_backup_work_rect: ImRectImRect HostBackupWorkRect;Backup of InnerWindow->WorkRect at the end of BeginTable()
host_backup_parent_work_rect: ImRectImRect HostBackupParentWorkRect;Backup of InnerWindow->ParentWorkRect at the end of BeginTable()
host_backup_prev_line_size: ImVec2ImVec2 HostBackupPrevLineSize;Backup of InnerWindow->DC.PrevLineSize at the end of BeginTable()
host_backup_curr_line_size: ImVec2ImVec2 HostBackupCurrLineSize;Backup of InnerWindow->DC.CurrLineSize at the end of BeginTable()
host_backup_cursor_max_pos: ImVec2ImVec2 HostBackupCursorMaxPos;Backup of InnerWindow->DC.CursorMaxPos at the end of BeginTable()
host_backup_columns_offset: ImVec1ImVec1 HostBackupColumnsOffset;Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable()
host_backup_item_width: floatfloat HostBackupItemWidth;Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
host_backup_item_width_stack_size: intint HostBackupItemWidthStackSize;Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()
TableTempData.__init__
def __init__(self) -> None
ImGuiTableTempData();

TableColumnSettings (class)

sizeof() ~ 16

AttributeC++
width_or_weight: floatfloat WidthOrWeight;
id_: IDImGuiID ID;
index: TableColumnIdxImGuiTableColumnIdx Index;
display_order: TableColumnIdxImGuiTableColumnIdx DisplayOrder;
sort_order: TableColumnIdxImGuiTableColumnIdx SortOrder;
TableColumnSettings.__init__
def __init__(self) -> None
ImGuiTableColumnSettings();

TableSettings (class)

This is designed to be stored in a single ImChunkStream (1 header followed by N ImGuiTableColumnSettings, etc.)

AttributeC++
id_: IDImGuiID ID;Set to 0 to invalidate/delete the setting
save_flags: TableFlagsImGuiTableFlags SaveFlags;Indicate data we want to save using the Resizable/Reorderable/Sortable/Hideable flags (could be using its own flags..)
ref_scale: floatfloat RefScale;Reference scale to be able to rescale columns on font/dpi changes.
columns_count: TableColumnIdxImGuiTableColumnIdx ColumnsCount;
columns_count_max: TableColumnIdxImGuiTableColumnIdx ColumnsCountMax;Maximum number of columns this settings instance can store, we can recycle a settings instance with lower number of columns but not higher
last_used_date: PackedDateImGuiPackedDate LastUsedDate;
TableSettings.__init__
def __init__(self) -> None
ImGuiTableSettings();
TableSettings.get_column_settings
def get_column_settings(self) -> TableColumnSettings
ImGuiTableColumnSettings* GetColumnSettings();

(private API)

Tables: Candidates for public API

table_open_context_menu

def table_open_context_menu(column_n: int = -1) -> None
IMGUI_API void TableOpenContextMenu(int column_n = -1);

table_set_column_width

def table_set_column_width(column_n: int, width: float) -> None
IMGUI_API void TableSetColumnWidth(int column_n, float width);

table_set_column_sort_direction

def table_set_column_sort_direction(column_n: int, sort_direction: SortDirection, append_to_sort_specs: bool) -> None
IMGUI_API void TableSetColumnSortDirection(int column_n, ImGuiSortDirection sort_direction, bool append_to_sort_specs);

table_get_hovered_row

def table_get_hovered_row() -> int
IMGUI_API int TableGetHoveredRow();

Retrieve PREVIOUS FRAME hovered row. This difference with TableGetHoveredColumn() is the reason why this is not public yet.

table_get_header_row_height

def table_get_header_row_height() -> float
IMGUI_API float TableGetHeaderRowHeight();

table_get_header_angled_max_label_width

def table_get_header_angled_max_label_width() -> float
IMGUI_API float TableGetHeaderAngledMaxLabelWidth();

table_push_background_channel

def table_push_background_channel() -> None
IMGUI_API void TablePushBackgroundChannel();

table_pop_background_channel

def table_pop_background_channel() -> None
IMGUI_API void TablePopBackgroundChannel();

table_push_column_channel

def table_push_column_channel(column_n: int) -> None
IMGUI_API void TablePushColumnChannel(int column_n);

table_pop_column_channel

def table_pop_column_channel() -> None
IMGUI_API void TablePopColumnChannel();

table_angled_headers_row_ex

def table_angled_headers_row_ex(row_id: ID, angle: float, max_label_width: float, data: TableHeaderData, data_count: int) -> None
IMGUI_API void TableAngledHeadersRowEx(ImGuiID row_id, float angle, float max_label_width, const ImGuiTableHeaderData* data, int data_count);

get_current_table

def get_current_table() -> Table
inline ImGuiTable* GetCurrentTable();

Tables: Internals (private API)

table_find_by_id

def table_find_by_id(id_: ID) -> Table
IMGUI_API ImGuiTable* TableFindByID(ImGuiID id);

begin_table_ex

def begin_table_ex(name: str, id_: ID, columns_count: int, flags: TableFlags = 0, outer_size: Optional[ImVec2Like] = None, inner_width: float = 0.0) -> bool
IMGUI_API bool BeginTableEx(const char* name, ImGuiID id, int columns_count, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0, 0), float inner_width = 0.0f);

Python bindings defaults:
If outer_size is None, then its default value will be: ImVec2(0, 0)

table_begin_init_memory

def table_begin_init_memory(table: Table, columns_count: int) -> None
IMGUI_API void TableBeginInitMemory(ImGuiTable* table, int columns_count);

table_apply_queued_requests

def table_apply_queued_requests(table: Table) -> None
IMGUI_API void TableApplyQueuedRequests(ImGuiTable* table);

table_setup_draw_channels

def table_setup_draw_channels(table: Table) -> None
IMGUI_API void TableSetupDrawChannels(ImGuiTable* table);

table_reconcile_columns

def table_reconcile_columns(table: Table) -> None
IMGUI_API void TableReconcileColumns(ImGuiTable* table);

table_update_layout

def table_update_layout(table: Table) -> None
IMGUI_API void TableUpdateLayout(ImGuiTable* table);

table_update_borders

def table_update_borders(table: Table) -> None
IMGUI_API void TableUpdateBorders(ImGuiTable* table);

table_update_columns_weight_from_width

def table_update_columns_weight_from_width(table: Table) -> None
IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);

table_apply_external_unclip_rect

def table_apply_external_unclip_rect(table: Table, rect: ImRect) -> None
IMGUI_API void TableApplyExternalUnclipRect(ImGuiTable* table, ImRect& rect);

table_draw_borders

def table_draw_borders(table: Table) -> None
IMGUI_API void TableDrawBorders(ImGuiTable* table);

table_draw_default_context_menu

def table_draw_default_context_menu(table: Table, flags_for_section_to_display: TableFlags) -> None
IMGUI_API void TableDrawDefaultContextMenu(ImGuiTable* table, ImGuiTableFlags flags_for_section_to_display);

table_begin_context_menu_popup

def table_begin_context_menu_popup(table: Table) -> bool
IMGUI_API bool TableBeginContextMenuPopup(ImGuiTable* table);

table_merge_draw_channels

def table_merge_draw_channels(table: Table) -> None
IMGUI_API void TableMergeDrawChannels(ImGuiTable* table);

table_get_instance_data

def table_get_instance_data(table: Table, instance_no: int) -> TableInstanceData
inline ImGuiTableInstanceData* TableGetInstanceData(ImGuiTable* table, int instance_no);

(private API)

table_get_instance_id

def table_get_instance_id(table: Table, instance_no: int) -> ID
inline ImGuiID TableGetInstanceID(ImGuiTable* table, int instance_no);

(private API)

table_fix_display_order

def table_fix_display_order(table: Table) -> None
IMGUI_API void TableFixDisplayOrder(ImGuiTable* table);

table_sort_specs_sanitize

def table_sort_specs_sanitize(table: Table) -> None
IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);

table_sort_specs_build

def table_sort_specs_build(table: Table) -> None
IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);

table_init_column_defaults

def table_init_column_defaults(table: Table, column: TableColumn, init_mask: TableColumnFlags) -> None
IMGUI_API void TableInitColumnDefaults(ImGuiTable* table, ImGuiTableColumn* column, ImGuiTableColumnFlags init_mask);

table_get_column_next_sort_direction

def table_get_column_next_sort_direction(column: TableColumn) -> SortDirection
IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);

table_fix_column_sort_direction

def table_fix_column_sort_direction(table: Table, column: TableColumn) -> None
IMGUI_API void TableFixColumnSortDirection(ImGuiTable* table, ImGuiTableColumn* column);

table_get_column_width_auto

def table_get_column_width_auto(table: Table, column: TableColumn) -> float
IMGUI_API float TableGetColumnWidthAuto(ImGuiTable* table, ImGuiTableColumn* column);

table_begin_row

def table_begin_row(table: Table) -> None
IMGUI_API void TableBeginRow(ImGuiTable* table);

table_end_row

def table_end_row(table: Table) -> None
IMGUI_API void TableEndRow(ImGuiTable* table);

table_begin_cell

def table_begin_cell(table: Table, column_n: int) -> None
IMGUI_API void TableBeginCell(ImGuiTable* table, int column_n);

table_end_cell

def table_end_cell(table: Table) -> None
IMGUI_API void TableEndCell(ImGuiTable* table);

table_get_cell_bg_rect

def table_get_cell_bg_rect(table: Table, column_n: int) -> ImRect
IMGUI_API ImRect TableGetCellBgRect(const ImGuiTable* table, int column_n);

table_get_column_name

def table_get_column_name(table: Table, column_n: int) -> str
IMGUI_API const char* TableGetColumnName(const ImGuiTable* table, int column_n);

table_get_column_resize_id

def table_get_column_resize_id(table: Table, column_n: int, instance_no: int = 0) -> ID
IMGUI_API ImGuiID TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no = 0);

table_calc_max_column_width

def table_calc_max_column_width(table: Table, column_n: int) -> float
IMGUI_API float TableCalcMaxColumnWidth(const ImGuiTable* table, int column_n);

table_set_column_width_auto_single

def table_set_column_width_auto_single(table: Table, column_n: int) -> None
IMGUI_API void TableSetColumnWidthAutoSingle(ImGuiTable* table, int column_n);

table_set_column_width_auto_all

def table_set_column_width_auto_all(table: Table) -> None
IMGUI_API void TableSetColumnWidthAutoAll(ImGuiTable* table);

table_set_column_display_order

def table_set_column_display_order(table: Table, column_n: int, dst_order: int) -> None
IMGUI_API void TableSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);

table_queue_set_column_display_order

def table_queue_set_column_display_order(table: Table, column_n: int, dst_order: int) -> None
IMGUI_API void TableQueueSetColumnDisplayOrder(ImGuiTable* table, int column_n, int dst_order);

table_remove

def table_remove(table: Table) -> None
IMGUI_API void TableRemove(ImGuiTable* table);

table_gc_compact_transient_buffers

@overload
def table_gc_compact_transient_buffers(table: Table) -> None

@overload
def table_gc_compact_transient_buffers(table: TableTempData) -> None
IMGUI_API void TableGcCompactTransientBuffers(ImGuiTable* table);
IMGUI_API void TableGcCompactTransientBuffers(ImGuiTableTempData* table);

table_gc_compact_settings

def table_gc_compact_settings() -> None
IMGUI_API void TableGcCompactSettings();

Tables: Settings

table_load_settings

def table_load_settings(table: Table) -> None
IMGUI_API void TableLoadSettings(ImGuiTable* table);

table_load_settings_for_columns

def table_load_settings_for_columns(table: Table) -> None
IMGUI_API void TableLoadSettingsForColumns(ImGuiTable* table);

table_load_settings_for_column

def table_load_settings_for_column(column: TableColumn, column_settings: TableColumnSettings, load_flags: TableFlags) -> None
IMGUI_API void TableLoadSettingsForColumn(ImGuiTableColumn* column, ImGuiTableColumnSettings* column_settings, ImGuiTableFlags load_flags);

table_save_settings

def table_save_settings(table: Table) -> None
IMGUI_API void TableSaveSettings(ImGuiTable* table);

table_reset_settings

def table_reset_settings(table: Table) -> None
IMGUI_API void TableResetSettings(ImGuiTable* table);

table_get_bound_settings

def table_get_bound_settings(table: Table) -> TableSettings
IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);

table_settings_add_settings_handler

def table_settings_add_settings_handler() -> None
IMGUI_API void TableSettingsAddSettingsHandler();

table_settings_create

def table_settings_create(id_: ID, columns_count: int) -> TableSettings
IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID id, int columns_count);

table_settings_find_by_id

def table_settings_find_by_id(id_: ID) -> TableSettings
IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);

set_window_clip_rect_before_set_channel

def set_window_clip_rect_before_set_channel(window: Window, clip_rect: ImRect) -> None
IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);

Legacy Columns API (this is not exposed because we will encourage transitioning to the Tables API)

begin_columns

def begin_columns(str_id: str, count: int, flags: OldColumnFlags = 0) -> None
IMGUI_API void BeginColumns(const char* str_id, int count, ImGuiOldColumnFlags flags = 0);

setup number of columns. use an identifier to distinguish multiple column sets. close with EndColumns().

end_columns

def end_columns() -> None
IMGUI_API void EndColumns();

close columns

push_column_clip_rect

def push_column_clip_rect(column_index: int) -> None
IMGUI_API void PushColumnClipRect(int column_index);

push_columns_background

def push_columns_background() -> None
IMGUI_API void PushColumnsBackground();

pop_columns_background

def pop_columns_background() -> None
IMGUI_API void PopColumnsBackground();

get_columns_id

def get_columns_id(str_id: str, count: int) -> ID
IMGUI_API ImGuiID GetColumnsID(const char* str_id, int count);

find_or_create_columns

def find_or_create_columns(window: Window, id_: ID) -> OldColumns
IMGUI_API ImGuiOldColumns* FindOrCreateColumns(ImGuiWindow* window, ImGuiID id);

get_column_offset_from_norm

def get_column_offset_from_norm(columns: OldColumns, offset_norm: float) -> float
IMGUI_API float GetColumnOffsetFromNorm(const ImGuiOldColumns* columns, float offset_norm);

get_column_norm_from_offset

def get_column_norm_from_offset(columns: OldColumns, offset: float) -> float
IMGUI_API float GetColumnNormFromOffset(const ImGuiOldColumns* columns, float offset);
}

ImGui internal API

No guarantee of forward compatibility here!

Windows
We should always have a CurrentWindow in the stack (there is an implicit “Debug” window)
If this ever crashes because g.CurrentWindow is None, it means that either:

get_io

def get_io(ctx: Context) -> IO
IMGUI_API ImGuiIO& GetIO(ImGuiContext* ctx);

get_platform_io

def get_platform_io(ctx: Context) -> PlatformIO
IMGUI_API ImGuiPlatformIO& GetPlatformIO(ImGuiContext* ctx);

get_scale

def get_scale() -> float
inline float GetScale();

(private API)

FIXME-DPI: I don’t want to formalize this just yet. Because reasons. Please don’t use.

get_current_window_read

def get_current_window_read() -> Window
inline ImGuiWindow* GetCurrentWindowRead();

(private API)

find_window_by_id

def find_window_by_id(id_: ID) -> Window
IMGUI_API ImGuiWindow* FindWindowByID(ImGuiID id);

find_window_by_name

def find_window_by_name(name: str) -> Window
IMGUI_API ImGuiWindow* FindWindowByName(const char* name);
def update_window_parent_and_root_links(window: Window, flags: WindowFlags, parent_window: Window) -> None
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);

update_window_skip_refresh

def update_window_skip_refresh(window: Window) -> None
IMGUI_API void UpdateWindowSkipRefresh(ImGuiWindow* window);

calc_window_next_auto_fit_size

def calc_window_next_auto_fit_size(window: Window) -> ImVec2
IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window);

is_window_child_of

def is_window_child_of(window: Window, potential_parent: Window, popup_hierarchy: bool, dock_hierarchy: bool) -> bool
IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool popup_hierarchy, bool dock_hierarchy);

is_window_in_begin_stack

def is_window_in_begin_stack(window: Window) -> bool
IMGUI_API bool IsWindowInBeginStack(ImGuiWindow* window);

is_window_within_begin_stack_of

def is_window_within_begin_stack_of(window: Window, potential_parent: Window) -> bool
IMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent);

is_window_above

def is_window_above(potential_above: Window, potential_below: Window) -> bool
IMGUI_API bool IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below);

is_window_nav_focusable

def is_window_nav_focusable(window: Window) -> bool
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window);

set_window_pos

def set_window_pos(window: Window, pos: ImVec2Like, cond: Cond = 0) -> None
IMGUI_API void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond = 0);

set_window_size

def set_window_size(window: Window, size: ImVec2Like, cond: Cond = 0) -> None
IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond = 0);

set_window_collapsed

def set_window_collapsed(window: Window, collapsed: bool, cond: Cond = 0) -> None
IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond = 0);

set_window_hit_test_hole

def set_window_hit_test_hole(window: Window, pos: ImVec2Like, size: ImVec2Like) -> None
IMGUI_API void SetWindowHitTestHole(ImGuiWindow* window, const ImVec2& pos, const ImVec2& size);

set_window_hidden_and_skip_items_for_current_frame

def set_window_hidden_and_skip_items_for_current_frame(window: Window) -> None
IMGUI_API void SetWindowHiddenAndSkipItemsForCurrentFrame(ImGuiWindow* window);

set_window_parent_window_for_focus_route

def set_window_parent_window_for_focus_route(window: Window, parent_window: Window) -> None
inline void SetWindowParentWindowForFocusRoute(ImGuiWindow* window, ImGuiWindow* parent_window);

(private API)

You may also use SetNextWindowClass()'s FocusRouteParentWindowId field.

window_rect_abs_to_rel

def window_rect_abs_to_rel(window: Window, r: ImRect) -> ImRect
inline ImRect WindowRectAbsToRel(ImGuiWindow* window, const ImRect& r);

(private API)

window_rect_rel_to_abs

def window_rect_rel_to_abs(window: Window, r: ImRect) -> ImRect
inline ImRect WindowRectRelToAbs(ImGuiWindow* window, const ImRect& r);

(private API)

window_pos_abs_to_rel

def window_pos_abs_to_rel(window: Window, p: ImVec2Like) -> ImVec2
inline ImVec2 WindowPosAbsToRel(ImGuiWindow* window, const ImVec2& p);

(private API)

window_pos_rel_to_abs

def window_pos_rel_to_abs(window: Window, p: ImVec2Like) -> ImVec2
inline ImVec2 WindowPosRelToAbs(ImGuiWindow* window, const ImVec2& p);

(private API)

set_next_window_flags

def set_next_window_flags(flags: WindowFlags, enabled: bool) -> None
IMGUI_API void SetNextWindowFlags(ImGuiWindowFlags flags, bool enabled);

set_next_window_child_flags

def set_next_window_child_flags(flags: ChildFlags, enabled: bool) -> None
IMGUI_API void SetNextWindowChildFlags(ImGuiChildFlags flags, bool enabled);

Windows: Display Order and Focus Order

focus_window

def focus_window(window: Window, flags: FocusRequestFlags = 0) -> None
IMGUI_API void FocusWindow(ImGuiWindow* window, ImGuiFocusRequestFlags flags = 0);

focus_top_most_window_under_one

def focus_top_most_window_under_one(under_this_window: Window, ignore_window: Window, filter_viewport: Viewport, flags: FocusRequestFlags) -> None
IMGUI_API void FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window, ImGuiViewport* filter_viewport, ImGuiFocusRequestFlags flags);

bring_window_to_focus_front

def bring_window_to_focus_front(window: Window) -> None
IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window);

bring_window_to_display_front

def bring_window_to_display_front(window: Window) -> None
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window);

bring_window_to_display_back

def bring_window_to_display_back(window: Window) -> None
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window);

bring_window_to_display_behind

def bring_window_to_display_behind(window: Window, above_window: Window) -> None
IMGUI_API void BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* above_window);

find_window_display_index

def find_window_display_index(window: Window) -> int
IMGUI_API int FindWindowDisplayIndex(ImGuiWindow* window);

find_bottom_most_visible_window_within_begin_stack

def find_bottom_most_visible_window_within_begin_stack(window: Window) -> Window
IMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window);

set_next_window_refresh_policy

def set_next_window_refresh_policy(flags: WindowRefreshFlags) -> None
IMGUI_API void SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags);

Windows: Idle, Refresh Policies [EXPERIMENTAL]

Fonts, drawing

register_user_texture

def register_user_texture(tex: ImTextureData) -> None
IMGUI_API void RegisterUserTexture(ImTextureData* tex);

Register external texture. EXPERIMENTAL.

unregister_user_texture

def unregister_user_texture(tex: ImTextureData) -> None
IMGUI_API void UnregisterUserTexture(ImTextureData* tex);

register_font_atlas

def register_font_atlas(atlas: ImFontAtlas) -> None
IMGUI_API void RegisterFontAtlas(ImFontAtlas* atlas);

unregister_font_atlas

def unregister_font_atlas(atlas: ImFontAtlas) -> None
IMGUI_API void UnregisterFontAtlas(ImFontAtlas* atlas);

set_current_font

def set_current_font(font: ImFont, font_size_before_scaling: float, font_size_after_scaling: float) -> None
IMGUI_API void SetCurrentFont(ImFont* font, float font_size_before_scaling, float font_size_after_scaling);

update_current_font_size

def update_current_font_size(restore_font_size_after_scaling: float) -> None
IMGUI_API void UpdateCurrentFontSize(float restore_font_size_after_scaling);

set_pixel_density

def set_pixel_density(pixel_density: float) -> None
IMGUI_API void SetPixelDensity(float pixel_density);

was SetFontRasterizerDensity()

get_pixel_density

def get_pixel_density() -> float
inline float GetPixelDensity();

(private API)

get_rounded_font_size

def get_rounded_font_size(size: float) -> float
inline float GetRoundedFontSize(float size);

(private API)

get_default_font

def get_default_font() -> ImFont
IMGUI_API ImFont* GetDefaultFont();

push_password_font

def push_password_font() -> None
IMGUI_API void PushPasswordFont();

pop_password_font

def pop_password_font() -> None
IMGUI_API void PopPasswordFont();

get_foreground_draw_list

def get_foreground_draw_list(window: Window) -> ImDrawList
inline ImDrawList* GetForegroundDrawList(ImGuiWindow* window);

(private API)

add_draw_list_to_draw_data_ex

def add_draw_list_to_draw_data_ex(draw_data: ImDrawData, out_list: ImVector_ImDrawList_ptr, draw_list: ImDrawList) -> None
IMGUI_API void AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list);

Init

initialize

def initialize() -> None
IMGUI_API void Initialize();

shutdown

def shutdown() -> None
IMGUI_API void Shutdown();

Since 1.60 this is a private function. You can call DestroyContext() to destroy the context created by CreateContext().

Context name & generic context hooks

set_context_name

def set_context_name(ctx: Context, name: str) -> None
IMGUI_API void SetContextName(ImGuiContext* ctx, const char* name);

add_context_hook

def add_context_hook(ctx: Context, hook: ContextHook) -> ID
IMGUI_API ImGuiID AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook);

remove_context_hook

def remove_context_hook(ctx: Context, hook_to_remove: ID) -> None
IMGUI_API void RemoveContextHook(ImGuiContext* ctx, ImGuiID hook_to_remove);

call_context_hooks

def call_context_hooks(ctx: Context, type: ContextHookType) -> None
IMGUI_API void CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType type);

NewFrame

update_input_events

def update_input_events(trickle_fast_inputs: bool) -> None
IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);

update_hovered_window_and_capture_flags

def update_hovered_window_and_capture_flags(mouse_pos: ImVec2Like) -> None
IMGUI_API void UpdateHoveredWindowAndCaptureFlags(const ImVec2& mouse_pos);

start_mouse_moving_window

def start_mouse_moving_window(window: Window) -> None
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);

start_mouse_moving_window_or_node

def start_mouse_moving_window_or_node(window: Window, node: DockNode, undock: bool) -> None
IMGUI_API void StartMouseMovingWindowOrNode(ImGuiWindow* window, ImGuiDockNode* node, bool undock);

stop_mouse_moving_window

def stop_mouse_moving_window() -> None
IMGUI_API void StopMouseMovingWindow();

update_mouse_moving_window_new_frame

def update_mouse_moving_window_new_frame() -> None
IMGUI_API void UpdateMouseMovingWindowNewFrame();

update_mouse_moving_window_end_frame

def update_mouse_moving_window_end_frame() -> None
IMGUI_API void UpdateMouseMovingWindowEndFrame();

Viewports

translate_windows_in_viewport

def translate_windows_in_viewport(viewport: ViewportP, old_pos: ImVec2Like, new_pos: ImVec2Like, old_size: ImVec2Like, new_size: ImVec2Like) -> None
IMGUI_API void TranslateWindowsInViewport(ImGuiViewportP* viewport, const ImVec2& old_pos, const ImVec2& new_pos, const ImVec2& old_size, const ImVec2& new_size);

scale_windows_in_viewport

def scale_windows_in_viewport(viewport: ViewportP, scale: float) -> None
IMGUI_API void ScaleWindowsInViewport(ImGuiViewportP* viewport, float scale);

destroy_platform_window

def destroy_platform_window(viewport: ViewportP) -> None
IMGUI_API void DestroyPlatformWindow(ImGuiViewportP* viewport);

set_window_viewport

def set_window_viewport(window: Window, viewport: ViewportP) -> None
IMGUI_API void SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport);

set_current_viewport

def set_current_viewport(window: Window, viewport: ViewportP) -> None
IMGUI_API void SetCurrentViewport(ImGuiWindow* window, ImGuiViewportP* viewport);

get_viewport_platform_monitor

def get_viewport_platform_monitor(viewport: Viewport) -> PlatformMonitor
IMGUI_API const ImGuiPlatformMonitor* GetViewportPlatformMonitor(ImGuiViewport* viewport);

find_hovered_viewport_from_platform_window_stack

def find_hovered_viewport_from_platform_window_stack(mouse_platform_pos: ImVec2Like) -> ViewportP
IMGUI_API ImGuiViewportP* FindHoveredViewportFromPlatformWindowStack(const ImVec2& mouse_platform_pos);

Settings

mark_ini_settings_dirty

@overload
def mark_ini_settings_dirty() -> None

@overload
def mark_ini_settings_dirty(window: Window) -> None
IMGUI_API void MarkIniSettingsDirty();
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);

clear_ini_settings

def clear_ini_settings() -> None
IMGUI_API void ClearIniSettings();

cleanup_ini_settings

def cleanup_ini_settings(args: SettingsCleanupArgs) -> None
IMGUI_API void CleanupIniSettings(ImGuiSettingsCleanupArgs* args);

[BETA] Expected to turn into a public API. Please report if you are using this!

add_settings_handler

def add_settings_handler(handler: SettingsHandler) -> None
IMGUI_API void AddSettingsHandler(const ImGuiSettingsHandler* handler);

remove_settings_handler

def remove_settings_handler(type_name: str) -> None
IMGUI_API void RemoveSettingsHandler(const char* type_name);

find_settings_handler

def find_settings_handler(type_name: str) -> SettingsHandler
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);

Settings - Windows

create_new_window_settings

def create_new_window_settings(name: str) -> WindowSettings
IMGUI_API ImGuiWindowSettings* CreateNewWindowSettings(const char* name);

find_window_settings_by_id

def find_window_settings_by_id(id_: ID) -> WindowSettings
IMGUI_API ImGuiWindowSettings* FindWindowSettingsByID(ImGuiID id);

find_window_settings_by_window

def find_window_settings_by_window(window: Window) -> WindowSettings
IMGUI_API ImGuiWindowSettings* FindWindowSettingsByWindow(ImGuiWindow* window);

clear_window_settings

def clear_window_settings(name: str) -> None
IMGUI_API void ClearWindowSettings(const char* name);

localize_register_entries

def localize_register_entries(entries: LocEntry, count: int) -> None
IMGUI_API void LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count);

Localization

localize_get_msg

def localize_get_msg(key: LocKey) -> str
inline const char* LocalizeGetMsg(ImGuiLocKey key);

(private API)

Scrolling

set_scroll_x

def set_scroll_x(window: Window, scroll_x: float) -> None
IMGUI_API void SetScrollX(ImGuiWindow* window, float scroll_x);

set_scroll_y

def set_scroll_y(window: Window, scroll_y: float) -> None
IMGUI_API void SetScrollY(ImGuiWindow* window, float scroll_y);

set_scroll_from_pos_x

def set_scroll_from_pos_x(window: Window, local_x: float, center_x_ratio: float) -> None
IMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio);

set_scroll_from_pos_y

def set_scroll_from_pos_y(window: Window, local_y: float, center_y_ratio: float) -> None
IMGUI_API void SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio);

scroll_to_item

def scroll_to_item(flags: ScrollFlags = 0) -> None
IMGUI_API void ScrollToItem(ImGuiScrollFlags flags = 0);

Early work-in-progress API (ScrollToItem() will become public)

scroll_to_rect

def scroll_to_rect(window: Window, rect: ImRect, flags: ScrollFlags = 0) -> None
IMGUI_API void ScrollToRect(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);

scroll_to_rect_ex

def scroll_to_rect_ex(window: Window, rect: ImRect, flags: ScrollFlags = 0) -> ImVec2
IMGUI_API ImVec2 ScrollToRectEx(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);

scroll_to_bring_rect_into_view

def scroll_to_bring_rect_into_view(window: Window, rect: ImRect) -> None
inline void ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& rect);

#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS (private API)

Basic Accessors

get_item_status_flags

def get_item_status_flags() -> ItemStatusFlags
inline ImGuiItemStatusFlags GetItemStatusFlags();

(private API)

get_active_id

def get_active_id() -> ID
inline ImGuiID GetActiveID();

(private API)

get_focus_id

def get_focus_id() -> ID
inline ImGuiID GetFocusID();

(private API)

set_active_id

def set_active_id(id_: ID, window: Window) -> None
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);

set_focus_id

def set_focus_id(id_: ID, window: Window) -> None
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window);

clear_active_id

def clear_active_id() -> None
IMGUI_API void ClearActiveID();

get_hovered_id

def get_hovered_id() -> ID
IMGUI_API ImGuiID GetHoveredID();

set_hovered_id

def set_hovered_id(id_: ID) -> None
IMGUI_API void SetHoveredID(ImGuiID id);

keep_alive_id

def keep_alive_id(id_: ID) -> None
IMGUI_API void KeepAliveID(ImGuiID id);

mark_item_edited

def mark_item_edited(id_: ID) -> None
IMGUI_API void MarkItemEdited(ImGuiID id);

Mark data associated to given item as “edited”, used by IsItemDeactivatedAfterEdit() function.

push_override_id

def push_override_id(id_: ID) -> None
IMGUI_API void PushOverrideID(ImGuiID id);

Push given value as-is at the top of the ID stack (whereas PushID combines old and new hashes)

get_id_with_seed

@overload
def get_id_with_seed(str_id_begin: str, str_id_end: str, seed: ID) -> ID

@overload
def get_id_with_seed(n: int, seed: ID) -> ID
IMGUI_API ImGuiID GetIDWithSeed(const char* str_id_begin, const char* str_id_end, ImGuiID seed);
IMGUI_API ImGuiID GetIDWithSeed(int n, ImGuiID seed);

item_size

@overload
def item_size(size: ImVec2Like, text_baseline_y: float = -1.0) -> None

@overload
def item_size(bb: ImRect, text_baseline_y: float = -1.0) -> None
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
inline void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f);

Basic Helpers for widget code

item_add

def item_add(bb: ImRect, id_: ID, nav_bb: Optional[ImRect] = None, extra_flags: ItemFlags = 0) -> bool
IMGUI_API bool ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb = NULL, ImGuiItemFlags extra_flags = 0);

item_hoverable

def item_hoverable(bb: ImRect, id_: ID, item_flags: ItemFlags) -> bool
IMGUI_API bool ItemHoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags);

is_window_content_hoverable

def is_window_content_hoverable(window: Window, flags: HoveredFlags = 0) -> bool
IMGUI_API bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags = 0);

is_clipped_ex

def is_clipped_ex(bb: ImRect, id_: ID) -> bool
IMGUI_API bool IsClippedEx(const ImRect& bb, ImGuiID id);

set_last_item_data

def set_last_item_data(item_id: ID, item_flags: ItemFlags, status_flags: ItemStatusFlags, item_rect: ImRect) -> None
IMGUI_API void SetLastItemData(ImGuiID item_id, ImGuiItemFlags item_flags, ImGuiItemStatusFlags status_flags, const ImRect& item_rect);

calc_item_size

def calc_item_size(size: ImVec2Like, default_w: float, default_h: float) -> ImVec2
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_w, float default_h);

calc_wrap_width_for_pos

def calc_wrap_width_for_pos(pos: ImVec2Like, wrap_pos_x: float) -> float
IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);

push_multi_items_widths

def push_multi_items_widths(components: int, width_full: float) -> None
IMGUI_API void PushMultiItemsWidths(int components, float width_full);

shrink_widths

def shrink_widths(items: ShrinkWidthItem, count: int, width_excess: float, width_min: float) -> None
IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess, float width_min);

calc_clip_rect_visible_items_y

def calc_clip_rect_visible_items_y(clip_rect: ImRect, pos: ImVec2Like, items_height: float, out_visible_start: int, out_visible_end: int) -> Tuple[int, int]
IMGUI_API void CalcClipRectVisibleItemsY(const ImRect& clip_rect, const ImVec2& pos, float items_height, int* out_visible_start, int* out_visible_end);

Parameter stacks (shared)

get_style_var_info

def get_style_var_info(idx: StyleVar) -> StyleVarInfo
IMGUI_API const ImGuiStyleVarInfo* GetStyleVarInfo(ImGuiStyleVar idx);

begin_disabled_override_reenable

def begin_disabled_override_reenable() -> None
IMGUI_API void BeginDisabledOverrideReenable();

end_disabled_override_reenable

def end_disabled_override_reenable() -> None
IMGUI_API void EndDisabledOverrideReenable();

Logging/Capture

log_begin

def log_begin(flags: LogFlags, auto_open_depth: int) -> None
IMGUI_API void LogBegin(ImGuiLogFlags flags, int auto_open_depth);

-> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.

log_to_buffer

def log_to_buffer(auto_open_depth: int = -1) -> None
IMGUI_API void LogToBuffer(int auto_open_depth = -1);

Start logging/capturing to internal buffer

log_rendered_text

def log_rendered_text(ref_pos: ImVec2Like, text: str, text_end: Optional[str] = None) -> None
IMGUI_API void LogRenderedText(const ImVec2* ref_pos, const char* text, const char* text_end = NULL);

log_set_next_text_decoration

def log_set_next_text_decoration(prefix: str, suffix: str) -> None
IMGUI_API void LogSetNextTextDecoration(const char* prefix, const char* suffix);

Childs

begin_child_ex

def begin_child_ex(name: str, id_: ID, size_arg: ImVec2Like, child_flags: ChildFlags, window_flags: WindowFlags) -> bool
IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);

find_front_most_visible_child_window

def find_front_most_visible_child_window(window: Window) -> Window
IMGUI_API ImGuiWindow* FindFrontMostVisibleChildWindow(ImGuiWindow* window);

Popups, Modals

begin_popup_ex

def begin_popup_ex(id_: ID, extra_window_flags: WindowFlags) -> bool
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_window_flags);

begin_popup_menu_ex

def begin_popup_menu_ex(id_: ID, label: str, extra_window_flags: WindowFlags) -> bool
IMGUI_API bool BeginPopupMenuEx(ImGuiID id, const char* label, ImGuiWindowFlags extra_window_flags);

open_popup_ex

def open_popup_ex(id_: ID, popup_flags: PopupFlags = PopupFlags_None) -> bool
IMGUI_API bool OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);

close_popup_to_level

def close_popup_to_level(remaining: int, restore_focus_to_window_under_popup: bool) -> None
IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup);

close_popups_over_window

def close_popups_over_window(ref_window: Window, restore_focus_to_window_under_popup: bool) -> None
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup);

close_popups_except_modals

def close_popups_except_modals() -> None
IMGUI_API void ClosePopupsExceptModals();

is_popup_open

def is_popup_open(id_: ID, popup_flags: PopupFlags) -> bool
IMGUI_API bool IsPopupOpen(ImGuiID id, ImGuiPopupFlags popup_flags);

get_popup_allowed_extent_rect

def get_popup_allowed_extent_rect(window: Window) -> ImRect
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);

get_top_most_popup_modal

def get_top_most_popup_modal() -> Window
IMGUI_API ImGuiWindow* GetTopMostPopupModal();

get_top_most_and_visible_popup_modal

def get_top_most_and_visible_popup_modal() -> Window
IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();

find_blocking_modal

def find_blocking_modal(window: Window) -> Window
IMGUI_API ImGuiWindow* FindBlockingModal(ImGuiWindow* window);

find_best_window_pos_for_popup

def find_best_window_pos_for_popup(window: Window) -> ImVec2
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);

find_best_window_pos_for_popup_ex

def find_best_window_pos_for_popup_ex(ref_pos: ImVec2Like, size: ImVec2Like, last_dir: Dir, r_outer: ImRect, r_avoid: ImRect, policy: PopupPositionPolicy) -> ImVec2
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy);

get_mouse_button_from_popup_flags

def get_mouse_button_from_popup_flags(flags: PopupFlags) -> MouseButton
IMGUI_API ImGuiMouseButton GetMouseButtonFromPopupFlags(ImGuiPopupFlags flags);

is_popup_open_request_for_item

def is_popup_open_request_for_item(flags: PopupFlags, id_: ID) -> bool
IMGUI_API bool IsPopupOpenRequestForItem(ImGuiPopupFlags flags, ImGuiID id);

is_popup_open_request_for_window

def is_popup_open_request_for_window(flags: PopupFlags) -> bool
IMGUI_API bool IsPopupOpenRequestForWindow(ImGuiPopupFlags flags);

Tooltips

begin_tooltip_ex

def begin_tooltip_ex(tooltip_flags: TooltipFlags, extra_window_flags: WindowFlags) -> bool
IMGUI_API bool BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);

begin_tooltip_hidden

def begin_tooltip_hidden() -> bool
IMGUI_API bool BeginTooltipHidden();

begin_viewport_side_bar

def begin_viewport_side_bar(name: str, viewport: Viewport, dir: Dir, size: float, window_flags: WindowFlags) -> bool
IMGUI_API bool BeginViewportSideBar(const char* name, ImGuiViewport* viewport, ImGuiDir dir, float size, ImGuiWindowFlags window_flags);

begin_menu_ex

def begin_menu_ex(label: str, icon: str, enabled: bool = True) -> bool
IMGUI_API bool BeginMenuEx(const char* label, const char* icon, bool enabled = true);

menu_item_ex

def menu_item_ex(label: str, icon: str, shortcut: Optional[str] = None, selected: bool = False, enabled: bool = True) -> bool
IMGUI_API bool MenuItemEx(const char* label, const char* icon, const char* shortcut = NULL, bool selected = false, bool enabled = true);

Combos

begin_combo_popup

def begin_combo_popup(popup_id: ID, bb: ImRect, flags: ComboFlags) -> bool
IMGUI_API bool BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags flags);

begin_combo_preview

def begin_combo_preview() -> bool
IMGUI_API bool BeginComboPreview();

Submit preview contents a combo. Call this after EndCombo() to display contents that’s more than just a text label.

end_combo_preview

def end_combo_preview() -> None
IMGUI_API void EndComboPreview();

Keyboard/Gamepad Navigation

nav_init_window

def nav_init_window(window: Window, force_reinit: bool) -> None
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);

nav_init_request_apply_result

def nav_init_request_apply_result() -> None
IMGUI_API void NavInitRequestApplyResult();

nav_move_request_but_no_result_yet

def nav_move_request_but_no_result_yet() -> bool
IMGUI_API bool NavMoveRequestButNoResultYet();

nav_move_request_submit

def nav_move_request_submit(move_dir: Dir, clip_dir: Dir, move_flags: NavMoveFlags, scroll_flags: ScrollFlags) -> None
IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);

nav_move_request_forward

def nav_move_request_forward(move_dir: Dir, clip_dir: Dir, move_flags: NavMoveFlags, scroll_flags: ScrollFlags) -> None
IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);

nav_move_request_resolve_with_last_item

def nav_move_request_resolve_with_last_item(result: NavItemData) -> None
IMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result);

nav_move_request_resolve_with_past_tree_node

def nav_move_request_resolve_with_past_tree_node(result: NavItemData, tree_node_data: TreeNodeStackData) -> None
IMGUI_API void NavMoveRequestResolveWithPastTreeNode(ImGuiNavItemData* result, const ImGuiTreeNodeStackData* tree_node_data);

nav_move_request_cancel

def nav_move_request_cancel() -> None
IMGUI_API void NavMoveRequestCancel();

nav_move_request_apply_result

def nav_move_request_apply_result() -> None
IMGUI_API void NavMoveRequestApplyResult();

nav_move_request_try_wrapping

def nav_move_request_try_wrapping(window: Window, move_flags: NavMoveFlags) -> None
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);

nav_highlight_activated

def nav_highlight_activated(id_: ID) -> None
IMGUI_API void NavHighlightActivated(ImGuiID id);

nav_clear_preferred_pos_for_axis

def nav_clear_preferred_pos_for_axis(axis: Axis) -> None
IMGUI_API void NavClearPreferredPosForAxis(ImGuiAxis axis);

set_nav_cursor_visible_after_move

def set_nav_cursor_visible_after_move() -> None
IMGUI_API void SetNavCursorVisibleAfterMove();

nav_update_current_window_is_scroll_pushable_x

def nav_update_current_window_is_scroll_pushable_x() -> None
IMGUI_API void NavUpdateCurrentWindowIsScrollPushableX();

set_nav_window

def set_nav_window(window: Window) -> None
IMGUI_API void SetNavWindow(ImGuiWindow* window);

set_nav_id

def set_nav_id(id_: ID, nav_layer: NavLayer, focus_scope_id: ID, rect_rel: ImRect) -> None
IMGUI_API void SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel);

set_nav_focus_scope

def set_nav_focus_scope(focus_scope_id: ID) -> None
IMGUI_API void SetNavFocusScope(ImGuiID focus_scope_id);

Focus/Activation

This should be part of a larger set of API: FocusItem(offset = -1), FocusItemByID(id), ActivateItem(offset = -1), ActivateItemByID(id) etc. which are much harder to design and implement than expected. I have a couple of private branches on this matter but it’s not simple. For now implementing the easy ones.

focus_item

def focus_item() -> None
IMGUI_API void FocusItem();

Focus last item (no selection/activation).

activate_item_by_id

def activate_item_by_id(id_: ID) -> None
IMGUI_API void ActivateItemByID(ImGuiID id);

Activate an item by ID (button, checkbox, tree node etc.). Activation is queued and processed on the next frame when the item is encountered again. Was called ‘ActivateItem()’ before 1.89.7.

Inputs

FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.

is_named_key

def is_named_key(key: Key) -> bool
inline bool IsNamedKey(ImGuiKey key);

(private API)

is_named_key_or_mod

def is_named_key_or_mod(key: Key) -> bool
inline bool IsNamedKeyOrMod(ImGuiKey key);

(private API)

is_legacy_key

def is_legacy_key(key: Key) -> bool
inline bool IsLegacyKey(ImGuiKey key);

(private API)

is_keyboard_key

def is_keyboard_key(key: Key) -> bool
inline bool IsKeyboardKey(ImGuiKey key);

(private API)

is_gamepad_key

def is_gamepad_key(key: Key) -> bool
inline bool IsGamepadKey(ImGuiKey key);

(private API)

is_mouse_key

def is_mouse_key(key: Key) -> bool
inline bool IsMouseKey(ImGuiKey key);

(private API)

is_alias_key

def is_alias_key(key: Key) -> bool
inline bool IsAliasKey(ImGuiKey key);

(private API)

is_lr_mod_key

def is_lr_mod_key(key: Key) -> bool
inline bool IsLRModKey(ImGuiKey key);

(private API)

fixup_key_chord

def fixup_key_chord(key_chord: KeyChord) -> KeyChord
ImGuiKeyChord FixupKeyChord(ImGuiKeyChord key_chord);

(private API)

convert_single_mod_flag_to_key

def convert_single_mod_flag_to_key(key: Key) -> Key
inline ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key);

(private API)

get_key_data

@overload
def get_key_data(ctx: Context, key: Key) -> KeyData

@overload
def get_key_data(key: Key) -> KeyData
IMGUI_API ImGuiKeyData* GetKeyData(ImGuiContext* ctx, ImGuiKey key);
inline ImGuiKeyData* GetKeyData(ImGuiKey key);

(private API)

mouse_button_to_key

def mouse_button_to_key(button: MouseButton) -> Key
inline ImGuiKey MouseButtonToKey(ImGuiMouseButton button);

(private API)

is_mouse_drag_past_threshold

def is_mouse_drag_past_threshold(button: MouseButton, lock_threshold: float = -1.0) -> bool
IMGUI_API bool IsMouseDragPastThreshold(ImGuiMouseButton button, float lock_threshold = -1.0f);

get_key_magnitude2d

def get_key_magnitude2d(key_left: Key, key_right: Key, key_up: Key, key_down: Key) -> ImVec2
IMGUI_API ImVec2 GetKeyMagnitude2d(ImGuiKey key_left, ImGuiKey key_right, ImGuiKey key_up, ImGuiKey key_down);

get_nav_tweak_pressed_amount

def get_nav_tweak_pressed_amount(axis: Axis) -> float
IMGUI_API float GetNavTweakPressedAmount(ImGuiAxis axis);

calc_typematic_repeat_amount

def calc_typematic_repeat_amount(t0: float, t1: float, repeat_delay: float, repeat_rate: float) -> int
IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);

get_typematic_repeat_rate

def get_typematic_repeat_rate(flags: InputFlags, repeat_delay: float, repeat_rate: float) -> Tuple[float, float]
IMGUI_API void GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate);

teleport_mouse_pos

def teleport_mouse_pos(pos: ImVec2Like) -> None
IMGUI_API void TeleportMousePos(const ImVec2& pos);

set_active_id_using_all_keyboard_keys

def set_active_id_using_all_keyboard_keys() -> None
IMGUI_API void SetActiveIdUsingAllKeyboardKeys();

is_active_id_using_nav_dir

def is_active_id_using_nav_dir(dir: Dir) -> bool
inline bool IsActiveIdUsingNavDir(ImGuiDir dir);

(private API)

[EXPERIMENTAL] Low-Level: Key/Input Ownership

get_key_owner

def get_key_owner(key: Key) -> ID
IMGUI_API ImGuiID GetKeyOwner(ImGuiKey key);

set_key_owner

def set_key_owner(key: Key, owner_id: ID, flags: InputFlags = 0) -> None
IMGUI_API void SetKeyOwner(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);

set_key_owners_for_key_chord

def set_key_owners_for_key_chord(key: KeyChord, owner_id: ID, flags: InputFlags = 0) -> None
IMGUI_API void SetKeyOwnersForKeyChord(ImGuiKeyChord key, ImGuiID owner_id, ImGuiInputFlags flags = 0);

set_item_key_owner

def set_item_key_owner(key: Key, flags: InputFlags) -> bool
IMGUI_API bool SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags);

test_key_owner

def test_key_owner(key: Key, owner_id: ID) -> bool
IMGUI_API bool TestKeyOwner(ImGuiKey key, ImGuiID owner_id);

Test that key is either not owned, either owned by ‘owner_id’

get_key_owner_data

def get_key_owner_data(ctx: Context, key: Key) -> KeyOwnerData
inline ImGuiKeyOwnerData* GetKeyOwnerData(ImGuiContext* ctx, ImGuiKey key);

(private API)

is_key_down

def is_key_down(key: Key, owner_id: ID) -> bool
IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);

[EXPERIMENTAL] High-Level: Input Access functions w/ support for Key/Input Ownership

is_key_pressed

def is_key_pressed(key: Key, flags: InputFlags, owner_id: ID = 0) -> bool
IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);

Important: when transitioning from old to new IsKeyPressed(): old API has “bool repeat = True”, so would default to repeat. New API requires explicit ImGuiInputFlags_Repeat.

is_key_released

def is_key_released(key: Key, owner_id: ID) -> bool
IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);

is_key_chord_pressed

def is_key_chord_pressed(key_chord: KeyChord, flags: InputFlags, owner_id: ID = 0) -> bool
IMGUI_API bool IsKeyChordPressed(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id = 0);

is_mouse_down

def is_mouse_down(button: MouseButton, owner_id: ID) -> bool
IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);

is_mouse_clicked

def is_mouse_clicked(button: MouseButton, flags: InputFlags, owner_id: ID = 0) -> bool
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);

is_mouse_released

def is_mouse_released(button: MouseButton, owner_id: ID) -> bool
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);

is_mouse_double_clicked

def is_mouse_double_clicked(button: MouseButton, owner_id: ID) -> bool
IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button, ImGuiID owner_id);

Shortcut Testing & Routing

shortcut

def shortcut(key_chord: KeyChord, flags: InputFlags, owner_id: ID) -> bool
IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);

set_shortcut_routing

def set_shortcut_routing(key_chord: KeyChord, flags: InputFlags, owner_id: ID) -> bool
IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiInputFlags flags, ImGuiID owner_id);

owner_id needs to be explicit and cannot be 0

test_shortcut_routing

def test_shortcut_routing(key_chord: KeyChord, owner_id: ID) -> bool
IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);

get_shortcut_routing_data

def get_shortcut_routing_data(key_chord: KeyChord) -> KeyRoutingData
IMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord);

Docking

(some functions are only declared in imgui.cpp, see Docking section)

dock_context_initialize

def dock_context_initialize(ctx: Context) -> None
IMGUI_API void DockContextInitialize(ImGuiContext* ctx);

dock_context_shutdown

def dock_context_shutdown(ctx: Context) -> None
IMGUI_API void DockContextShutdown(ImGuiContext* ctx);

dock_context_clear_nodes

def dock_context_clear_nodes(ctx: Context, root_id: ID, clear_settings_refs: bool) -> None
IMGUI_API void DockContextClearNodes(ImGuiContext* ctx, ImGuiID root_id, bool clear_settings_refs);

Use root_id==0 to clear all

dock_context_rebuild_nodes

def dock_context_rebuild_nodes(ctx: Context) -> None
IMGUI_API void DockContextRebuildNodes(ImGuiContext* ctx);

dock_context_new_frame_update_undocking

def dock_context_new_frame_update_undocking(ctx: Context) -> None
IMGUI_API void DockContextNewFrameUpdateUndocking(ImGuiContext* ctx);

dock_context_new_frame_update_docking

def dock_context_new_frame_update_docking(ctx: Context) -> None
IMGUI_API void DockContextNewFrameUpdateDocking(ImGuiContext* ctx);

dock_context_end_frame

def dock_context_end_frame(ctx: Context) -> None
IMGUI_API void DockContextEndFrame(ImGuiContext* ctx);

dock_context_gen_node_id

def dock_context_gen_node_id(ctx: Context) -> ID
IMGUI_API ImGuiID DockContextGenNodeID(ImGuiContext* ctx);

dock_context_queue_dock

def dock_context_queue_dock(ctx: Context, target: Window, target_node: DockNode, payload: Window, split_dir: Dir, split_ratio: float, split_outer: bool) -> None
IMGUI_API void DockContextQueueDock(ImGuiContext* ctx, ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload, ImGuiDir split_dir, float split_ratio, bool split_outer);

dock_context_queue_undock_window

def dock_context_queue_undock_window(ctx: Context, window: Window) -> None
IMGUI_API void DockContextQueueUndockWindow(ImGuiContext* ctx, ImGuiWindow* window);

dock_context_queue_undock_node

def dock_context_queue_undock_node(ctx: Context, node: DockNode) -> None
IMGUI_API void DockContextQueueUndockNode(ImGuiContext* ctx, ImGuiDockNode* node);

dock_context_process_undock_window

def dock_context_process_undock_window(ctx: Context, window: Window, clear_persistent_docking_ref: bool = True) -> None
IMGUI_API void DockContextProcessUndockWindow(ImGuiContext* ctx, ImGuiWindow* window, bool clear_persistent_docking_ref = true);

dock_context_process_undock_node

def dock_context_process_undock_node(ctx: Context, node: DockNode) -> None
IMGUI_API void DockContextProcessUndockNode(ImGuiContext* ctx, ImGuiDockNode* node);

dock_context_calc_drop_pos_for_docking

def dock_context_calc_drop_pos_for_docking(target: Window, target_node: DockNode, payload_window: Window, payload_node: DockNode, split_dir: Dir, split_outer: bool, out_pos: ImVec2Like) -> bool
IMGUI_API bool DockContextCalcDropPosForDocking(ImGuiWindow* target, ImGuiDockNode* target_node, ImGuiWindow* payload_window, ImGuiDockNode* payload_node, ImGuiDir split_dir, bool split_outer, ImVec2* out_pos);

dock_context_find_node_by_id

def dock_context_find_node_by_id(ctx: Context, id_: ID) -> DockNode
IMGUI_API ImGuiDockNode*DockContextFindNodeByID(ImGuiContext* ctx, ImGuiID id);

dock_node_window_menu_handler_default

def dock_node_window_menu_handler_default(ctx: Context, node: DockNode, tab_bar: TabBar) -> None
IMGUI_API void DockNodeWindowMenuHandler_Default(ImGuiContext* ctx, ImGuiDockNode* node, ImGuiTabBar* tab_bar);

dock_node_begin_amend_tab_bar

def dock_node_begin_amend_tab_bar(node: DockNode) -> bool
IMGUI_API bool DockNodeBeginAmendTabBar(ImGuiDockNode* node);

dock_node_end_amend_tab_bar

def dock_node_end_amend_tab_bar() -> None
IMGUI_API void DockNodeEndAmendTabBar();

dock_node_get_root_node

def dock_node_get_root_node(node: DockNode) -> DockNode
inline ImGuiDockNode* DockNodeGetRootNode(ImGuiDockNode* node);

(private API)

dock_node_is_in_hierarchy_of

def dock_node_is_in_hierarchy_of(node: DockNode, parent: DockNode) -> bool
inline bool DockNodeIsInHierarchyOf(ImGuiDockNode* node, ImGuiDockNode* parent);

(private API)

dock_node_get_depth

def dock_node_get_depth(node: DockNode) -> int
inline int DockNodeGetDepth(const ImGuiDockNode* node);

(private API)

dock_node_get_window_menu_button_id

def dock_node_get_window_menu_button_id(node: DockNode) -> ID
inline ImGuiID DockNodeGetWindowMenuButtonId(const ImGuiDockNode* node);

(private API)

get_window_dock_node

def get_window_dock_node() -> DockNode
inline ImGuiDockNode* GetWindowDockNode();

(private API)

get_window_always_want_own_tab_bar

def get_window_always_want_own_tab_bar(window: Window) -> bool
IMGUI_API bool GetWindowAlwaysWantOwnTabBar(ImGuiWindow* window);

begin_docked

def begin_docked(window: Window, p_open: bool) -> bool
IMGUI_API void BeginDocked(ImGuiWindow* window, bool* p_open);

begin_dockable_drag_drop_source

def begin_dockable_drag_drop_source(window: Window) -> None
IMGUI_API void BeginDockableDragDropSource(ImGuiWindow* window);

begin_dockable_drag_drop_target

def begin_dockable_drag_drop_target(window: Window) -> None
IMGUI_API void BeginDockableDragDropTarget(ImGuiWindow* window);

set_window_dock

def set_window_dock(window: Window, dock_id: ID, cond: Cond) -> None
IMGUI_API void SetWindowDock(ImGuiWindow* window, ImGuiID dock_id, ImGuiCond cond);

dock_builder_dock_window

def dock_builder_dock_window(window_name: str, node_id: ID) -> None
IMGUI_API void DockBuilderDockWindow(const char* window_name, ImGuiID node_id);

Docking - Builder function needs to be generally called before the node is used/submitted.

dock_builder_get_node

def dock_builder_get_node(node_id: ID) -> DockNode
IMGUI_API ImGuiDockNode*DockBuilderGetNode(ImGuiID node_id);

dock_builder_get_central_node

def dock_builder_get_central_node(node_id: ID) -> DockNode
inline ImGuiDockNode* DockBuilderGetCentralNode(ImGuiID node_id);

(private API)

dock_builder_add_node

def dock_builder_add_node(node_id: ID = 0, flags: DockNodeFlags = 0) -> ID
IMGUI_API ImGuiID DockBuilderAddNode(ImGuiID node_id = 0, ImGuiDockNodeFlags flags = 0);

dock_builder_remove_node

def dock_builder_remove_node(node_id: ID) -> None
IMGUI_API void DockBuilderRemoveNode(ImGuiID node_id);

Remove node and all its child, undock all windows

dock_builder_remove_node_docked_windows

def dock_builder_remove_node_docked_windows(node_id: ID, clear_settings_refs: bool = True) -> None
IMGUI_API void DockBuilderRemoveNodeDockedWindows(ImGuiID node_id, bool clear_settings_refs = true);

dock_builder_remove_node_child_nodes

def dock_builder_remove_node_child_nodes(node_id: ID) -> None
IMGUI_API void DockBuilderRemoveNodeChildNodes(ImGuiID node_id);

Remove all split/hierarchy. All remaining docked windows will be re-docked to the remaining root node (node_id).

dock_builder_set_node_pos

def dock_builder_set_node_pos(node_id: ID, pos: ImVec2Like) -> None
IMGUI_API void DockBuilderSetNodePos(ImGuiID node_id, ImVec2 pos);

dock_builder_set_node_size

def dock_builder_set_node_size(node_id: ID, size: ImVec2Like) -> None
IMGUI_API void DockBuilderSetNodeSize(ImGuiID node_id, ImVec2 size);

dock_builder_copy_node

def dock_builder_copy_node(src_node_id: ID, dst_node_id: ID, out_node_remap_pairs: ImVector_ID) -> None
IMGUI_API void DockBuilderCopyNode(ImGuiID src_node_id, ImGuiID dst_node_id, ImVector<ImGuiID>* out_node_remap_pairs);

dock_builder_copy_window_settings

def dock_builder_copy_window_settings(src_name: str, dst_name: str) -> None
IMGUI_API void DockBuilderCopyWindowSettings(const char* src_name, const char* dst_name);

dock_builder_finish

def dock_builder_finish(node_id: ID) -> None
IMGUI_API void DockBuilderFinish(ImGuiID node_id);

[EXPERIMENTAL] Focus Scope

This is generally used to identify a unique input location (for e.g. a selection set)
There is one per window (automatically set in Begin), but:

push_focus_scope

def push_focus_scope(id_: ID) -> None
IMGUI_API void PushFocusScope(ImGuiID id);

pop_focus_scope

def pop_focus_scope() -> None
IMGUI_API void PopFocusScope();

is_in_nav_focus_route

def is_in_nav_focus_route(focus_scope_id: ID) -> bool
IMGUI_API bool IsInNavFocusRoute(ImGuiID focus_scope_id);

get_current_focus_scope

def get_current_focus_scope() -> ID
inline ImGuiID GetCurrentFocusScope();

(private API)

Focus scope we are outputting into, set by PushFocusScope()

Drag and Drop

is_drag_drop_active

def is_drag_drop_active() -> bool
IMGUI_API bool IsDragDropActive();

begin_drag_drop_target_custom

def begin_drag_drop_target_custom(bb: ImRect, id_: ID) -> bool
IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);

begin_drag_drop_target_viewport

def begin_drag_drop_target_viewport(viewport: Viewport, p_bb: Optional[ImRect] = None) -> bool
IMGUI_API bool BeginDragDropTargetViewport(ImGuiViewport* viewport, const ImRect* p_bb = NULL);

clear_drag_drop

def clear_drag_drop() -> None
IMGUI_API void ClearDragDrop();

is_drag_drop_payload_being_accepted

def is_drag_drop_payload_being_accepted() -> bool
IMGUI_API bool IsDragDropPayloadBeingAccepted();

render_drag_drop_target_rect_for_item

def render_drag_drop_target_rect_for_item(bb: ImRect) -> None
IMGUI_API void RenderDragDropTargetRectForItem(const ImRect& bb);

render_drag_drop_target_rect_ex

def render_drag_drop_target_rect_ex(draw_list: ImDrawList, bb: ImRect, rounding: float) -> None
IMGUI_API void RenderDragDropTargetRectEx(ImDrawList* draw_list, const ImRect& bb, float rounding);

Typing-Select API

(provide Windows Explorer style “select items by typing partial name” + “cycle through items by typing same letter” feature) (this is currently not documented nor used by main library, but should work. See “widgets_typingselect” in imgui_test_suite for usage code. Please let us know if you use this!)

get_typing_select_request

def get_typing_select_request(flags: TypingSelectFlags = TypingSelectFlags_None) -> TypingSelectRequest
IMGUI_API ImGuiTypingSelectRequest* GetTypingSelectRequest(ImGuiTypingSelectFlags flags = ImGuiTypingSelectFlags_None);

Box-Select API

begin_box_select

def begin_box_select(scope_rect: ImRect, window: Window, box_select_id: ID, ms_flags: MultiSelectFlags) -> bool
IMGUI_API bool BeginBoxSelect(const ImRect& scope_rect, ImGuiWindow* window, ImGuiID box_select_id, ImGuiMultiSelectFlags ms_flags);

end_box_select

def end_box_select(scope_rect: ImRect, ms_flags: MultiSelectFlags) -> None
IMGUI_API void EndBoxSelect(const ImRect& scope_rect, ImGuiMultiSelectFlags ms_flags);

Multi-Select API

multi_select_item_header

def multi_select_item_header(id_: ID, p_selected: bool, p_button_flags: ButtonFlags) -> bool
IMGUI_API void MultiSelectItemHeader(ImGuiID id, bool* p_selected, ImGuiButtonFlags* p_button_flags);
def multi_select_item_footer(id_: ID, p_selected: bool, p_pressed: bool, extra_flags: MultiSelectFlags = 0) -> Tuple[bool, bool]
IMGUI_API void MultiSelectItemFooter(ImGuiID id, bool* p_selected, bool* p_pressed, ImGuiMultiSelectFlags extra_flags = 0);

multi_select_add_set_all

def multi_select_add_set_all(ms: MultiSelectTempData, selected: bool) -> None
IMGUI_API void MultiSelectAddSetAll(ImGuiMultiSelectTempData* ms, bool selected);

multi_select_add_set_range

def multi_select_add_set_range(ms: MultiSelectTempData, selected: bool, range_dir: int, first_item: SelectionUserData, last_item: SelectionUserData) -> None
IMGUI_API void MultiSelectAddSetRange(ImGuiMultiSelectTempData* ms, bool selected, int range_dir, ImGuiSelectionUserData first_item, ImGuiSelectionUserData last_item);

get_box_select_state

def get_box_select_state(id_: ID) -> BoxSelectState
inline ImGuiBoxSelectState* GetBoxSelectState(ImGuiID id);

(private API)

get_multi_select_state

def get_multi_select_state(id_: ID) -> MultiSelectState
inline ImGuiMultiSelectState* GetMultiSelectState(ImGuiID id);

(private API)

get_current_tab_bar

def get_current_tab_bar() -> TabBar
inline ImGuiTabBar* GetCurrentTabBar();

Tab Bars (private API)

tab_bar_find_by_id

def tab_bar_find_by_id(id_: ID) -> TabBar
IMGUI_API ImGuiTabBar* TabBarFindByID(ImGuiID id);

tab_bar_remove

def tab_bar_remove(tab_bar: TabBar) -> None
IMGUI_API void TabBarRemove(ImGuiTabBar* tab_bar);

begin_tab_bar_ex

def begin_tab_bar_ex(tab_bar: TabBar, bb: ImRect, flags: TabBarFlags) -> bool
IMGUI_API bool BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& bb, ImGuiTabBarFlags flags);

tab_bar_find_tab_by_id

def tab_bar_find_tab_by_id(tab_bar: TabBar, tab_id: ID) -> TabItem
IMGUI_API ImGuiTabItem* TabBarFindTabByID(ImGuiTabBar* tab_bar, ImGuiID tab_id);

tab_bar_find_tab_by_order

def tab_bar_find_tab_by_order(tab_bar: TabBar, order: int) -> TabItem
IMGUI_API ImGuiTabItem* TabBarFindTabByOrder(ImGuiTabBar* tab_bar, int order);

tab_bar_find_most_recently_selected_tab_for_active_window

def tab_bar_find_most_recently_selected_tab_for_active_window(tab_bar: TabBar) -> TabItem
IMGUI_API ImGuiTabItem* TabBarFindMostRecentlySelectedTabForActiveWindow(ImGuiTabBar* tab_bar);

tab_bar_get_current_tab

def tab_bar_get_current_tab(tab_bar: TabBar) -> TabItem
IMGUI_API ImGuiTabItem* TabBarGetCurrentTab(ImGuiTabBar* tab_bar);

tab_bar_get_tab_order

def tab_bar_get_tab_order(tab_bar: TabBar, tab: TabItem) -> int
inline int TabBarGetTabOrder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);

(private API)

tab_bar_get_tab_name

def tab_bar_get_tab_name(tab_bar: TabBar, tab: TabItem) -> str
IMGUI_API const char* TabBarGetTabName(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);

tab_bar_add_tab

def tab_bar_add_tab(tab_bar: TabBar, tab_flags: TabItemFlags, window: Window) -> None
IMGUI_API void TabBarAddTab(ImGuiTabBar* tab_bar, ImGuiTabItemFlags tab_flags, ImGuiWindow* window);

tab_bar_remove_tab

def tab_bar_remove_tab(tab_bar: TabBar, tab_id: ID) -> None
IMGUI_API void TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id);

tab_bar_close_tab

def tab_bar_close_tab(tab_bar: TabBar, tab: TabItem) -> None
IMGUI_API void TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);

tab_bar_queue_focus

@overload
def tab_bar_queue_focus(tab_bar: TabBar, tab: TabItem) -> None

@overload
def tab_bar_queue_focus(tab_bar: TabBar, tab_name: str) -> None
IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, ImGuiTabItem* tab);
IMGUI_API void TabBarQueueFocus(ImGuiTabBar* tab_bar, const char* tab_name);

tab_bar_queue_reorder

def tab_bar_queue_reorder(tab_bar: TabBar, tab: TabItem, offset: int) -> None
IMGUI_API void TabBarQueueReorder(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, int offset);

tab_bar_queue_reorder_from_mouse_pos

def tab_bar_queue_reorder_from_mouse_pos(tab_bar: TabBar, tab: TabItem, mouse_pos: ImVec2Like) -> None
IMGUI_API void TabBarQueueReorderFromMousePos(ImGuiTabBar* tab_bar, ImGuiTabItem* tab, ImVec2 mouse_pos);

tab_bar_process_reorder

def tab_bar_process_reorder(tab_bar: TabBar) -> bool
IMGUI_API bool TabBarProcessReorder(ImGuiTabBar* tab_bar);

tab_item_ex

def tab_item_ex(tab_bar: TabBar, label: str, p_open: bool, flags: TabItemFlags, docked_window: Window) -> Tuple[bool, bool]
IMGUI_API bool TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags, ImGuiWindow* docked_window);

tab_item_spacing

def tab_item_spacing(str_id: str, flags: TabItemFlags, width: float) -> None
IMGUI_API void TabItemSpacing(const char* str_id, ImGuiTabItemFlags flags, float width);

tab_item_calc_size

@overload
def tab_item_calc_size(label: str, has_close_button_or_unsaved_marker: bool) -> ImVec2

@overload
def tab_item_calc_size(window: Window) -> ImVec2
IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker);
IMGUI_API ImVec2 TabItemCalcSize(ImGuiWindow* window);

tab_item_background

def tab_item_background(draw_list: ImDrawList, bb: ImRect, flags: TabItemFlags, col: ImU32) -> None
IMGUI_API void TabItemBackground(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImU32 col);

tab_item_label_and_close_button

def tab_item_label_and_close_button(draw_list: ImDrawList, bb: ImRect, flags: TabItemFlags, frame_padding: ImVec2Like, label: str, tab_id: ID, close_button_id: ID, is_contents_visible: bool, out_just_closed: bool, out_text_clipped: bool) -> Tuple[bool, bool]
IMGUI_API void TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb, ImGuiTabItemFlags flags, ImVec2 frame_padding, const char* label, ImGuiID tab_id, ImGuiID close_button_id, bool is_contents_visible, bool* out_just_closed, bool* out_text_clipped);

Render helpers

AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)

render_text

def render_text(pos: ImVec2Like, text: str, text_end: Optional[str] = None, hide_text_after_hash: bool = True) -> None
IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);

render_text_wrapped

def render_text_wrapped(pos: ImVec2Like, text: str, text_end: str, wrap_width: float) -> None
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);

render_text_clipped

def render_text_clipped(pos_min: ImVec2Like, pos_max: ImVec2Like, text: str, text_end: str, text_size_if_known: ImVec2Like, align: Optional[ImVec2Like] = None, clip_rect: Optional[ImRect] = None) -> None
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);

Python bindings defaults:
If align is None, then its default value will be: ImVec2(0, 0)

render_text_clipped_ex

def render_text_clipped_ex(draw_list: ImDrawList, pos_min: ImVec2Like, pos_max: ImVec2Like, text: str, text_end: str, text_size_if_known: ImVec2Like, align: Optional[ImVec2Like] = None, clip_rect: Optional[ImRect] = None) -> None
IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);

Python bindings defaults:
If align is None, then its default value will be: ImVec2(0, 0)

render_text_ellipsis

def render_text_ellipsis(draw_list: ImDrawList, pos_min: ImVec2Like, pos_max: ImVec2Like, ellipsis_max_x: float, text: str, text_end: str, text_size_if_known: ImVec2Like) -> None
IMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known);

render_frame

def render_frame(p_min: ImVec2Like, p_max: ImVec2Like, fill_col: ImU32, borders: bool = True, rounding: float = 0.0) -> None
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders = true, float rounding = 0.0f);

render_frame_border

def render_frame_border(p_min: ImVec2Like, p_max: ImVec2Like, rounding: float = 0.0) -> None
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);

render_color_component_marker

def render_color_component_marker(bb: ImRect, col: ImU32, rounding: float) -> None
IMGUI_API void RenderColorComponentMarker(const ImRect& bb, ImU32 col, float rounding);

render_color_rect_with_alpha_checkerboard

def render_color_rect_with_alpha_checkerboard(draw_list: ImDrawList, p_min: ImVec2Like, p_max: ImVec2Like, col: ImU32, alpha: float, grid_step: float, grid_off: ImVec2Like, rounding: float = 0.0, flags: ImDrawFlags = 0) -> None
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 col, float alpha, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);

render_nav_cursor

def render_nav_cursor(bb: ImRect, id_: ID, flags: NavRenderCursorFlags = NavRenderCursorFlags_None, rounding: float = -1.0) -> None
IMGUI_API void RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags = ImGuiNavRenderCursorFlags_None, float rounding = -1.0f);

Navigation highlight

find_rendered_text_end

def find_rendered_text_end(text: str, text_end: Optional[str] = None) -> str
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL);

Find the optional ## from which we stop displaying text.

render_mouse_cursor

def render_mouse_cursor(pos: ImVec2Like, scale: float, mouse_cursor: MouseCursor, col_fill: ImU32, col_border: ImU32, col_shadow: ImU32) -> None
IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);

render_arrow

def render_arrow(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32, dir: Dir, scale: float = 1.0) -> None
IMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f);

Render helpers (those functions don’t access any ImGui state!)

render_bullet

def render_bullet(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32) -> None
IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);

render_check_mark

def render_check_mark(draw_list: ImDrawList, pos: ImVec2Like, col: ImU32, sz: float) -> None
IMGUI_API void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz);

render_arrow_pointing_at

def render_arrow_pointing_at(draw_list: ImDrawList, pos: ImVec2Like, half_sz: ImVec2Like, direction: Dir, col: ImU32) -> None
IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);

render_arrow_dock_menu

def render_arrow_dock_menu(draw_list: ImDrawList, p_min: ImVec2Like, sz: float, col: ImU32) -> None
IMGUI_API void RenderArrowDockMenu(ImDrawList* draw_list, ImVec2 p_min, float sz, ImU32 col);

render_rect_filled_in_range_h

def render_rect_filled_in_range_h(draw_list: ImDrawList, rect: ImRect, col: ImU32, fill_x0: float, fill_x1: float, rounding: float) -> None
IMGUI_API void RenderRectFilledInRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float fill_x0, float fill_x1, float rounding);

render_rect_filled_with_hole

def render_rect_filled_with_hole(draw_list: ImDrawList, outer: ImRect, inner: ImRect, col: ImU32, rounding: float) -> None
IMGUI_API void RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding);

calc_rounding_flags_for_rect_in_rect

def calc_rounding_flags_for_rect_in_rect(r_in: ImRect, r_outer: ImRect, threshold: float) -> ImDrawFlags
IMGUI_API ImDrawFlags CalcRoundingFlagsForRectInRect(const ImRect& r_in, const ImRect& r_outer, float threshold);

Widgets: Text

text_ex

def text_ex(text: str, text_end: Optional[str] = None, flags: TextFlags = 0) -> None
IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);

text_aligned

def text_aligned(align_x: float, width: float, fmt: str) -> None
IMGUI_API void TextAligned(float align_x, float width, const char* fmt, ...) ;

FIXME-WIP: Works but API is likely to be reworked.

Widgets

button_ex

def button_ex(label: str, size_arg: Optional[ImVec2Like] = None, flags: ButtonFlags = 0) -> bool
IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);

Python bindings defaults:
If size_arg is None, then its default value will be: ImVec2(0, 0)

arrow_button_ex

def arrow_button_ex(str_id: str, dir: Dir, size_arg: ImVec2Like, flags: ButtonFlags = 0) -> bool
IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);

image_button_ex

def image_button_ex(id_: ID, tex_ref: ImTextureRef, image_size: ImVec2Like, uv0: ImVec2Like, uv1: ImVec2Like, bg_col: ImVec4Like, tint_col: ImVec4Like, flags: ButtonFlags = 0) -> bool
IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureRef tex_ref, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0);

separator_ex

def separator_ex(flags: SeparatorFlags, thickness: float = 1.0) -> None
IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f);

separator_text_ex

def separator_text_ex(id_: ID, label: str, label_end: str, extra_width: float) -> None
IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width);

checkbox_flags

@overload
def checkbox_flags(label: str, flags: ImS64, flags_value: ImS64) -> bool

@overload
def checkbox_flags(label: str, flags: ImU64, flags_value: ImU64) -> bool
IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);
IMGUI_API bool CheckboxFlags(const char* label, ImU64* flags, ImU64 flags_value);

Widgets: Window Decorations

close_button

def close_button(id_: ID, pos: ImVec2Like) -> bool
IMGUI_API bool CloseButton(ImGuiID id, const ImVec2& pos);

collapse_button

def collapse_button(id_: ID, pos: ImVec2Like, dock_node: DockNode) -> bool
IMGUI_API bool CollapseButton(ImGuiID id, const ImVec2& pos, ImGuiDockNode* dock_node);

scrollbar

def scrollbar(axis: Axis) -> None
IMGUI_API void Scrollbar(ImGuiAxis axis);

scrollbar_ex

def scrollbar_ex(bb: ImRect, id_: ID, axis: Axis, p_scroll_v: ImS64, avail_v: ImS64, contents_v: ImS64, draw_rounding_flags: ImDrawFlags = 0) -> bool
IMGUI_API bool ScrollbarEx(const ImRect& bb, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 avail_v, ImS64 contents_v, ImDrawFlags draw_rounding_flags = 0);

get_window_scrollbar_rect

def get_window_scrollbar_rect(window: Window, axis: Axis) -> ImRect
IMGUI_API ImRect GetWindowScrollbarRect(ImGuiWindow* window, ImGuiAxis axis);

get_window_scrollbar_id

def get_window_scrollbar_id(window: Window, axis: Axis) -> ID
IMGUI_API ImGuiID GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis);

get_window_resize_corner_id

def get_window_resize_corner_id(window: Window, n: int) -> ID
IMGUI_API ImGuiID GetWindowResizeCornerID(ImGuiWindow* window, int n);

0..3: corners

get_window_resize_border_id

def get_window_resize_border_id(window: Window, dir: Dir) -> ID
IMGUI_API ImGuiID GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir);

extend_hit_box_when_near_viewport_edge

def extend_hit_box_when_near_viewport_edge(window: Window, bb: ImRect, threshold: float, axis: Axis) -> None
IMGUI_API void ExtendHitBoxWhenNearViewportEdge(ImGuiWindow* window, ImRect* bb, float threshold, ImGuiAxis axis);

Widgets low-level behaviors

button_behavior

def button_behavior(bb: ImRect, id_: ID, out_hovered: bool, out_held: bool, flags: ButtonFlags = 0) -> Tuple[bool, bool, bool]
IMGUI_API bool ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);

drag_behavior

def drag_behavior(id_: ID, data_type: DataType, p_v: Any, v_speed: float, p_min: Any, p_max: Any, format: str, flags: SliderFlags) -> bool
IMGUI_API bool DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v_speed, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags);

slider_behavior

def slider_behavior(bb: ImRect, id_: ID, data_type: DataType, p_v: Any, p_min: Any, p_max: Any, format: str, flags: SliderFlags, out_grab_bb: ImRect) -> bool
IMGUI_API bool SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);

splitter_behavior

def splitter_behavior(bb: ImRect, id_: ID, axis: Axis, size1: float, size2: float, min_size1: float, min_size2: float, hover_extend: float = 0.0, hover_visibility_delay: float = 0.0, bg_col: ImU32 = 0) -> Tuple[bool, float, float]
IMGUI_API bool SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float* size1, float* size2, float min_size1, float min_size2, float hover_extend = 0.0f, float hover_visibility_delay = 0.0f, ImU32 bg_col = 0);

Widgets: Tree Nodes

tree_node_behavior

def tree_node_behavior(id_: ID, flags: TreeNodeFlags, label: str, label_end: Optional[str] = None) -> bool
IMGUI_API bool TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);

tree_node_draw_line_to_child_node

def tree_node_draw_line_to_child_node(target_pos: ImVec2Like) -> None
IMGUI_API void TreeNodeDrawLineToChildNode(const ImVec2& target_pos);

tree_node_draw_line_to_tree_pop

def tree_node_draw_line_to_tree_pop(data: TreeNodeStackData) -> None
IMGUI_API void TreeNodeDrawLineToTreePop(const ImGuiTreeNodeStackData* data);

tree_push_override_id

def tree_push_override_id(id_: ID) -> None
IMGUI_API void TreePushOverrideID(ImGuiID id);

tree_node_set_open

def tree_node_set_open(storage_id: ID, open: bool) -> None
IMGUI_API void TreeNodeSetOpen(ImGuiID storage_id, bool open);

tree_node_update_next_open

def tree_node_update_next_open(storage_id: ID, flags: TreeNodeFlags) -> bool
IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID storage_id, ImGuiTreeNodeFlags flags);

Return open state. Consume previous SetNextItemOpen() data, if any. May return True when logging.

InputText

input_text_deactivate_hook

def input_text_deactivate_hook(id_: ID) -> None
IMGUI_API void InputTextDeactivateHook(ImGuiID id);

temp_input_is_active

def temp_input_is_active(id_: ID) -> bool
inline bool TempInputIsActive(ImGuiID id);

(private API)

get_input_text_state

def get_input_text_state(id_: ID) -> InputTextState
inline ImGuiInputTextState* GetInputTextState(ImGuiID id);

(private API)

Get input text state if active

set_next_item_ref_val

def set_next_item_ref_val(data_type: DataType, p_data: Any) -> None
IMGUI_API void SetNextItemRefVal(ImGuiDataType data_type, void* p_data);

is_item_active_as_input_text

def is_item_active_as_input_text() -> bool
inline bool IsItemActiveAsInputText();

(private API)

This may be useful to apply workaround that a based on distinguish whenever an item is active as a text input field.

Color

color_tooltip

def color_tooltip(text: str, col: float, flags: ColorEditFlags) -> None
IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);

color_edit_options_popup

def color_edit_options_popup(col: float, flags: ColorEditFlags) -> None
IMGUI_API void ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags);

color_picker_options_popup

def color_picker_options_popup(ref_col: float, flags: ColorEditFlags) -> None
IMGUI_API void ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags);

set_next_item_color_marker

def set_next_item_color_marker(col: ImU32) -> None
inline void SetNextItemColorMarker(ImU32 col);

(private API)

Shade functions (write over already created vertices)

shade_verts_linear_color_gradient_keep_alpha

def shade_verts_linear_color_gradient_keep_alpha(draw_list: ImDrawList, vert_start_idx: int, vert_end_idx: int, gradient_p0: ImVec2Like, gradient_p1: ImVec2Like, col0: ImU32, col1: ImU32) -> None
IMGUI_API void ShadeVertsLinearColorGradientKeepAlpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);

shade_verts_linear_uv

def shade_verts_linear_uv(draw_list: ImDrawList, vert_start_idx: int, vert_end_idx: int, a: ImVec2Like, b: ImVec2Like, uv_a: ImVec2Like, uv_b: ImVec2Like, clamp: bool) -> None
IMGUI_API void ShadeVertsLinearUV(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, bool clamp);

shade_verts_transform_pos

def shade_verts_transform_pos(draw_list: ImDrawList, vert_start_idx: int, vert_end_idx: int, pivot_in: ImVec2Like, cos_a: float, sin_a: float, pivot_out: ImVec2Like) -> None
IMGUI_API void ShadeVertsTransformPos(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, const ImVec2& pivot_in, float cos_a, float sin_a, const ImVec2& pivot_out);

Garbage collection

gc_compact_transient_misc_buffers

def gc_compact_transient_misc_buffers() -> None
IMGUI_API void GcCompactTransientMiscBuffers();

gc_compact_transient_window_buffers

def gc_compact_transient_window_buffers(window: Window) -> None
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);

gc_awake_transient_window_buffers

def gc_awake_transient_window_buffers(window: Window) -> None
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);

error_log

def error_log(msg: str) -> bool
IMGUI_API bool ErrorLog(const char* msg);

Error handling, State Recovery

error_recovery_store_state

def error_recovery_store_state(state_out: ErrorRecoveryState) -> None
IMGUI_API void ErrorRecoveryStoreState(ImGuiErrorRecoveryState* state_out);

error_recovery_try_to_recover_state

def error_recovery_try_to_recover_state(state_in: ErrorRecoveryState) -> None
IMGUI_API void ErrorRecoveryTryToRecoverState(const ImGuiErrorRecoveryState* state_in);

error_recovery_try_to_recover_window_state

def error_recovery_try_to_recover_window_state(state_in: ErrorRecoveryState) -> None
IMGUI_API void ErrorRecoveryTryToRecoverWindowState(const ImGuiErrorRecoveryState* state_in);

error_check_using_set_cursor_pos_to_extend_parent_boundaries

def error_check_using_set_cursor_pos_to_extend_parent_boundaries() -> None
IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();

error_check_end_frame_finalize_error_tooltip

def error_check_end_frame_finalize_error_tooltip() -> None
IMGUI_API void ErrorCheckEndFrameFinalizeErrorTooltip();

begin_error_tooltip

def begin_error_tooltip() -> bool
IMGUI_API bool BeginErrorTooltip();

end_error_tooltip

def end_error_tooltip() -> None
IMGUI_API void EndErrorTooltip();

demo_marker

def demo_marker(file: str, line: int, section: str) -> None
IMGUI_API void DemoMarker(const char* file, int line, const char* section);

Demo Doc Marker for e.g. imgui_explorer

Debug Tools

debug_alloc_hook

def debug_alloc_hook(info: DebugAllocInfo, frame_count: int, ptr: Any, size: int) -> None
IMGUI_API void DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr, size_t size);

size >= 0 : alloc, size = -1 : free

debug_draw_cursor_pos

def debug_draw_cursor_pos(col: ImU32 = IM_COL32(255, 0, 0, 255)) -> None
IMGUI_API void DebugDrawCursorPos(ImU32 col = IM_COL32(255, 0, 0, 255));

debug_draw_line_extents

def debug_draw_line_extents(col: ImU32 = IM_COL32(255, 0, 0, 255)) -> None
IMGUI_API void DebugDrawLineExtents(ImU32 col = IM_COL32(255, 0, 0, 255));

debug_draw_item_rect

def debug_draw_item_rect(col: ImU32 = IM_COL32(255, 0, 0, 255)) -> None
IMGUI_API void DebugDrawItemRect(ImU32 col = IM_COL32(255, 0, 0, 255));

debug_text_unformatted_with_locate_item

def debug_text_unformatted_with_locate_item(line_begin: str, line_end: str) -> None
IMGUI_API void DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end);

debug_locate_item

def debug_locate_item(target_id: ID) -> None
IMGUI_API void DebugLocateItem(ImGuiID target_id);

Call sparingly: only 1 at the same time!

debug_locate_item_on_hover

def debug_locate_item_on_hover(target_id: ID) -> None
IMGUI_API void DebugLocateItemOnHover(ImGuiID target_id);

Only call on reaction to a mouse Hover: because only 1 at the same time!

debug_locate_item_resolve_with_last_item

def debug_locate_item_resolve_with_last_item() -> None
IMGUI_API void DebugLocateItemResolveWithLastItem();

debug_break_clear_data

def debug_break_clear_data() -> None
IMGUI_API void DebugBreakClearData();

debug_break_button

def debug_break_button(label: str, description_of_location: str) -> bool
IMGUI_API bool DebugBreakButton(const char* label, const char* description_of_location);

debug_break_button_tooltip

def debug_break_button_tooltip(keyboard_only: bool, description_of_location: str) -> None
IMGUI_API void DebugBreakButtonTooltip(bool keyboard_only, const char* description_of_location);

show_font_atlas

def show_font_atlas(atlas: ImFontAtlas) -> None
IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas);

debug_texture_id_to_u64

def debug_texture_id_to_u64(tex_id: ImTextureID) -> ImU64
IMGUI_API ImU64 DebugTextureIDToU64(ImTextureID tex_id);

debug_hook_id_info

def debug_hook_id_info(id_: ID, data_type: DataType, data_id: Any, data_id_end: Any) -> None
IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end);

debug_node_columns

def debug_node_columns(columns: OldColumns) -> None
IMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns);

debug_node_dock_node

def debug_node_dock_node(node: DockNode, label: str) -> None
IMGUI_API void DebugNodeDockNode(ImGuiDockNode* node, const char* label);

debug_node_draw_list

def debug_node_draw_list(window: Window, viewport: ViewportP, draw_list: ImDrawList, label: str) -> None
IMGUI_API void DebugNodeDrawList(ImGuiWindow* window, ImGuiViewportP* viewport, const ImDrawList* draw_list, const char* label);

debug_node_draw_cmd_show_mesh_and_bounding_box

def debug_node_draw_cmd_show_mesh_and_bounding_box(out_draw_list: ImDrawList, draw_list: ImDrawList, draw_cmd: ImDrawCmd, show_mesh: bool, show_aabb: bool) -> None
IMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb);

debug_node_font

def debug_node_font(font: ImFont) -> None
IMGUI_API void DebugNodeFont(ImFont* font);

debug_node_font_glyphs_for_src_mask

def debug_node_font_glyphs_for_src_mask(font: ImFont, baked: ImFontBaked, src_mask: int) -> None
IMGUI_API void DebugNodeFontGlyphsForSrcMask(ImFont* font, ImFontBaked* baked, int src_mask);

debug_node_font_glyph

def debug_node_font_glyph(font: ImFont, glyph: ImFontGlyph) -> None
IMGUI_API void DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph);

debug_node_texture

def debug_node_texture(tex: ImTextureData, int_id: int, highlight_rect: Optional[ImFontAtlasRect] = None) -> None
IMGUI_API void DebugNodeTexture(ImTextureData* tex, int int_id, const ImFontAtlasRect* highlight_rect = NULL);

ID used to facilitate persisting the “current” texture.

debug_node_storage

def debug_node_storage(storage: Storage, label: str) -> None
IMGUI_API void DebugNodeStorage(ImGuiStorage* storage, const char* label);

debug_node_tab_bar

def debug_node_tab_bar(tab_bar: TabBar, label: str) -> None
IMGUI_API void DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label);

debug_node_table

def debug_node_table(table: Table) -> None
IMGUI_API void DebugNodeTable(ImGuiTable* table);

debug_node_table_settings

def debug_node_table_settings(settings: TableSettings, table: Table) -> None
IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings, ImGuiTable* table);

debug_node_input_text_state

def debug_node_input_text_state(state: InputTextState) -> None
IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);

debug_node_typing_select_state

def debug_node_typing_select_state(state: TypingSelectState) -> None
IMGUI_API void DebugNodeTypingSelectState(ImGuiTypingSelectState* state);

debug_node_multi_select_state

def debug_node_multi_select_state(state: MultiSelectState) -> None
IMGUI_API void DebugNodeMultiSelectState(ImGuiMultiSelectState* state);

debug_node_window

def debug_node_window(window: Window, label: str) -> None
IMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label);

debug_node_window_settings

def debug_node_window_settings(settings: WindowSettings) -> None
IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings);

debug_node_windows_list

def debug_node_windows_list(windows: ImVector_Window_ptr, label: str) -> None
IMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* label);

debug_node_viewport

def debug_node_viewport(viewport: ViewportP) -> None
IMGUI_API void DebugNodeViewport(ImGuiViewportP* viewport);

debug_node_platform_monitor

def debug_node_platform_monitor(monitor: PlatformMonitor, label: str, idx: int) -> None
IMGUI_API void DebugNodePlatformMonitor(ImGuiPlatformMonitor* monitor, const char* label, int idx);

debug_render_keyboard_preview

def debug_render_keyboard_preview(draw_list: ImDrawList) -> None
IMGUI_API void DebugRenderKeyboardPreview(ImDrawList* draw_list);

debug_render_viewport_thumbnail

def debug_render_viewport_thumbnail(draw_list: ImDrawList, viewport: ViewportP, bb: ImRect) -> None
IMGUI_API void DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb);

Obsolete functions

ImFontLoader

ImFontLoader (class)

Hooks and storage for a given font backend.
This structure is likely to evolve as we add support for incremental atlas updates.
Conceptually this could be public, but API is still going to be evolve.

AttributeC++
name: strconst char* Name;(const)
font_baked_src_loader_data_size: intsize_t FontBakedSrcLoaderDataSize;
ImFontLoader.__init__
def __init__(self) -> None
ImFontLoader();

ImFontAtlas internal API

im_font_atlas_rect_id_get_index

def im_font_atlas_rect_id_get_index(id_: ImFontAtlasRectId) -> int
inline int ImFontAtlasRectId_GetIndex(ImFontAtlasRectId id);

(private API)

Helpers: ImTextureRef ==/!= operators provided as convenience (note that _TexID and _TexData are never set simultaneously)
Refer to ImFontAtlasPackGetRect() to better understand how this works.

im_font_atlas_rect_id_get_generation

def im_font_atlas_rect_id_get_generation(id_: ImFontAtlasRectId) -> int
inline unsigned int ImFontAtlasRectId_GetGeneration(ImFontAtlasRectId id);

(private API)

im_font_atlas_rect_id_make

def im_font_atlas_rect_id_make(index_idx: int, gen_idx: int) -> ImFontAtlasRectId
inline ImFontAtlasRectId ImFontAtlasRectId_Make(int index_idx, int gen_idx);

(private API)

ImFontAtlasRectEntry (class)

Packed rectangle lookup entry (we need an indirection to allow removing/reordering rectangles)
User are returned ImFontAtlasRectId values which are meant to be persistent.
We handle this with an indirection. While Rects[] may be in theory shuffled, compacted etc., RectsIndex[] cannot it is keyed by ImFontAtlasRectId.
RectsIndex[] is used both as an index into Rects[] and an index into itself. This is basically a free-list. See ImFontAtlasBuildAllocRectIndexEntry() code.
Having this also makes it easier to e.g. sort rectangles during repack.

ImFontAtlasRectEntry.__init__
def __init__(self) -> None

Auto-generated default constructor

ImFontAtlasPostProcessData (class)

Data available to potential texture post-processing functions

AttributeC++
font_atlas: ImFontAtlasImFontAtlas* FontAtlas;
font: ImFontImFont* Font;
font_src: ImFontConfigImFontConfig* FontSrc;
font_baked: ImFontBakedImFontBaked* FontBaked;
glyph: ImFontGlyphImFontGlyph* Glyph;
pixels: Anyvoid* Pixels;
format: ImTextureFormatImTextureFormat Format;
pitch: intint Pitch;
width: intint Width;
height: intint Height;
ImFontAtlasPostProcessData.__init__
def __init__(self, format: Optional[ImTextureFormat] = None, pitch: int = int(), width: int = int(), height: int = int()) -> None

Auto-generated default constructor with named params

Python bindings defaults:
If Format is None, then its default value will be: ImTextureFormat()

stbrp_context_opaque (class)

stbrp_context_opaque.__init__
def __init__(self) -> None

Auto-generated default constructor

ImFontAtlasBuilder (class)

Internal storage for incrementally packing and building a ImFontAtlas

AttributeC++
pack_context: stbrp_context_opaquestbrp_context_opaque PackContext;Actually ‘stbrp_context’ but we don’t want to define this in the header file.
rects: ImVector_ImTextureRectImVector<ImTextureRect> Rects;
temp_buffer: ImVector_ucharImVector<uchar> TempBuffer;Misc scratch buffer
rects_index_free_list_start: intint RectsIndexFreeListStart;First unused entry
rects_packed_count: intint RectsPackedCount;Number of packed rectangles.
rects_packed_surface: intint RectsPackedSurface;Number of packed pixels. Used when compacting to heuristically find the ideal texture size.
rects_discarded_count: intint RectsDiscardedCount;
rects_discarded_surface: intint RectsDiscardedSurface;
frame_count: intint FrameCount;Current frame count
max_rect_size: ImVec2iImVec2i MaxRectSize;Largest rectangle to pack (de-facto used as a “minimum texture size”)
max_rect_bounds: ImVec2iImVec2i MaxRectBounds;Bottom-right most used pixels
lock_disable_resize: boolbool LockDisableResize;Disable resizing texture
preloaded_all_glyphs_ranges: boolbool PreloadedAllGlyphsRanges;Set when missing ImGuiBackendFlags_RendererHasTextures features forces atlas to preload everything.
baked_map: StorageImGuiStorage BakedMap;BakedId --> ImFontBaked*
baked_discarded_count: intint BakedDiscardedCount;
pack_id_mouse_cursors: ImFontAtlasRectIdImFontAtlasRectId PackIdMouseCursors;White pixel + mouse cursors. Also happen to be fallback in case of packing failure.
pack_id_lines_tex_data: ImFontAtlasRectIdImFontAtlasRectId PackIdLinesTexData;

im_font_atlas_texture_add

def im_font_atlas_texture_add(atlas: ImFontAtlas, w: int, h: int) -> ImTextureData
IMGUI_API ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h);

im_font_atlas_texture_make_space

def im_font_atlas_texture_make_space(atlas: ImFontAtlas) -> None
IMGUI_API void ImFontAtlasTextureMakeSpace(ImFontAtlas* atlas);

im_font_atlas_texture_repack

def im_font_atlas_texture_repack(atlas: ImFontAtlas, w: int, h: int) -> None
IMGUI_API void ImFontAtlasTextureRepack(ImFontAtlas* atlas, int w, int h);

im_font_atlas_texture_grow

def im_font_atlas_texture_grow(atlas: ImFontAtlas, old_w: int = -1, old_h: int = -1) -> None
IMGUI_API void ImFontAtlasTextureGrow(ImFontAtlas* atlas, int old_w = -1, int old_h = -1);

im_font_atlas_texture_compact

def im_font_atlas_texture_compact(atlas: ImFontAtlas) -> None
IMGUI_API void ImFontAtlasTextureCompact(ImFontAtlas* atlas);

im_font_atlas_texture_get_size_estimate

def im_font_atlas_texture_get_size_estimate(atlas: ImFontAtlas) -> ImVec2i
IMGUI_API ImVec2i ImFontAtlasTextureGetSizeEstimate(ImFontAtlas* atlas);

im_font_atlas_font_source_init

def im_font_atlas_font_source_init(atlas: ImFontAtlas, src: ImFontConfig) -> bool
IMGUI_API bool ImFontAtlasFontSourceInit(ImFontAtlas* atlas, ImFontConfig* src);

im_font_atlas_font_source_add_to_font

def im_font_atlas_font_source_add_to_font(atlas: ImFontAtlas, font: ImFont, src: ImFontConfig) -> None
IMGUI_API void ImFontAtlasFontSourceAddToFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* src);

im_font_atlas_font_destroy_source_data

def im_font_atlas_font_destroy_source_data(atlas: ImFontAtlas, src: ImFontConfig) -> None
IMGUI_API void ImFontAtlasFontDestroySourceData(ImFontAtlas* atlas, ImFontConfig* src);

im_font_atlas_font_init_output

def im_font_atlas_font_init_output(atlas: ImFontAtlas, font: ImFont) -> bool
IMGUI_API bool ImFontAtlasFontInitOutput(ImFontAtlas* atlas, ImFont* font);

Using FontDestroyOutput/FontInitOutput sequence useful notably if font loader params have changed

im_font_atlas_font_destroy_output

def im_font_atlas_font_destroy_output(atlas: ImFontAtlas, font: ImFont) -> None
IMGUI_API void ImFontAtlasFontDestroyOutput(ImFontAtlas* atlas, ImFont* font);

im_font_atlas_font_rebuild_output

def im_font_atlas_font_rebuild_output(atlas: ImFontAtlas, font: ImFont) -> None
IMGUI_API void ImFontAtlasFontRebuildOutput(ImFontAtlas* atlas, ImFont* font);

im_font_atlas_font_discard_bakes

def im_font_atlas_font_discard_bakes(atlas: ImFontAtlas, font: ImFont, unused_frames: int) -> None
IMGUI_API void ImFontAtlasFontDiscardBakes(ImFontAtlas* atlas, ImFont* font, int unused_frames);

im_font_atlas_baked_get_id

def im_font_atlas_baked_get_id(font_id: ID, baked_size: float, rasterizer_density: float) -> ID
IMGUI_API ImGuiID ImFontAtlasBakedGetId(ImGuiID font_id, float baked_size, float rasterizer_density);

im_font_atlas_baked_get_or_add

def im_font_atlas_baked_get_or_add(atlas: ImFontAtlas, font: ImFont, font_size: float, font_rasterizer_density: float) -> ImFontBaked
IMGUI_API ImFontBaked* ImFontAtlasBakedGetOrAdd(ImFontAtlas* atlas, ImFont* font, float font_size, float font_rasterizer_density);

im_font_atlas_baked_get_closest_match

def im_font_atlas_baked_get_closest_match(atlas: ImFontAtlas, font: ImFont, font_size: float, font_rasterizer_density: float) -> ImFontBaked
IMGUI_API ImFontBaked* ImFontAtlasBakedGetClosestMatch(ImFontAtlas* atlas, ImFont* font, float font_size, float font_rasterizer_density);

im_font_atlas_baked_add

def im_font_atlas_baked_add(atlas: ImFontAtlas, font: ImFont, font_size: float, font_rasterizer_density: float, baked_id: ID) -> ImFontBaked
IMGUI_API ImFontBaked* ImFontAtlasBakedAdd(ImFontAtlas* atlas, ImFont* font, float font_size, float font_rasterizer_density, ImGuiID baked_id);

im_font_atlas_baked_discard

def im_font_atlas_baked_discard(atlas: ImFontAtlas, font: ImFont, baked: ImFontBaked) -> None
IMGUI_API void ImFontAtlasBakedDiscard(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked);

im_font_atlas_baked_add_font_glyph

def im_font_atlas_baked_add_font_glyph(atlas: ImFontAtlas, baked: ImFontBaked, src: ImFontConfig, in_glyph: ImFontGlyph) -> ImFontGlyph
IMGUI_API ImFontGlyph* ImFontAtlasBakedAddFontGlyph(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, const ImFontGlyph* in_glyph);

im_font_atlas_baked_add_font_glyph_advanced_x

def im_font_atlas_baked_add_font_glyph_advanced_x(atlas: ImFontAtlas, baked: ImFontBaked, src: ImFontConfig, codepoint: ImWchar, advance_x: float) -> None
IMGUI_API void ImFontAtlasBakedAddFontGlyphAdvancedX(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, ImWchar codepoint, float advance_x);

im_font_atlas_baked_discard_font_glyph

def im_font_atlas_baked_discard_font_glyph(atlas: ImFontAtlas, font: ImFont, baked: ImFontBaked, glyph: ImFontGlyph) -> None
IMGUI_API void ImFontAtlasBakedDiscardFontGlyph(ImFontAtlas* atlas, ImFont* font, ImFontBaked* baked, ImFontGlyph* glyph);

im_font_atlas_baked_set_font_glyph_bitmap

def im_font_atlas_baked_set_font_glyph_bitmap(atlas: ImFontAtlas, baked: ImFontBaked, src: ImFontConfig, glyph: ImFontGlyph, r: ImTextureRect, src_pixels: uchar, src_fmt: ImTextureFormat, src_pitch: int) -> None
IMGUI_API void ImFontAtlasBakedSetFontGlyphBitmap(ImFontAtlas* atlas, ImFontBaked* baked, ImFontConfig* src, ImFontGlyph* glyph, ImTextureRect* r, const uchar* src_pixels, ImTextureFormat src_fmt, int src_pitch);

im_font_atlas_pack_init

def im_font_atlas_pack_init(atlas: ImFontAtlas) -> None
IMGUI_API void ImFontAtlasPackInit(ImFontAtlas* atlas);

im_font_atlas_pack_add_rect

def im_font_atlas_pack_add_rect(atlas: ImFontAtlas, w: int, h: int, overwrite_entry: Optional[ImFontAtlasRectEntry] = None) -> ImFontAtlasRectId
IMGUI_API ImFontAtlasRectId ImFontAtlasPackAddRect(ImFontAtlas* atlas, int w, int h, ImFontAtlasRectEntry* overwrite_entry = NULL);

im_font_atlas_pack_get_rect

def im_font_atlas_pack_get_rect(atlas: ImFontAtlas, id_: ImFontAtlasRectId) -> ImTextureRect
IMGUI_API ImTextureRect* ImFontAtlasPackGetRect(ImFontAtlas* atlas, ImFontAtlasRectId id);

im_font_atlas_pack_get_rect_safe

def im_font_atlas_pack_get_rect_safe(atlas: ImFontAtlas, id_: ImFontAtlasRectId) -> ImTextureRect
IMGUI_API ImTextureRect* ImFontAtlasPackGetRectSafe(ImFontAtlas* atlas, ImFontAtlasRectId id);

im_font_atlas_pack_discard_rect

def im_font_atlas_pack_discard_rect(atlas: ImFontAtlas, id_: ImFontAtlasRectId) -> None
IMGUI_API void ImFontAtlasPackDiscardRect(ImFontAtlas* atlas, ImFontAtlasRectId id);

im_font_atlas_update_new_frame

def im_font_atlas_update_new_frame(atlas: ImFontAtlas, frame_count: int, renderer_has_textures: bool) -> None
IMGUI_API void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count, bool renderer_has_textures);

im_font_atlas_add_draw_list_shared_data

def im_font_atlas_add_draw_list_shared_data(atlas: ImFontAtlas, data: ImDrawListSharedData) -> None
IMGUI_API void ImFontAtlasAddDrawListSharedData(ImFontAtlas* atlas, ImDrawListSharedData* data);

im_font_atlas_remove_draw_list_shared_data

def im_font_atlas_remove_draw_list_shared_data(atlas: ImFontAtlas, data: ImDrawListSharedData) -> None
IMGUI_API void ImFontAtlasRemoveDrawListSharedData(ImFontAtlas* atlas, ImDrawListSharedData* data);

im_font_atlas_update_draw_lists_textures

def im_font_atlas_update_draw_lists_textures(atlas: ImFontAtlas, old_tex: ImTextureRef, new_tex: ImTextureRef) -> None
IMGUI_API void ImFontAtlasUpdateDrawListsTextures(ImFontAtlas* atlas, ImTextureRef old_tex, ImTextureRef new_tex);

im_font_atlas_update_draw_lists_shared_data

def im_font_atlas_update_draw_lists_shared_data(atlas: ImFontAtlas) -> None
IMGUI_API void ImFontAtlasUpdateDrawListsSharedData(ImFontAtlas* atlas);

im_font_atlas_texture_block_convert

def im_font_atlas_texture_block_convert(src_pixels: uchar, src_fmt: ImTextureFormat, src_pitch: int, dst_pixels: uchar, dst_fmt: ImTextureFormat, dst_pitch: int, w: int, h: int) -> None
IMGUI_API void ImFontAtlasTextureBlockConvert(const uchar* src_pixels, ImTextureFormat src_fmt, int src_pitch, uchar* dst_pixels, ImTextureFormat dst_fmt, int dst_pitch, int w, int h);

im_font_atlas_texture_block_post_process

def im_font_atlas_texture_block_post_process(data: ImFontAtlasPostProcessData) -> None
IMGUI_API void ImFontAtlasTextureBlockPostProcess(ImFontAtlasPostProcessData* data);

im_font_atlas_texture_block_post_process_multiply

def im_font_atlas_texture_block_post_process_multiply(data: ImFontAtlasPostProcessData, multiply_factor: float) -> None
IMGUI_API void ImFontAtlasTextureBlockPostProcessMultiply(ImFontAtlasPostProcessData* data, float multiply_factor);

im_font_atlas_texture_block_fill

def im_font_atlas_texture_block_fill(dst_tex: ImTextureData, dst_x: int, dst_y: int, w: int, h: int, col: ImU32) -> None
IMGUI_API void ImFontAtlasTextureBlockFill(ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h, ImU32 col);

im_font_atlas_texture_block_copy

def im_font_atlas_texture_block_copy(src_tex: ImTextureData, src_x: int, src_y: int, dst_tex: ImTextureData, dst_x: int, dst_y: int, w: int, h: int) -> None
IMGUI_API void ImFontAtlasTextureBlockCopy(ImTextureData* src_tex, int src_x, int src_y, ImTextureData* dst_tex, int dst_x, int dst_y, int w, int h);

im_font_atlas_texture_block_queue_upload

def im_font_atlas_texture_block_queue_upload(atlas: ImFontAtlas, tex: ImTextureData, x: int, y: int, w: int, h: int) -> None
IMGUI_API void ImFontAtlasTextureBlockQueueUpload(ImFontAtlas* atlas, ImTextureData* tex, int x, int y, int w, int h);

im_texture_data_update_new_frame

def im_texture_data_update_new_frame(tex: ImTextureData) -> bool
IMGUI_API bool ImTextureDataUpdateNewFrame(ImTextureData* tex);

im_texture_data_queue_upload

def im_texture_data_queue_upload(tex: ImTextureData, x: int, y: int, w: int, h: int) -> None
IMGUI_API void ImTextureDataQueueUpload(ImTextureData* tex, int x, int y, int w, int h);

im_texture_data_get_format_bytes_per_pixel

def im_texture_data_get_format_bytes_per_pixel(format: ImTextureFormat) -> int
IMGUI_API int ImTextureDataGetFormatBytesPerPixel(ImTextureFormat format);

im_texture_data_get_status_name

def im_texture_data_get_status_name(status: ImTextureStatus) -> str
IMGUI_API const char* ImTextureDataGetStatusName(ImTextureStatus status);

im_texture_data_get_format_name

def im_texture_data_get_format_name(format: ImTextureFormat) -> str
IMGUI_API const char* ImTextureDataGetFormatName(ImTextureFormat format);

im_font_atlas_get_mouse_cursor_tex_data

def im_font_atlas_get_mouse_cursor_tex_data(atlas: ImFontAtlas, cursor_type: MouseCursor, out_offset: ImVec2Like, out_size: ImVec2Like, out_uv_border: ImVec2Like, out_uv_fill: ImVec2Like) -> bool
IMGUI_API bool ImFontAtlasGetMouseCursorTexData(ImFontAtlas* atlas, ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]);

Test Engine specific hooks

Docking: Internal Types

DockRequestType (enum)

MemberValueC++
none0ImGuiDockRequestType_None = 0
dock1ImGuiDockRequestType_Dock
undock2ImGuiDockRequestType_Undock
split3ImGuiDockRequestType_SplitSplit is the same as Dock but without a DockPayload

DockRequest (class)

AttributeC++
type: DockRequestTypeImGuiDockRequestType Type;
dock_target_window: WindowImGuiWindow* DockTargetWindow;Destination/Target Window to dock into (may be a loose window or a DockNode, might be None in which case DockTargetNode cannot be None)
dock_target_node: DockNodeImGuiDockNode* DockTargetNode;Destination/Target Node to dock into
dock_payload: WindowImGuiWindow* DockPayload;Source/Payload window to dock (may be a loose window or a DockNode), [Optional]
dock_split_dir: DirImGuiDir DockSplitDir;
dock_split_ratio: floatfloat DockSplitRatio;
dock_split_outer: boolbool DockSplitOuter;
undock_target_window: WindowImGuiWindow* UndockTargetWindow;
undock_target_node: DockNodeImGuiDockNode* UndockTargetNode;
DockRequest.__init__
def __init__(self) -> None
ImGuiDockRequest();

DockPreviewData (class)

AttributeC++
future_node: DockNodeImGuiDockNode FutureNode;
is_drop_allowed: boolbool IsDropAllowed;
is_center_available: boolbool IsCenterAvailable;
is_sides_available: boolbool IsSidesAvailable;Hold your breath, grammar freaks..
is_split_dir_explicit: boolbool IsSplitDirExplicit;Set when hovered the drop rect (vs. implicit SplitDir==None when hovered the window)
split_node: DockNodeImGuiDockNode* SplitNode;
split_dir: DirImGuiDir SplitDir;
split_ratio: floatfloat SplitRatio;
DockPreviewData.__init__
def __init__(self) -> None
ImGuiDockPreviewData() : FutureNode(0);

DockNodeSettings (class)

Persistent Settings data, stored contiguously in SettingsNodes (sizeof() ~32 bytes)

AttributeC++
id_: IDImGuiID ID;
parent_node_id: IDImGuiID ParentNodeId;
parent_window_id: IDImGuiID ParentWindowId;
selected_tab_id: IDImGuiID SelectedTabId;
split_axis: intsigned char SplitAxis;
depth: intchar Depth;
flags: DockNodeFlagsImGuiDockNodeFlags Flags;NB: We save individual flags one by one in ascii format (ImGuiDockNodeFlags_SavedFlagsMask_)
pos: ImVec2ihImVec2ih Pos;
size: ImVec2ihImVec2ih Size;
size_ref: ImVec2ihImVec2ih SizeRef;
DockNodeSettings.__init__
def __init__(self) -> None
ImGuiDockNodeSettings();

Submodule im_stb

im_stb (class)

get_current_window

def get_current_window() -> Window

imgui_internal_pywrappers.h

dock_builder_split_node_py

def dock_builder_split_node_py(node_id: ID, split_dir: Dir, size_ratio_for_node_at_dir: float) -> Tuple[ID, ID, ID]
IMGUI_API std::tuple<ImGuiID, ImGuiID, ImGuiID> DockBuilderSplitNode_Py(ImGuiID node_id, ImGuiDir split_dir, float size_ratio_for_node_at_dir);

DockBuilderSplitNode_Py() create 2 child nodes within 1 node. The initial node becomes a parent node.
This version is an adaptation for the python bindings (the C++ version uses two output parameters for the ID of the child nodes, this version returns a tuple)

DockBuilderSplitNodeResult (class)

Result of DockBuilderSplitNode() (python version)

AttributeC++
id_at_dir: IDImGuiID id_at_dir;
id_at_opposite_dir: IDImGuiID id_at_opposite_dir;
DockBuilderSplitNodeResult.__init__
def __init__(self, id_at_dir: ID = ID(), id_at_opposite_dir: ID = ID()) -> None

Auto-generated default constructor with named params

dock_builder_split_node

def dock_builder_split_node(node_id: ID, split_dir: Dir, size_ratio_for_node_at_dir: float) -> DockBuilderSplitNodeResult
IMGUI_API DockBuilderSplitNodeResult DockBuilderSplitNode(ImGuiID node_id, ImGuiDir split_dir, float size_ratio_for_node_at_dir);

DockBuilderSplitNode() creates 2 child nodes within 1 node. The initial node becomes a parent node. (python version: the two output parameters of the C++ version are returned in a struct)

input_text_ex

def input_text_ex(label: str, hint: str, s: str, size_arg: ImVec2Like, flags: InputTextFlags, callback: InputTextCallback = None) -> Tuple[bool, str]
IMGUI_API bool InputTextEx(const char* label, const char* hint, std::string* s, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL);

Python versions of InputTextEx() and TempInputText(): the text buffer is a string (returned modified)

temp_input_text

def temp_input_text(bb: ImRect, id_: ID, label: str, s: str, flags: InputTextFlags) -> Tuple[bool, str]
IMGUI_API bool TempInputText(const ImRect& bb, ImGuiID id, const char* label, std::string* s, ImGuiInputTextFlags flags);
}