The Slimgui package provides modern Python bindings for the following libraries:
Slimgui has been developed with the following goals in mind:
The project source code is hosted on github.com/nurpax/slimgui.
The project has been developed using the Python glfw
and pyOpenGL
packages and includes integration backend for these APIs. It should be possible to develop integrations for other backends, such as SDL or Pygame.
Slimgui is built against Dear ImGui version 1.91.9.
Slimgui requires Python 3.10 or newer.
Installation: pip install slimgui
To run the example, clone the repo, install dependencies and run:
git clone https://github.com/nurpax/slimgui
cd slimgui
pip install glfw pyopengl numpy requests
python example/app.py
Browse the example code: example/
The Slimgui API is similar to pyimgui except somewhat modernized:
enum.IntEnum
and enum.IntFlag
to make it clear which API functions consume what type of enums.ImVec2
, ImVec4
, and float*
arrays are converted to Python tuples such as tuple[float, float]
(for ImVec2
), tuple[float, float, float, float]
(for ImVec4
).bool* p_open
are input as normal bool
values and returned as the second element of a 2-tuple. For example bool ImGui::Checkbox(const char* label, bool* v)
is translated to def checkbox(label: str, v: bool) -> tuple[bool, bool]
that returns a 2-tuple where the first element is the boolean return value of bool ImGui::Checkbox()
and the second element is the new value of the checkbox state.A detailed enum and class reference can be found here: Enum Reference
The following documentation is primarily adapted from Dear ImGui main header imgui.h, with minor modifications to adapt symbol naming to Pythonic snake case.
Each context creates its own FontAtlas
by default. You may instance one yourself and pass it to create_context()
to share a font atlas between contexts.
def create_context(shared_font_atlas: FontAtlas | None = None) -> Context
def destroy_context(arg: Context, /) -> None
NULL = destroy current context
def get_current_context() -> Context
def set_current_context(arg: Context, /) -> None
def get_style() -> Style
Access the Style structure (colors, sizes). Always use push_style_color()
, push_style_var()
to modify style mid-frame!
def new_frame() -> None
Start a new Dear ImGui frame, you can submit any command from this point until render()
/end_frame()
.
def end_frame() -> None
Ends the Dear ImGui frame. automatically called by render()
. If you don't need to render data (skipping rendering) you may call end_frame()
without render()
... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call new_frame()
at all!
def render() -> None
Ends the Dear ImGui frame, finalize the draw data. You can then get call get_draw_data()
.
def get_draw_data() -> DrawData
Valid after render()
and until the next call to new_frame()
. this is what you have to render.
def show_demo_window(closable: bool = False) -> bool
Create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
def show_metrics_window(closable: bool = False) -> bool
Create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
def show_debug_log_window(closable: bool = False) -> bool
Create Debug Log window. display a simplified log of important dear imgui events.
def show_id_stack_tool_window(closable: bool = False) -> bool
Create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
def show_about_window(closable: bool = False) -> bool
Create About window. display Dear ImGui version, credits and build/system information.
def show_style_editor() -> None
Add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
def show_style_selector(label: str) -> bool
Add style selector block (not a window), essentially a combo listing the default styles.
def show_font_selector(label: str) -> None
Add font selector block (not a window), essentially a combo listing the loaded fonts.
def show_user_guide() -> None
Add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls).
def get_version() -> str
Get the compiled version string e.g. "1.80 WIP" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp)
Note: functions shown below intentionally do not accept None
as the destination style. Python wrappers with same name exist in the slimgui
module that can be called with None
that then modifies the current context’s style.
def style_colors_dark(dst: Style) -> None
New, recommended style (default)
def style_colors_light(dst: Style) -> None
Best used with borders and a custom, thicker font
def style_colors_classic(dst: Style) -> None
Classic imgui style
begin()
= push window to the stack and start appending to it. end()
= pop window from the stack.
Passing closable = True
shows a window-closing widget in the upper-right corner of the window, which clicking will set the boolean to false when clicked.
You may append multiple times to the same window during the same frame by calling begin()
/end()
pairs multiple times. Some information such as flags
or closable
will only be considered by the first call to begin()
.
begin()
returns False
to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. Always call a matching end()
for each begin()
call, regardless of its return value!
Important: due to legacy reason, begin()
/end()
and begin_child()
/end_child()
are inconsistent with all other functions such as begin_menu()
/end_menu()
, begin_popup()
/end_popup()
, etc. where the end_xxx()
call should only be called if the corresponding begin_xxx()
function returned True
. begin()
and begin_child()
are the only odd ones out. Will be fixed in a future update.
Note that the bottom of window stack always contains a window called “Debug”.
def begin(name: str, closable: bool = False, flags: WindowFlags = WindowFlags.NONE) -> tuple[bool, bool]
When the closable
argument is set to True
,
the created window will display a close button. The second bool of the
return value will be False
if the close button was pressed.
The intended usage is as follows:
win_open = True # open/closed state
visible, tab_open = imgui.begin(..., closable=win_open)
if visible:
# render window contents here..
imgui.end()
def end() -> None
Every begin()
call must be paired with a corresponding
end()
call, regardless of the return value of
begin()
return value.
(0, 400)
): == 0: use remaining parent window size for this axis. > 0: use specified size for this axis. < 0: right/bottom-align to specified distance from available content boundaries.ChildFlags.AUTO_RESIZE_X
or ChildFlags.AUTO_RESIZE_Y
makes the sizing automatic based on child contents. Combining both ChildFlags.AUTO_RESIZE_X
and ChildFlags.AUTO_RESIZE_Y
defeats purpose of a scrolling region and is NOT recommended.begin_child()
returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window. Always call a matching end_child()
for each begin_child()
call, regardless of its return value.Important: due to legacy reason, begin()
/end()
and begin_child()
/end_child()
are inconsistent with all other functions such as begin_menu()
/end_menu()
, begin_popup()
/end_popup()
, etc. where the end_xxx()
call should only be called if the corresponding begin_xxx()
function returned true. begin()
and begin_child()
are the only odd ones out. Will be fixed in a future update.
def begin_child(str_id: str, size: tuple[float, float] = (0.0, 0.0), child_flags: ChildFlags = ChildFlags.NONE, window_flags: WindowFlags = WindowFlags.NONE) -> bool
def end_child() -> None
begin()
/end()
block. ‘next window’ = next window we will begin()
into.def is_window_appearing() -> bool
def is_window_collapsed() -> bool
def is_window_focused(flags: FocusedFlags = FocusedFlags.NONE) -> bool
Is current window focused? or its root/child, depending on flags. see flags for options.
def is_window_hovered(flags: HoveredFlags = HoveredFlags.NONE) -> bool
Is current window hovered and hoverable (e.g. not blocked by a popup/modal)? See HoveredFlags
for options. IMPORTANT: If you are trying to check whether your mouse should be dispatched to Dear ImGui or to your underlying app, you should not use this function! Use the 'io.WantCaptureMouse' boolean for that! Refer to FAQ entry "How can I tell whether to dispatch mouse/keyboard to Dear ImGui or my application?" for details.
def get_window_pos() -> tuple[float, float]
Get current window position in screen space (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using get_cursor_screen_pos()
and get_content_region_avail()
instead)
def get_window_size() -> tuple[float, float]
Get current window size (IT IS UNLIKELY YOU EVER NEED TO USE THIS. Consider always using get_cursor_screen_pos()
and get_content_region_avail()
instead)
def get_window_width() -> float
Get current window width (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for get_window_size()
.x.
def get_window_height() -> float
Get current window height (IT IS UNLIKELY YOU EVER NEED TO USE THIS). Shortcut for get_window_size()
.y.
set_next_xxx
functions (before begin
) rather than set_xxx
functions (after begin
).def set_next_window_pos(pos: tuple[float, float], cond: Cond = Cond.NONE, pivot: tuple[float, float] = (0.0, 0.0)) -> None
Set next window position. call before begin()
. use pivot=(0.5f,0.5f) to center on given point, etc.
def set_next_window_size(size: tuple[float, float], cond: Cond = Cond.NONE) -> None
Set next window size. set axis to 0.0f to force an auto-fit on this axis. call before begin()
def set_next_window_content_size(size: tuple[float, float]) -> None
Set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before begin()
def set_next_window_collapsed(collapsed: bool, cond: Cond = Cond.NONE) -> None
Set next window collapsed state. call before begin()
def set_next_window_focus() -> None
Set next window to be focused / top-most. call before begin()
def set_next_window_scroll(scroll: tuple[float, float]) -> None
Set next window scrolling value (use < 0.0f to not affect a given axis).
def set_next_window_bg_alpha(alpha: float) -> None
Set next window background color alpha. helper to easily override the Alpha component of Col.WINDOW_BG
/ChildBg/PopupBg. you may also use WindowFlags.NO_BACKGROUND
.
def set_window_pos(pos: tuple[float, float], cond: Cond = Cond.NONE) -> None
(not recommended) set current window position - call within begin()
/end()
. prefer using set_next_window_pos()
, as this may incur tearing and side-effects.
def set_window_pos(name: str, pos: tuple[float, float], cond: Cond = Cond.NONE) -> None
def set_window_size(size: tuple[float, float], cond: Cond = Cond.NONE) -> None
(not recommended) set current window size - call within begin()
/end()
. set to ImVec2(0, 0) to force an auto-fit. prefer using set_next_window_size()
, as this may incur tearing and minor side-effects.
def set_window_size(name: str, size: tuple[float, float], cond: Cond = Cond.NONE) -> None
def set_window_collapsed(collapsed: bool, cond: Cond = Cond.NONE) -> None
(not recommended) set current window collapsed state. prefer using set_next_window_collapsed()
.
def set_window_collapsed(name: str, collapsed: bool, cond: Cond = Cond.NONE) -> None
def set_window_focus() -> None
(not recommended) set current window to be focused / top-most. prefer using set_next_window_focus()
.
def set_window_focus(name: str) -> None
def set_window_font_scale(scale: float) -> None
[OBSOLETE] set font scale. Adjust IO.FontGlobalScale if you want to scale all windows. This is an old API! For correct scaling, prefer to reload font + rebuild ImFontAtlas + call style.ScaleAllSizes().
def set_window_pos(pos: tuple[float, float], cond: Cond = Cond.NONE) -> None
(not recommended) set current window position - call within begin()
/end()
. prefer using set_next_window_pos()
, as this may incur tearing and side-effects.
def set_window_pos(name: str, pos: tuple[float, float], cond: Cond = Cond.NONE) -> None
def set_window_size(size: tuple[float, float], cond: Cond = Cond.NONE) -> None
(not recommended) set current window size - call within begin()
/end()
. set to ImVec2(0, 0) to force an auto-fit. prefer using set_next_window_size()
, as this may incur tearing and minor side-effects.
def set_window_size(name: str, size: tuple[float, float], cond: Cond = Cond.NONE) -> None
def set_window_collapsed(collapsed: bool, cond: Cond = Cond.NONE) -> None
(not recommended) set current window collapsed state. prefer using set_next_window_collapsed()
.
def set_window_collapsed(name: str, collapsed: bool, cond: Cond = Cond.NONE) -> None
def set_window_focus() -> None
(not recommended) set current window to be focused / top-most. prefer using set_next_window_focus()
.
def set_window_focus(name: str) -> None
begin()
.set_next_window_scroll()
prior to calling begin()
to avoid this delay, as an alternative to using set_scroll_x()
/set_scroll_y()
.def set_next_window_scroll(scroll: tuple[float, float]) -> None
Set next window scrolling value (use < 0.0f to not affect a given axis).
def get_scroll_x() -> float
Get scrolling amount [0 .. get_scroll_max_x()
]
def get_scroll_y() -> float
Get scrolling amount [0 .. get_scroll_max_y()
]
def set_scroll_x(scroll_x: float) -> None
Set scrolling amount [0 .. get_scroll_max_x()
]
def set_scroll_y(scroll_y: float) -> None
Set scrolling amount [0 .. get_scroll_max_y()
]
def get_scroll_max_x() -> float
Get maximum scrolling amount ~~ ContentSize.x - WindowSize.x - DecorationsSize.x
def get_scroll_max_y() -> float
Get maximum scrolling amount ~~ ContentSize.y - WindowSize.y - DecorationsSize.y
def set_scroll_here_x(center_x_ratio: float = 0.5) -> None
Adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using set_item_default_focus()
instead.
def set_scroll_here_y(center_y_ratio: float = 0.5) -> None
Adjust scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a "default/current item" visible, consider using set_item_default_focus()
instead.
def set_scroll_from_pos_x(local_x: float, center_x_ratio: float = 0.5) -> None
Adjust scrolling amount to make given position visible. Generally get_cursor_start_pos()
+ offset to compute a valid position.
def set_scroll_from_pos_y(local_y: float, center_y_ratio: float = 0.5) -> None
Adjust scrolling amount to make given position visible. Generally get_cursor_start_pos()
+ offset to compute a valid position.
def push_font(font: Font | None) -> None
Use NULL as a shortcut to push default font
def pop_font() -> None
def push_style_color(idx: Col, col: int) -> None
Modify a style color. always use this if you modify the style after new_frame()
.
def push_style_color(idx: Col, col: tuple[float, float, float, float]) -> None
def push_style_color(idx: Col, col: tuple[float, float, float]) -> None
def pop_style_color(count: int = 1) -> None
def push_style_var(idx: StyleVar, val: float) -> None
Modify a style float variable. always use this if you modify the style after new_frame()
!
def push_style_var(idx: StyleVar, val: tuple[float, float]) -> None
def push_style_var_x(idx: StyleVar, val_x: float) -> None
Modify X component of a style ImVec2 variable. "
def push_style_var_y(idx: StyleVar, val_y: float) -> None
Modify Y component of a style ImVec2 variable. "
def pop_style_var(count: int = 1) -> None
def push_item_width(item_width: float) -> None
Push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side).
def pop_item_width() -> None
def set_next_item_width(item_width: float) -> None
Set width of the _next_ common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -FLT_MIN always align width to the right side)
def calc_item_width() -> float
Width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.
def push_text_wrap_pos(wrap_local_pos_x: float = 0.0) -> None
def pop_text_wrap_pos() -> None
show_style_editor()
function to interactively see/edit the colors.def get_font_size() -> float
Get current font size (= height in pixels) of current font with current scale applied
def get_font_tex_uv_white_pixel() -> tuple[float, float]
Get UV coordinate for a white pixel, useful to draw custom shapes via the ImDrawList API
def get_style_color_vec4(col: Col) -> tuple[float, float, float, float]
Retrieve style color as stored in ImGuiStyle structure. use to feed back into push_style_color()
, otherwise use get_color_u32()
to get style color with style alpha baked in.
same_line()
between widgets to undo the last carriage return and output at the right of the preceding widget.get_cursor_screen_pos()
and get_content_region_avail()
.get_cursor_screen_pos()
, set_cursor_screen_pos()
, all DrawList
functions. -> this is the preferred way forward.same_line(offset)
, get_cursor_pos()
, set_cursor_pos()
, get_cursor_start_pos()
, push_text_wrap_pos()
get_content_region_max()
, get_window_content_region_min()
, get_window_content_region_max()
–> all obsoleted. YOU DON’T NEED THEM.get_cursor_screen_pos()
= get_cursor_pos()
+ get_window_pos()
. get_window_pos()
is almost only ever useful to convert from window-local to absolute coordinates. Try not to use it.def get_cursor_screen_pos() -> tuple[float, float]
Cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND (prefer using this rather than get_cursor_pos()
, also more useful to work with ImDrawList API).
def set_cursor_screen_pos(pos: tuple[float, float]) -> None
Cursor position, absolute coordinates. THIS IS YOUR BEST FRIEND.
def get_content_region_avail() -> tuple[float, float]
Available space from current position. THIS IS YOUR BEST FRIEND.
def get_cursor_pos() -> tuple[float, float]
[window-local] cursor position in window-local coordinates. This is not your best friend.
def get_cursor_pos_x() -> float
[window-local] "
def get_cursor_pos_y() -> float
[window-local] "
def set_cursor_pos(local_pos: tuple[float, float]) -> None
[window-local] "
def set_cursor_pos_x(local_x: float) -> None
[window-local] "
def set_cursor_pos_y(local_y: float) -> None
[window-local] "
def get_cursor_start_pos() -> tuple[float, float]
[window-local] initial cursor position, in window-local coordinates. Call get_cursor_screen_pos()
after begin()
to get the absolute coordinates version.
def separator() -> None
Separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
def same_line(offset_from_start_x: float = 0.0, spacing: float = -1.0) -> None
Call between widgets or groups to layout them horizontally. X position given in window coordinates.
def new_line() -> None
Undo a same_line()
or force a new line when in a horizontal-layout context.
def spacing() -> None
Add vertical spacing.
def dummy(size: tuple[float, float]) -> None
Add a dummy item of given size. unlike invisible_button()
, dummy()
won't take the mouse click or be navigable into.
def indent(indent_w: float = 0.0) -> None
Move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0
def unindent(indent_w: float = 0.0) -> None
Move content position back to the left, by indent_w, or style.IndentSpacing if indent_w <= 0
def begin_group() -> None
Lock horizontal starting position
def end_group() -> None
Unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use is_item_hovered()
or layout primitives such as same_line()
on whole group, etc.)
def align_text_to_frame_padding() -> None
Vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)
def get_text_line_height() -> float
~ FontSize
def get_text_line_height_with_spacing() -> float
~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)
def get_frame_height() -> float
~ FontSize + style.FramePadding.y * 2
def get_frame_height_with_spacing() -> float
~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui.
Those questions are answered and impacted by understanding of the ID stack system:
Short version: ID are hashes of the entire ID stack. If you are creating widgets in a loop you most likely want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them.
You can also use the "Label##foobar"
syntax within widget label to distinguish them from each others.
In this header file we use the label
/name
terminology to denote a string that will be displayed + used as an ID, whereas str_id
denote a string that is only used as an ID and not normally displayed.
def push_id(str_id: str) -> None
Push string into the ID stack (will hash string).
def push_id(int_id: int) -> None
def pop_id() -> None
Pop from the ID stack.
def text(text: str) -> None
Formatted text
def text_colored(col: tuple[float, float, float, float], text: str) -> None
def text_disabled(text: str) -> None
def text_wrapped(text: str) -> None
def label_text(label: str, text: str) -> None
Display text+label aligned the same way as value+label widgets
def bullet_text(text: str) -> None
Shortcut for bullet()
+text()
def separator_text(text: str) -> None
Currently: formatted text with a horizontal line
True
when the value has been changed or when pressed/selected.is_item_xxx
functions (e.g. is_item_active()
, is_item_hovered()
, etc.) to query widget state.def button(label: str, size: tuple[float, float] = (0.0, 0.0)) -> bool
Button
def small_button(label: str) -> bool
Button with (FramePadding.y == 0) to easily embed within text
def invisible_button(str_id: str, size: tuple[float, float], flags: ButtonFlags = ButtonFlags.NONE) -> bool
Flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with is_item_active
, is_item_hovered
, etc.)
def arrow_button(str_id: str, dir: Dir) -> bool
Square button with an arrow shape
def checkbox(label: str, v: bool) -> tuple[bool, bool]
def checkbox_flags(label: str, flags: int, flags_value: int) -> tuple[bool, int]
def radio_button(label: str, active: bool) -> bool
def radio_button(label: str, v: int, v_button: int) -> tuple[bool, int]
def progress_bar(fraction: float, size_arg: tuple[float, float] = (-FLT_MIN, 0), overlay: str | None = None) -> None
def bullet() -> None
Draw a small circle + keep the cursor on the same line. advance cursor x position by get_tree_node_to_label_spacing()
, same distance that tree_node()
uses
def text_link(label: str) -> None
Hyperlink text button, return true when clicked
def text_link_open_url(label: str, url: str | None = None) -> None
Hyperlink text button, automatically open file/url when clicked
uv0
and uv1
are texture coordinates. Read about them from the same link above.
image()
pads adds StyleVar.IMAGE_BORDER_SIZE
on each side, image_button()
adds StyleVar.FRAME_PADDING
on each side.image_button()
draws a background based on regular button()
color and optionally an inner background if specified.def image(user_texture_id: int, image_size: tuple[float, float], uv0: tuple[float, float] = (0.0, 0.0), uv1: tuple[float, float] = (1.0, 1.0)) -> None
def image_with_bg(user_texture_id: int, image_size: tuple[float, float], uv0: tuple[float, float] = (0.0, 0.0), uv1: tuple[float, float] = (1.0, 1.0), bg_col: tuple[float, float, float, float] = (0.0, 0.0, 0.0, 0.0), tint_col: tuple[float, float, float, float] = (1.0, 1.0, 1.0, 1.0)) -> None
def image_button(str_id: str, user_texture_id: int, image_size: tuple[float, float], uv0: tuple[float, float] = (0.0, 0.0), uv1: tuple[float, float] = (1.0, 1.0), bg_col: tuple[float, float, float, float] = (0.0, 0.0, 0.0, 0.0), tint_col: tuple[float, float, float, float] = (1.0, 1.0, 1.0, 1.0)) -> bool
begin_combo()
/end_combo()
API allows you to manage your contents and selection state however you want it, by creating e.g. selectable()
items.combo()
API are helpers over begin_combo()
/end_combo()
which are kept available for convenience purposes. This is analogous to how list_box
is created.def begin_combo(label: str, preview_value: str, flags: ComboFlags = ComboFlags.NONE) -> bool
def end_combo() -> None
Only call end_combo()
if begin_combo()
returns true!
def combo(label: str, current_item: int, items: Sequence[str], popup_max_height_in_items: int = -1) -> tuple[bool, int]
SliderFlags.ALWAYS_CLAMP
to always clamp."%.3f"
-> 1.234
; "%5.2f secs"
-> 01.23 secs
; "Biscuit: %.0f"
-> Biscuit: 1
; etc.None
or use the default format ("%f"
or "%d"
).v_speed=0.2
: mouse needs to move by 5 pixels to increase value by 1). For keyboard/gamepad navigation, minimum speed is max(v_speed, minimum_step_at_given_precision)
.v_min < v_max
to clamp edits to given limits. Note that CTRL+Click manual input can override those limits if SliderFlags.ALWAYS_CLAMP
is not used.v_max = FLT_MAX
/ INT_MAX
etc. to avoid clamping to a maximum, same with v_min = -FLT_MAX
/ INT_MIN
to avoid clamping to a minimum.drag_xxx()
and slider_xxx()
functions as the features are the same and it makes it easier to swap them.def drag_float(label: str, v: float, v_speed: float = 1.0, v_min: float = 0.0, v_max: float = 0.0, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, float]
If v_min >= v_max we have no bound
def drag_float2(label: str, v: tuple[float, float], v_speed: float = 1.0, v_min: float = 0.0, v_max: float = 0.0, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[float, float]]
def drag_float3(label: str, v: tuple[float, float, float], v_speed: float = 1.0, v_min: float = 0.0, v_max: float = 0.0, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[float, float, float]]
def drag_float4(label: str, v: tuple[float, float, float, float], v_speed: float = 1.0, v_min: float = 0.0, v_max: float = 0.0, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[float, float, float, float]]
def drag_int(label: str, v: int, v_speed: float = 1.0, v_min: int = 0, v_max: int = 0, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, int]
If v_min >= v_max we have no bound
def drag_int2(label: str, v: tuple[int, int], v_speed: float = 1.0, v_min: int = 0, v_max: int = 0, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[int, int]]
def drag_int3(label: str, v: tuple[int, int, int], v_speed: float = 1.0, v_min: int = 0, v_max: int = 0, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[int, int, int]]
def drag_int4(label: str, v: tuple[int, int, int, int], v_speed: float = 1.0, v_min: int = 0, v_max: int = 0, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[int, int, int, int]]
SliderFlags.ALWAYS_CLAMP
to always clamp."%.3f"
-> 1.234
; "%5.2f secs"
-> 01.23 secs
; "Biscuit: %.0f"
-> Biscuit: 1
; etc.None
or use the default format ("%f"
or "%d"
).def slider_float(label: str, v: float, v_min: float, v_max: float, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, float]
Adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.
def slider_float2(label: str, v: tuple[float, float], v_min: float, v_max: float, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[float, float]]
def slider_float3(label: str, v: tuple[float, float, float], v_min: float, v_max: float, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[float, float, float]]
def slider_float4(label: str, v: tuple[float, float, float, float], v_min: float, v_max: float, format: str = '%.3f', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[float, float, float, float]]
def slider_angle(label: str, v: float, v_degrees_min: float = -360.0, v_degrees_max: float = 360.0, format: str = '%.0f deg', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, float]
def slider_int(label: str, v: int, v_min: int, v_max: int, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, int]
def slider_int2(label: str, v: tuple[int, int], v_min: int, v_max: int, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[int, int]]
def slider_int3(label: str, v: tuple[int, int, int], v_min: int, v_max: int, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[int, int, int]]
def slider_int4(label: str, v: tuple[int, int, int, int], v_min: int, v_max: int, format: str = '%d', flags: SliderFlags = SliderFlags.NONE) -> tuple[bool, tuple[int, int, int, int]]
InputTextFlags
flags are only useful for input_text()
and not for input_float_*
, input_float_*
, input_int_*
, etc.def input_text(label: str, text: str, flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, str]
def input_text_multiline(label: str, text: str, size: tuple[float, float] = (0.0, 0.0), flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, str]
def input_text_with_hint(label: str, hint: str, text: str, flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, str]
def input_float(label: str, v: float, step: float = 0.0, step_fast: float = 0.0, format: str = '%.3f', flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, float]
def input_float2(label: str, v: tuple[float, float], format: str = '%.3f', flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, tuple[float, float]]
def input_float3(label: str, v: tuple[float, float, float], format: str = '%.3f', flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, tuple[float, float, float]]
def input_float4(label: str, v: tuple[float, float, float, float], format: str = '%.3f', flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, tuple[float, float, float, float]]
def input_int(label: str, v: int, step: int = 1, step_fast: int = 100, flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, int]
def input_int2(label: str, v: tuple[int, int], flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, tuple[int, int]]
def input_int3(label: str, v: tuple[int, int, int], flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, tuple[int, int, int]]
def input_int4(label: str, v: tuple[int, int, int, int], flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, tuple[int, int, int, int]]
def input_double(label: str, v: float, step: float = 0.0, step_fast: float = 0.0, format: str = '%.6f', flags: InputTextFlags = InputTextFlags.NONE) -> tuple[bool, float]
Tip: the color_edit_*
functions have a little color square that can be left-clicked to open a picker, and right-clicked to open an option menu.
def color_edit3(label: str, col: tuple[float, float, float], flags: ColorEditFlags = ColorEditFlags.NONE) -> tuple[bool, tuple[float, float, float]]
def color_edit4(label: str, col: tuple[float, float, float, float], flags: ColorEditFlags = ColorEditFlags.NONE) -> tuple[bool, tuple[float, float, float, float]]
def color_picker3(label: str, col: tuple[float, float, float], flags: ColorEditFlags = ColorEditFlags.NONE) -> tuple[bool, tuple[float, float, float]]
def color_picker4(label: str, col: tuple[float, float, float, float], flags: ColorEditFlags = ColorEditFlags.NONE, ref_col: tuple[float, float, float, float] | None = None) -> tuple[bool, tuple[float, float, float, float]]
def color_button(desc_id: str, col: tuple[float, float, float, float], flags: ColorEditFlags = ColorEditFlags.NONE, size: tuple[float, float] = (0.0, 0.0)) -> bool
Display a color square/button, hover for details, return true when pressed.
def set_color_edit_options(flags: ColorEditFlags) -> None
Initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
tree_node
functions return True
when the node is open, in which case you need to also call tree_pop()
when you are finished displaying the tree node contents.def tree_node(label: str, flags: TreeNodeFlags = TreeNodeFlags.NONE) -> bool
def tree_node(str_id: str, text: str, flags: TreeNodeFlags = TreeNodeFlags.NONE) -> bool
def tree_push(str_id: str) -> None
~ indent()
+push_id()
. Already called by tree_node()
when returning true, but you can call tree_push
/tree_pop
yourself if desired.
def tree_pop() -> None
~ unindent()
+pop_id()
def get_tree_node_to_label_spacing() -> float
Horizontal distance preceding label when using tree_node
*() or bullet()
== (g.FontSize + style.FramePadding.x*2) for a regular unframed tree_node
def collapsing_header(label: str, visible: bool | None = None, flags: TreeNodeFlags = TreeNodeFlags.NONE) -> tuple[bool, bool | None]
If returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call tree_pop()
.
def set_next_item_open(is_open: bool, cond: Cond = Cond.NONE) -> None
Set next tree_node
/collapsing_header
open state.
selectable
appear contiguous.def selectable(label: str, selected: bool = False, flags: SelectableFlags = SelectableFlags.NONE, size: tuple[float, float] = (0.0, 0.0)) -> tuple[bool, bool]
"bool selected" carry the selection state (read-only). selectable()
is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
selectable()
, checkbox()
, tree_node()
functions [BETA]SelectionUserData
is often used to store your item index within the current view (but may store something else).MultiSelectIO
for instructions/details and see ‘Demo->Widgets->Selection State & Multi-Select’ for demo.tree_node()
is technically supported but… using this correctly is more complicated. You need some sort of linear/random access to your tree, which is suited to advanced tree setups already implementing filters and clipper. We will work on simplifying the current demo.selection_size
and items_count
parameters are optional and used by a few features. If they are costly for you to compute, you may avoid them.begin_child()
/end_child()
with the ChildFlags.FRAME_STYLE
flag for stylistic changes and displaying a label.begin_child()
with the ChildFlags.FRAME_STYLE
flag for the same result.selectable()
or any other items.list_box()
API are helpers over begin_list_box()
/end_list_box()
which are kept available for convenience purposes. This is analogous to how combos are created.size.x > 0
: customsize.x < 0
or -FLT_MIN
: right-alignsize.x = 0
(default): use current item_width
size.y > 0
: customsize.y < 0
or -FLT_MIN
: bottom-alignsize.y = 0
(default): arbitrary default height which can fit ~7 itemsdef begin_list_box(label: str, size: tuple[float, float] = (0.0, 0.0)) -> bool
Open a framed scrolling region
def end_list_box() -> None
Only call end_list_box()
if begin_list_box()
returned true!
def list_box(label: str, current_item: int, items: Sequence[str], height_in_items: int = -1) -> tuple[bool, int]
Consider using ImPlot (https://github.com/epezent/implot) which is much better! Slimgui includes ImPlot bindings, which can be imported with from slimgui import implot
.
def plot_lines(label: str, values: Annotated[ArrayLike, dict(dtype='float32', shape=(None), device='cpu', writable=False)], overlay_text: str | None = None, scale_min: float = FLT_MAX, scale_max: float = FLT_MAX, graph_size: tuple[float, float] = (0.0, 0.0)) -> None
def plot_histogram(label: str, values: Annotated[ArrayLike, dict(dtype='float32', shape=(None), device='cpu', writable=False)], overlay_text: str | None = None, scale_min: float = FLT_MAX, scale_max: float = FLT_MAX, graph_size: tuple[float, float] = (0.0, 0.0)) -> None
These are merely shortcuts to calling text()
with a format string. Output single value in “name: value” format.
begin_menu_bar()
on a window WindowFlags.MENU_BAR
to append to its menu bar.begin_main_menu_bar()
to create a menu bar at the top of the screen and append to it.begin_menu()
to create a menu. You can call begin_menu()
multiple times with the same identifier to append more items to it.menu_item()
keyboard shortcuts are displayed as a convenience but not processed by Dear ImGui at the moment.def begin_menu_bar() -> bool
Append to menu-bar of current window (requires WindowFlags.MENU_BAR
flag set on parent window).
def end_menu_bar() -> None
Only call end_menu_bar()
if begin_menu_bar()
returns true!
def begin_main_menu_bar() -> bool
Create and append to a full screen menu-bar.
def end_main_menu_bar() -> None
Only call end_main_menu_bar()
if begin_main_menu_bar()
returns true!
def begin_menu(label: str, enabled: bool = True) -> bool
Create a sub-menu entry. only call end_menu()
if this returns true!
def end_menu() -> None
Only call end_menu()
if begin_menu()
returns true!
def menu_item(label: str, shortcut: str | None = None, selected: bool = False, enabled: bool = True) -> tuple[bool, bool]
Return true when activated.
Tooltips are windows following the mouse. They do not take focus away.
A tooltip window can contain items of any types.
set_tooltip()
is more or less a shortcut for the below idiom (with a subtlety that it discards any previously submitted tooltip):
if begin_tooltip():
text(...)
end_tooltip()
def begin_tooltip() -> bool
Begin/append a tooltip window.
def end_tooltip() -> None
Only call end_tooltip()
if begin_tooltip()
/begin_item_tooltip()
returns true!
def set_tooltip(text: str) -> None
Set a text-only tooltip. Often used after a ImGui::is_item_hovered()
check. Override any previous call to set_tooltip()
.
Tooltip helpers for showing a tooltip when hovering an item:
begin_item_tooltip()
is a shortcut for the if is_item_hovered(HoveredFlags.FOR_TOOLTIP) and begin_tooltip()
idiom.set_item_tooltip()
is a shortcut for the if is_item_hovered(HoveredFlags.FOR_TOOLTIP): set_tooltip(...)
idiom.HoveredFlags.FOR_TOOLTIP
itself is a shortcut to use Style.hover_flags_for_tooltip_mouse
or Style.hover_flags_for_tooltip_nav
depending on the active input type. For mouse, it defaults to HoveredFlags.STATIONARY | HoveredFlags.DELAY_SHORT
.def begin_item_tooltip() -> bool
Begin/append a tooltip window if preceding item was hovered.
def set_item_tooltip(text: str) -> None
Set a text-only tooltip if preceding item was hovered. override any previous call to set_tooltip()
.
begin_*()
calls.HoveredFlags.ALLOW_WHEN_BLOCKED_BY_POPUP
when calling is_item_hovered()
or is_window_hovered()
.open_popup()
and begin_popup()
generally need to be at the same level of the stack. This sometimes leads to confusing mistakes. May rework this in the future.begin_popup()
: query popup state, if open start appending into the window. Call end_popup()
afterwards if returned true. WindowFlags
are forwarded to the window.begin_popup_modal()
: block every interaction behind the window, cannot be closed by user, add a dimming background, has a title bar.def begin_popup(str_id: str, flags: WindowFlags = WindowFlags.NONE) -> bool
Return true if the popup is open, and you can start outputting to it.
def end_popup() -> None
Only call end_popup()
if BeginPopupXXX() returns true!
open_popup()
: set popup state to open. PopupFlags
are available for opening options.close_current_popup()
: use inside the begin_popup()
/end_popup()
scope to close manually.close_current_popup()
is called by default by selectable()
/menu_item()
when activated.PopupFlags.NO_OPEN_OVER_EXISTING_POPUP
to avoid opening a popup if there’s already one at the same level. This is equivalent to e.g. testing for not is_any_popup_open()
prior to open_popup()
.is_window_appearing()
after begin_popup()
to tell if a window just opened.def open_popup(str_id: str, flags: PopupFlags = PopupFlags.NONE) -> None
Call to mark popup as open (don't call every frame!).
def open_popup_on_item_click(str_id: str | None = None, flags: PopupFlags = PopupFlags.MOUSE_BUTTON_RIGHT) -> None
Helper to open popup when clicked on last item. Default to PopupFlags.MOUSE_BUTTON_RIGHT
== 1. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
def close_current_popup() -> None
Manually close the popup we have begin-ed into.
open_popup()
+ begin_popup()
where the open action is triggered by, e.g., hovering an item and right-clicking.begin_popup_context_xxx()
takes PopupFlags
just like open_popup()
and unlike begin_popup()
. For full consistency, we may add WindowFlags
to the begin_popup_context_xxx()
functions in the future.def begin_popup_context_window(str_id: str | None = None, flags: PopupFlags = PopupFlags.MOUSE_BUTTON_RIGHT) -> bool
Open+begin popup when clicked on current window.
is_popup_open()
: return true if the popup is open at the current begin_popup()
level of the popup stack.is_popup_open()
with PopupFlags.ANY_POPUP_ID
: return true if any popup is open at the current begin_popup()
level of the popup stack.is_popup_open()
with PopupFlags.ANY_POPUP_ID
+ PopupFlags.ANY_POPUP_LEVEL
: return true if any popup is open.def is_popup_open(str_id: str, flags: PopupFlags = PopupFlags.NONE) -> bool
Return true if the popup is open.
TableFlags
and TableColumnFlags
enums for a description of available flags.The typical call flow is:
begin_table()
, early out if returning False
.table_setup_column()
to submit column name/flags/defaults.table_setup_scroll_freeze()
to request scroll freezing of columns/rows.table_headers_row()
to submit a header row. Names are pulled from table_setup_column()
data.table_next_row()
+ table_set_column_index(N)
to start appending into a column.table_next_column()
instead of table_next_row()
+ table_set_column_index()
. table_next_column()
will automatically wrap-around into the next row if needed.columns()
API, we need to call table_next_column()
for the first column!table_next_row()
-> table_set_column_index(0)
-> text("Hello 0")
-> table_set_column_index(1)
-> text("Hello 1")
// OKtable_next_row()
-> table_next_column()
-> text("Hello 0")
-> table_next_column()
-> text("Hello 1")
// OKtable_next_column()
-> text("Hello 0")
-> table_next_column()
-> text("Hello 1")
// OK: table_next_column()
automatically gets to next row!table_next_row()
-> text("Hello 0")
// Not OK! Missing table_set_column_index()
or table_next_column()
! Text will not appear!end_table()
def begin_table(str_id: str, column: int, flags: TableFlags = TableFlags.NONE, outer_size: tuple[float, float] = (0.0, 0.0), inner_width: float = 0.0) -> bool
def end_table() -> None
Only call end_table()
if begin_table()
returns true!
def table_next_row(flags: TableRowFlags = TableRowFlags.NONE, min_row_height: float = 0.0) -> None
Append into the first cell of a new row.
def table_next_column() -> bool
Append into the next column (or first column of next row if currently in last column). Return true when column is visible.
def table_set_column_index(column_n: int) -> bool
Append into the specified column. Return true when column is visible.
table_setup_column()
to specify label, resizing policy, default width/weight, id, various other flags, etc.table_headers_row()
to create a header row and automatically submit a table_header()
for each column. Headers are required to perform: reordering, sorting, and opening the context menu. The context menu can also be made available in columns body using TableFlags.CONTEXT_MENU_IN_BODY
.table_next_row()
+ table_header()
calls, but this is only useful in some advanced use cases (e.g., adding custom widgets in header row).table_setup_scroll_freeze()
to lock columns/rows so they stay visible when scrolled.def table_setup_column(label: str, flags: TableColumnFlags = TableColumnFlags.NONE, init_width_or_weight: float = 0.0, user_id: int = 0) -> None
def table_setup_scroll_freeze(cols: int, rows: int) -> None
Lock columns/rows so they stay visible when scrolled.
def table_header(label: str) -> None
Submit one header cell manually (rarely used)
def table_headers_row() -> None
Submit a row with headers cells based on data provided to table_setup_column()
+ submit context menu
def table_angled_headers_row() -> None
Submit a row with angled headers for every column with the TableColumnFlags.ANGLED_HEADER
flag. MUST BE FIRST ROW.
table_get_sort_specs()
to retrieve the latest sort specs for the table. Returns None
when not sorting. When sort_specs->SpecsDirty == True
you should sort your data. It will be True
when sorting specs have changed since the last call, or the first time. Make sure to set SpecsDirty = False
after sorting, else you may wastefully sort your data every frame!column_n
treat the default value of -1 as the same as passing the current column index.def table_get_column_count() -> int
Return number of columns (value passed to begin_table
)
def table_get_column_index() -> int
Return current column index.
def table_get_row_index() -> int
Return current row index.
def table_get_column_name(column_n: int = -1) -> str
Return "" if column didn't have a name declared by table_setup_column()
. Pass -1 to use current column.
def table_get_column_flags(column_n: int = -1) -> TableColumnFlags
Return column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
def table_set_column_enabled(column_n: int, v: bool) -> None
Change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with TableFlags.CONTEXT_MENU_IN_BODY
)
def table_set_bg_color(target: TableBgTarget, color: tuple[float, float, float, float], column_n: int = -1) -> None
Change the color of a cell, row, or column. See TableBgTarget
flags for details.
same_line(pos_x)
to mimic simplified columns.def columns(count: int = 1, id: str | None = None, border: bool = True) -> None
def next_column() -> None
Next column, defaults to current row or next row if the current row is finished
def get_column_index() -> int
Get current column index
def get_column_width(column_index: int = -1) -> float
Get column width (in pixels). pass -1 to use current column
def set_column_width(column_index: int, width: float) -> None
Set column width (in pixels). pass -1 to use current column
def get_column_offset(column_index: int = -1) -> float
Get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..get_columns_count()
inclusive. column 0 is typically 0.0f
def set_column_offset(column_index: int, offset_x: float) -> None
Set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
def get_columns_count() -> int
def begin_tab_bar(str_id: str, flags: TabBarFlags = TabBarFlags.NONE) -> bool
Create and append into a TabBar
def end_tab_bar() -> None
Only call end_tab_bar()
if begin_tab_bar()
returns true!
def tab_item_button(label: str, flags: TabItemFlags = TabItemFlags.NONE) -> bool
Create a Tab behaving like a button. return true when clicked. cannot be selected in the tab bar.
def set_tab_item_closed(label: str) -> None
Notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after begin_tab_bar()
and before Tab submissions. Otherwise call with a window name.
def begin_tab_item(str_id: str, closable: bool = False, flags: TabItemFlags = TabItemFlags.NONE) -> tuple[bool, bool]
Create a Tab. Returns true if the Tab is selected.
When the closable
argument is set to True
,
the created tab will display a close button. The second bool of the
return value will be False
if the close button was pressed.
The intended usage is as follows:
tab_open = True # open/closed state
visible, tab_open = imgui.begin_tab_item(..., closable=tab_open)
if visible:
# render tab contents here..
def end_tab_item() -> None
Only call end_tab_item()
if begin_tab_item()
returns true!
Style.disabled_alpha
over current colors).begin_disabled(True)
in the stack is enough to keep everything disabled).begin_disabled(False)
/end_disabled()
essentially does nothing but is provided to facilitate the use of boolean expressions (as a micro-optimization: if you have tens of thousands of begin_disabled(False)
/end_disabled()
pairs, you might want to reformulate your code to avoid making those calls).def begin_disabled(disabled: bool = True) -> None
def end_disabled() -> None
push_clip_rect()
calls, unlike direct calls to DrawList.push_clip_rect()
which are render only.def push_clip_rect(clip_rect_min: tuple[float, float], clip_rect_max: tuple[float, float], intersect_with_current_clip_rect: bool) -> None
def pop_clip_rect() -> None
def set_item_default_focus() -> None
Make last item the default focused item of a newly appearing window.
def set_keyboard_focus_here(offset: int = 0) -> None
Focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
def set_nav_cursor_visible(visible: bool) -> None
Alter visibility of keyboard/gamepad cursor. by default: show when using an arrow key, hide when clicking with mouse.
def set_next_item_allow_overlap() -> None
Allow next item to be overlapped by a subsequent item. Useful with invisible buttons, selectable, treenode covering an area where subsequent items may need to be added. Note that both selectable()
and tree_node()
have dedicated flags doing this.
def is_item_hovered(flags: HoveredFlags = HoveredFlags.NONE) -> bool
Is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
def is_item_active() -> bool
Is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false)
def is_item_focused() -> bool
Is the last item focused for keyboard/gamepad navigation?
def is_item_clicked(mouse_button: MouseButton = MouseButton.LEFT) -> bool
Is the last item hovered and mouse clicked on? (**) == is_mouse_clicked(mouse_button)
&& is_item_hovered()
Important. (**) this is NOT equivalent to the behavior of e.g. button()
. Read comments in function definition.
def is_item_visible() -> bool
Is the last item visible? (items may be out of sight because of clipping/scrolling)
def is_item_edited() -> bool
Did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.
def is_item_activated() -> bool
Was the last item just made active (item was previously inactive).
def is_item_deactivated() -> bool
Was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that require continuous editing.
def is_item_deactivated_after_edit() -> bool
Was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that require continuous editing. Note that you may get false positives (some widgets such as combo()
/list_box()
/selectable()
will return true even when clicking an already selected item).
def is_item_toggled_open() -> bool
Was the last item open state toggled? set by tree_node()
.
def is_any_item_hovered() -> bool
Is any item hovered?
def is_any_item_active() -> bool
Is any item active?
def is_any_item_focused() -> bool
Is any item focused?
def get_item_rect_min() -> tuple[float, float]
Get upper-left bounding rectangle of the last item (screen space)
def get_item_rect_max() -> tuple[float, float]
Get lower-right bounding rectangle of the last item (screen space)
def get_item_rect_size() -> tuple[float, float]
Get size of last item
def get_main_viewport() -> Viewport
Return primary/default viewport. This can never be NULL.
def is_rect_visible(size: tuple[float, float]) -> bool
Test if rectangle (of given size, starting from cursor position) is visible / not clipped.
def is_rect_visible(rect_min: tuple[float, float], rect_max: tuple[float, float]) -> bool
def get_time() -> float
Get global imgui time. incremented by io.DeltaTime every frame.
def get_frame_count() -> int
Get global imgui frame count. incremented by 1 every frame.
def get_style_color_name(col: Col) -> str
Get a string corresponding to the enum value (for display, saving, etc.).
def calc_text_size(text: str, hide_text_after_double_hash: bool = False, wrap_width: float = -1.0) -> tuple[float, float]
def color_convert_u32_to_float4(arg: int, /) -> tuple[float, float, float, float]
def color_convert_float4_to_u32(arg: tuple[float, float, float, float], /) -> int
def color_convert_rgb_to_hsv(rgba: tuple[float, float, float, float]) -> tuple[float, float, float, float]
def color_convert_hsv_to_rgb(hsv: tuple[float, float, float, float]) -> tuple[float, float, float, float]
Key
enum contains all possible keyboard, mouse, and gamepad inputs (e.g., Key.KEY_A
, Key.MOUSE_LEFT
, Key.GAMEPAD_DPAD_UP
).def is_key_down(key: Key) -> bool
Is key being held.
def is_key_pressed(key: Key, repeat: bool = True) -> bool
Was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
def is_key_released(key: Key) -> bool
Was key released (went from Down to !Down)?
def is_key_chord_pressed(key_chord: Key) -> bool
Was key chord (mods + key) pressed, e.g. you can pass 'ImGuiMod_Ctrl | ImGuiKey_S' as a key-chord. This doesn't do any routing or focus check, please consider using shortcut()
function instead.
def get_key_pressed_amount(key: Key, repeat_delay: float, rate: float) -> int
Uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
def get_key_name(key: Key) -> str
[DEBUG] returns English name of the key. Those names are provided for debugging purpose and are not meant to be saved persistently nor compared.
def set_next_frame_want_capture_keyboard(want_capture_keyboard: bool) -> None
MouseButton.LEFT
, MouseButton.RIGHT
.def is_mouse_down(button: MouseButton) -> bool
Is mouse button held?
def is_mouse_clicked(button: MouseButton, repeat: bool = False) -> bool
Did mouse button clicked? (went from !Down to Down). Same as get_mouse_clicked_count()
== 1.
def is_mouse_released(button: MouseButton) -> bool
Did mouse button released? (went from Down to !Down)
def is_mouse_double_clicked(button: MouseButton) -> bool
Did mouse button double-clicked? Same as get_mouse_clicked_count()
== 2. (note that a double-click will also report is_mouse_clicked()
== true)
def is_mouse_released_with_delay(button: MouseButton, delay: float) -> bool
Delayed mouse release (use very sparingly!). Generally used with 'delay >= io.MouseDoubleClickTime' + combined with a 'io.MouseClickedLastCount==1' test. This is a very rarely used UI idiom, but some apps use this: e.g. MS Explorer single click on an icon to rename.
def get_mouse_clicked_count(button: MouseButton) -> int
Return the number of successive mouse-clicks at the time where a click happen (otherwise 0).
def is_mouse_hovering_rect(r_min: tuple[float, float], r_max: tuple[float, float], clip: bool = True) -> bool
Is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
def is_mouse_pos_valid(mouse_pos: tuple[float, float] | None = None) -> bool
By convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
def get_mouse_pos() -> tuple[float, float]
Shortcut to ImGui::get_io()
.MousePos provided by user, to be consistent with other calls
def get_mouse_pos_on_opening_current_popup() -> tuple[float, float]
Retrieve mouse position at the time of opening popup we have begin_popup()
into (helper to avoid user backing that value themselves)
def is_mouse_dragging(button: MouseButton, lock_threshold: float = -1.0) -> bool
Is mouse dragging? (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
def get_mouse_drag_delta(button: MouseButton = MouseButton.LEFT, lock_threshold: float = -1.0) -> tuple[float, float]
Return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (uses io.MouseDraggingThreshold if lock_threshold < 0.0f)
def reset_mouse_drag_delta(button: MouseButton = MouseButton.LEFT) -> None
def get_mouse_cursor() -> MouseCursor
Get desired mouse cursor shape. Important: reset in ImGui::new_frame()
, this is updated during the frame. valid before render()
. If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
def set_mouse_cursor(cursor_type: MouseCursor) -> None
Set desired mouse cursor shape
def set_next_frame_want_capture_mouse(capture: bool) -> None
NONE | |
HAS_GAMEPAD | Backend Platform supports gamepad and currently has one connected. |
HAS_MOUSE_CURSORS | Backend Platform supports honoring get_mouse_cursor() value to change the OS cursor shape. |
HAS_SET_MOUSE_POS | Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if io.ConfigNavMoveSetMousePos is set). |
RENDERER_HAS_VTX_OFFSET | Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices. |
NONE | |
MOUSE_BUTTON_LEFT | React on left mouse button (default) |
MOUSE_BUTTON_RIGHT | React on right mouse button |
MOUSE_BUTTON_MIDDLE | React on center mouse button |
ENABLE_NAV | invisible_button() : do not disable navigation/tabbing. Otherwise disabled by default. |
NONE | |
BORDERS | Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason) |
ALWAYS_USE_WINDOW_PADDING | Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense) |
RESIZE_X | Allow resize from right border (layout direction). Enable .ini saving (unless WindowFlags.NO_SAVED_SETTINGS passed to window flags) |
RESIZE_Y | Allow resize from bottom border (layout direction). |
AUTO_RESIZE_X | Enable auto-resizing width. Read IMPORTANT: Size measurement" details above. |
AUTO_RESIZE_Y | Enable auto-resizing height. Read IMPORTANT: Size measurement" details above. |
ALWAYS_AUTO_RESIZE | Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED. |
FRAME_STYLE | Style the child window like a framed item: use FrameBg, FrameRounding, FrameBorderSize, FramePadding instead of ChildBg, ChildRounding, ChildBorderSize, WindowPadding. |
NAV_FLATTENED | [BETA] Share focus scope, allow keyboard/gamepad navigation to cross over parent border to this child or between sibling child windows. |
TEXT | |
TEXT_DISABLED | |
WINDOW_BG | Background of normal windows |
CHILD_BG | Background of child windows |
POPUP_BG | Background of popups, menus, tooltips windows |
BORDER | |
BORDER_SHADOW | |
FRAME_BG | Background of checkbox, radio button, plot, slider, text input |
FRAME_BG_HOVERED | |
FRAME_BG_ACTIVE | |
TITLE_BG | Title bar |
TITLE_BG_ACTIVE | Title bar when focused |
TITLE_BG_COLLAPSED | Title bar when collapsed |
MENU_BAR_BG | |
SCROLLBAR_BG | |
SCROLLBAR_GRAB | |
SCROLLBAR_GRAB_HOVERED | |
SCROLLBAR_GRAB_ACTIVE | |
CHECK_MARK | checkbox tick and radio_button circle |
SLIDER_GRAB | |
SLIDER_GRAB_ACTIVE | |
BUTTON | |
BUTTON_HOVERED | |
BUTTON_ACTIVE | |
HEADER | Header* colors are used for collapsing_header , tree_node , selectable , menu_item |
HEADER_HOVERED | |
HEADER_ACTIVE | |
SEPARATOR | |
SEPARATOR_HOVERED | |
SEPARATOR_ACTIVE | |
RESIZE_GRIP | Resize grip in lower-right and lower-left corners of windows. |
RESIZE_GRIP_HOVERED | |
RESIZE_GRIP_ACTIVE | |
TAB_HOVERED | Tab background, when hovered |
TAB | Tab background, when tab-bar is focused & tab is unselected |
TAB_SELECTED | Tab background, when tab-bar is focused & tab is selected |
TAB_SELECTED_OVERLINE | Tab horizontal overline, when tab-bar is focused & tab is selected |
TAB_DIMMED | Tab background, when tab-bar is unfocused & tab is unselected |
TAB_DIMMED_SELECTED | Tab background, when tab-bar is unfocused & tab is selected |
TAB_DIMMED_SELECTED_OVERLINE | |
PLOT_LINES | |
PLOT_LINES_HOVERED | |
PLOT_HISTOGRAM | |
PLOT_HISTOGRAM_HOVERED | |
TABLE_HEADER_BG | Table header background |
TABLE_BORDER_STRONG | Table outer and header borders (prefer using Alpha=1.0 here) |
TABLE_BORDER_LIGHT | Table inner borders (prefer using Alpha=1.0 here) |
TABLE_ROW_BG | Table row background (even rows) |
TABLE_ROW_BG_ALT | Table row background (odd rows) |
TEXT_LINK | Hyperlink color |
TEXT_SELECTED_BG | |
DRAG_DROP_TARGET | Rectangle highlighting a drop target |
NAV_CURSOR | Color of keyboard/gamepad navigation cursor/rectangle, when visible |
NAV_WINDOWING_HIGHLIGHT | Highlight window when using CTRL+TAB |
NAV_WINDOWING_DIM_BG | Darken/colorize entire screen behind the CTRL+TAB window list, when active |
MODAL_WINDOW_DIM_BG | Darken/colorize entire screen behind a modal window, when one is active |
COUNT |
NONE | |
NO_ALPHA | ColorEdit, ColorPicker, color_button : ignore Alpha component (will only read 3 components from the input pointer). |
NO_PICKER | ColorEdit: disable picker when clicking on color square. |
NO_OPTIONS | ColorEdit: disable toggling options menu when right-clicking on inputs/small preview. |
NO_SMALL_PREVIEW | ColorEdit, ColorPicker: disable color square preview next to the inputs. (e.g. to show only the inputs) |
NO_INPUTS | ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview color square). |
NO_TOOLTIP | ColorEdit, ColorPicker, color_button : disable tooltip when hovering the preview. |
NO_LABEL | ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker). |
NO_SIDE_PREVIEW | ColorPicker: disable bigger color preview on right side of the picker, use small color square preview instead. |
NO_DRAG_DROP | ColorEdit: disable drag and drop target. color_button : disable drag and drop source. |
NO_BORDER | color_button : disable border (which is enforced by default) |
ALPHA_OPAQUE | ColorEdit, ColorPicker, color_button : disable alpha in the preview,. Contrary to _NoAlpha it may still be edited when calling color_edit4() /color_picker4() . For color_button() this does the same as _NoAlpha. |
ALPHA_NO_BG | ColorEdit, ColorPicker, color_button : disable rendering a checkerboard background behind transparent color. |
ALPHA_PREVIEW_HALF | ColorEdit, ColorPicker, color_button : display half opaque / half transparent preview. |
ALPHA_BAR | ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker. |
HDR | (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ColorEditFlags.FLOAT flag as well). |
DISPLAY_RGB | ColorEdit: override _display_ type among RGB/HSV/Hex. ColorPicker: select any combination using one or more of RGB/HSV/Hex. |
DISPLAY_HSV | |
DISPLAY_HEX | |
UINT8 | ColorEdit, ColorPicker, color_button : _display_ values formatted as 0..255. |
FLOAT | ColorEdit, ColorPicker, color_button : _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers. |
PICKER_HUE_BAR | ColorPicker: bar for Hue, rectangle for Sat/Value. |
PICKER_HUE_WHEEL | ColorPicker: wheel for Hue, triangle for Sat/Value. |
INPUT_RGB | ColorEdit, ColorPicker: input and output data in RGB format. |
INPUT_HSV | ColorEdit, ColorPicker: input and output data in HSV format. |
NONE | |
POPUP_ALIGN_LEFT | Align the popup toward the left by default |
HEIGHT_SMALL | Max ~4 items visible. Tip: If you want your combo popup to be a specific size you can use set_next_window_size_constraints() prior to calling begin_combo() |
HEIGHT_REGULAR | Max ~8 items visible (default) |
HEIGHT_LARGE | Max ~20 items visible |
HEIGHT_LARGEST | As many fitting items as possible |
NO_ARROW_BUTTON | Display on the preview box without the square arrow button |
NO_PREVIEW | Display only a square arrow button |
WIDTH_FIT_PREVIEW | Width dynamically calculated from preview contents |
NONE | No condition (always set the variable), same as _Always |
ALWAYS | No condition (always set the variable), same as _None |
ONCE | Set the variable once per runtime session (only the first call will succeed) |
FIRST_USE_EVER | Set the variable if the object/window has no persistently saved data (no entry in .ini file) |
APPEARING | Set the variable if the object/window is appearing after being hidden/inactive (or the first time) |
NONE | |
NAV_ENABLE_KEYBOARD | Master keyboard navigation enable flag. Enable full Tabbing + directional arrows + space/enter to activate. |
NAV_ENABLE_GAMEPAD | Master gamepad navigation enable flag. Backend also needs to set BackendFlags.HAS_GAMEPAD . |
NO_MOUSE | Instruct dear imgui to disable mouse inputs and interactions. |
NO_MOUSE_CURSOR_CHANGE | Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use set_mouse_cursor() to change mouse cursor. You may want to honor requests from imgui by reading get_mouse_cursor() yourself instead. |
NO_KEYBOARD | Instruct dear imgui to disable keyboard inputs and interactions. This is done by ignoring keyboard events and clearing existing states. |
IS_SRGB | Application is SRGB-aware. |
IS_TOUCH_SCREEN | Application is using a touch screen instead of a mouse. |
NONE | |
LEFT | |
RIGHT | |
UP | |
DOWN | |
COUNT |
NONE | |
SOURCE_NO_PREVIEW_TOOLTIP | Disable preview tooltip. By default, a successful call to begin_drag_drop_source opens a tooltip so you can display a preview or description of the source contents. This flag disables this behavior. |
SOURCE_NO_DISABLE_HOVER | By default, when dragging we clear data so that is_item_hovered() will return false, to avoid subsequent user code submitting tooltips. This flag disables this behavior so you can still call is_item_hovered() on the source item. |
SOURCE_NO_HOLD_TO_OPEN_OTHERS | Disable the behavior that allows to open tree nodes and collapsing header by holding over them while dragging a source item. |
SOURCE_ALLOW_NULL_ID | Allow items such as text() , image() that have no unique identifier to be used as drag source, by manufacturing a temporary identifier based on their window-relative position. This is extremely unusual within the dear imgui ecosystem and so we made it explicit. |
SOURCE_EXTERN | External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously. |
PAYLOAD_AUTO_EXPIRE | Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged) |
PAYLOAD_NO_CROSS_CONTEXT | Hint to specify that the payload may not be copied outside current dear imgui context. |
PAYLOAD_NO_CROSS_PROCESS | Hint to specify that the payload may not be copied outside current process. |
ACCEPT_BEFORE_DELIVERY | accept_drag_drop_payload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered. |
ACCEPT_NO_DRAW_DEFAULT_RECT | Do not draw the default highlight rectangle when hovering over target. |
ACCEPT_NO_PREVIEW_TOOLTIP | Request hiding the begin_drag_drop_source tooltip from the begin_drag_drop_target site. |
ACCEPT_PEEK_ONLY | For peeking ahead and inspecting the payload before delivery. |
NONE | |
CLOSED | PathStroke(), AddPolyline(): specify that shape should be closed (Important: this is always == 1 for legacy reason) |
ROUND_CORNERS_TOP_LEFT | AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding > 0.0f, we default to all corners). Was 0x01. |
ROUND_CORNERS_TOP_RIGHT | AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding > 0.0f, we default to all corners). Was 0x02. |
ROUND_CORNERS_BOTTOM_LEFT | AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding > 0.0f, we default to all corners). Was 0x04. |
ROUND_CORNERS_BOTTOM_RIGHT | AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding > 0.0f, we default to all corners). Wax 0x08. |
ROUND_CORNERS_NONE | AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding > 0.0f). This is NOT zero, NOT an implicit flag! |
ROUND_CORNERS_TOP | |
ROUND_CORNERS_BOTTOM | |
ROUND_CORNERS_LEFT | |
ROUND_CORNERS_RIGHT | |
ROUND_CORNERS_ALL |
NONE | |
CHILD_WINDOWS | Return true if any children of the window is focused |
ROOT_WINDOW | Test from root window (top most parent of the current hierarchy) |
ANY_WINDOW | Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ! |
NO_POPUP_HIERARCHY | Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow) |
ROOT_AND_CHILD_WINDOWS |
NONE | Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them. |
CHILD_WINDOWS | is_window_hovered() only: Return true if any children of the window is hovered |
ROOT_WINDOW | is_window_hovered() only: Test from root window (top most parent of the current hierarchy) |
ANY_WINDOW | is_window_hovered() only: Return true if any window is hovered |
NO_POPUP_HIERARCHY | is_window_hovered() only: Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow) |
ALLOW_WHEN_BLOCKED_BY_POPUP | Return true even if a popup window is normally blocking access to this item/window |
ALLOW_WHEN_BLOCKED_BY_ACTIVE_ITEM | Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns. |
ALLOW_WHEN_OVERLAPPED_BY_ITEM | is_item_hovered() only: Return true even if the item uses AllowOverlap mode and is overlapped by another hoverable item. |
ALLOW_WHEN_OVERLAPPED_BY_WINDOW | is_item_hovered() only: Return true even if the position is obstructed or overlapped by another window. |
ALLOW_WHEN_DISABLED | is_item_hovered() only: Return true even if the item is disabled |
NO_NAV_OVERRIDE | is_item_hovered() only: Disable using keyboard/gamepad navigation state when active, always query mouse |
ALLOW_WHEN_OVERLAPPED | |
RECT_ONLY | |
ROOT_AND_CHILD_WINDOWS | |
FOR_TOOLTIP | Shortcut for standard flags when using is_item_hovered() + set_tooltip() sequence. |
STATIONARY | Require mouse to be stationary for style.HoverStationaryDelay (~0.15 sec) _at least one time_. After this, can move on same item/window. Using the stationary test tends to reduces the need for a long delay. |
DELAY_NONE | is_item_hovered() only: Return true immediately (default). As this is the default you generally ignore this. |
DELAY_SHORT | is_item_hovered() only: Return true after style.HoverDelayShort elapsed (~0.15 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item). |
DELAY_NORMAL | is_item_hovered() only: Return true after style.HoverDelayNormal elapsed (~0.40 sec) (shared between items) + requires mouse to be stationary for style.HoverStationaryDelay (once per item). |
NO_SHARED_DELAY | is_item_hovered() only: Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays) |
NONE | |
CHARS_DECIMAL | Allow 0123456789.+-*/ |
CHARS_HEXADECIMAL | Allow 0123456789ABCDEFabcdef |
CHARS_SCIENTIFIC | Allow 0123456789.+-*/eE (Scientific notation input) |
CHARS_UPPERCASE | Turn a..z into A..Z |
CHARS_NO_BLANK | Filter out spaces, tabs |
ALLOW_TAB_INPUT | Pressing TAB input a ' ' character into the text field |
ENTER_RETURNS_TRUE | Return 'true' when Enter is pressed (as opposed to every time the value was modified). Consider using is_item_deactivated_after_edit() instead! |
ESCAPE_CLEARS_ALL | Escape key clears content if not empty, and deactivate otherwise (contrast to default behavior of Escape to revert) |
CTRL_ENTER_FOR_NEW_LINE | In multi-line mode, validate with Enter, add new line with Ctrl+Enter (default is opposite: validate with Ctrl+Enter, add line with Enter). |
READ_ONLY | Read-only mode |
PASSWORD | Password mode, display all characters as '*', disable copy |
ALWAYS_OVERWRITE | Overwrite mode |
AUTO_SELECT_ALL | Select entire text when first taking mouse focus |
PARSE_EMPTY_REF_VAL | input_float() , input_int() , input_scalar() etc. only: parse empty string as zero value. |
DISPLAY_EMPTY_REF_VAL | input_float() , input_int() , input_scalar() etc. only: when value is zero, do not display it. Generally used with InputTextFlags.PARSE_EMPTY_REF_VAL . |
NO_HORIZONTAL_SCROLL | Disable following the cursor horizontally |
NO_UNDO_REDO | Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call clear_active_id() . |
ELIDE_LEFT | When text doesn't fit, elide left side to ensure right side stays visible. Useful for path/filenames. Single-line only! |
CALLBACK_COMPLETION | Callback on pressing TAB (for completion handling) |
CALLBACK_HISTORY | Callback on pressing Up/Down arrows (for history handling) |
CALLBACK_ALWAYS | Callback on each iteration. User code may query cursor position, modify text buffer. |
CALLBACK_CHAR_FILTER | Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard. |
CALLBACK_RESIZE | Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow. Notify when the string wants to be resized (for string types which hold a cache of their Size). You will be provided a new BufSize in the callback and NEED to honor it. (see misc/cpp/imgui_stdlib.h for an example of using this) |
CALLBACK_EDIT | Callback on any edit. Note that input_text() already returns true on edit + you can always use is_item_edited() . The callback is useful to manipulate the underlying buffer while focus is active. |
KEY_NONE | |
KEY_NAMED_KEY_BEGIN | |
KEY_TAB | |
KEY_LEFT_ARROW | |
KEY_RIGHT_ARROW | |
KEY_UP_ARROW | |
KEY_DOWN_ARROW | |
KEY_PAGE_UP | |
KEY_PAGE_DOWN | |
KEY_HOME | |
KEY_END | |
KEY_INSERT | |
KEY_DELETE | |
KEY_BACKSPACE | |
KEY_SPACE | |
KEY_ENTER | |
KEY_ESCAPE | |
KEY_LEFT_CTRL | |
KEY_LEFT_SHIFT | |
KEY_LEFT_ALT | |
KEY_LEFT_SUPER | |
KEY_RIGHT_CTRL | |
KEY_RIGHT_SHIFT | |
KEY_RIGHT_ALT | |
KEY_RIGHT_SUPER | |
KEY_MENU | |
KEY_0 | |
KEY_1 | |
KEY_2 | |
KEY_3 | |
KEY_4 | |
KEY_5 | |
KEY_6 | |
KEY_7 | |
KEY_8 | |
KEY_9 | |
KEY_A | |
KEY_B | |
KEY_C | |
KEY_D | |
KEY_E | |
KEY_F | |
KEY_G | |
KEY_H | |
KEY_I | |
KEY_J | |
KEY_K | |
KEY_L | |
KEY_M | |
KEY_N | |
KEY_O | |
KEY_P | |
KEY_Q | |
KEY_R | |
KEY_S | |
KEY_T | |
KEY_U | |
KEY_V | |
KEY_W | |
KEY_X | |
KEY_Y | |
KEY_Z | |
KEY_F1 | |
KEY_F2 | |
KEY_F3 | |
KEY_F4 | |
KEY_F5 | |
KEY_F6 | |
KEY_F7 | |
KEY_F8 | |
KEY_F9 | |
KEY_F10 | |
KEY_F11 | |
KEY_F12 | |
KEY_F13 | |
KEY_F14 | |
KEY_F15 | |
KEY_F16 | |
KEY_F17 | |
KEY_F18 | |
KEY_F19 | |
KEY_F20 | |
KEY_F21 | |
KEY_F22 | |
KEY_F23 | |
KEY_F24 | |
KEY_APOSTROPHE | |
KEY_COMMA | |
KEY_MINUS | |
KEY_PERIOD | |
KEY_SLASH | |
KEY_SEMICOLON | |
KEY_EQUAL | |
KEY_LEFT_BRACKET | |
KEY_BACKSLASH | |
KEY_RIGHT_BRACKET | |
KEY_GRAVE_ACCENT | |
KEY_CAPS_LOCK | |
KEY_SCROLL_LOCK | |
KEY_NUM_LOCK | |
KEY_PRINT_SCREEN | |
KEY_PAUSE | |
KEY_KEYPAD0 | |
KEY_KEYPAD1 | |
KEY_KEYPAD2 | |
KEY_KEYPAD3 | |
KEY_KEYPAD4 | |
KEY_KEYPAD5 | |
KEY_KEYPAD6 | |
KEY_KEYPAD7 | |
KEY_KEYPAD8 | |
KEY_KEYPAD9 | |
KEY_KEYPAD_DECIMAL | |
KEY_KEYPAD_DIVIDE | |
KEY_KEYPAD_MULTIPLY | |
KEY_KEYPAD_SUBTRACT | |
KEY_KEYPAD_ADD | |
KEY_KEYPAD_ENTER | |
KEY_KEYPAD_EQUAL | |
KEY_APP_BACK | |
KEY_APP_FORWARD | |
KEY_OEM102 | |
KEY_GAMEPAD_START | |
KEY_GAMEPAD_BACK | |
KEY_GAMEPAD_FACE_LEFT | |
KEY_GAMEPAD_FACE_RIGHT | |
KEY_GAMEPAD_FACE_UP | |
KEY_GAMEPAD_FACE_DOWN | |
KEY_GAMEPAD_DPAD_LEFT | |
KEY_GAMEPAD_DPAD_RIGHT | |
KEY_GAMEPAD_DPAD_UP | |
KEY_GAMEPAD_DPAD_DOWN | |
KEY_GAMEPAD_L1 | |
KEY_GAMEPAD_R1 | |
KEY_GAMEPAD_L2 | |
KEY_GAMEPAD_R2 | |
KEY_GAMEPAD_L3 | |
KEY_GAMEPAD_R3 | |
KEY_GAMEPAD_L_STICK_LEFT | |
KEY_GAMEPAD_L_STICK_RIGHT | |
KEY_GAMEPAD_L_STICK_UP | |
KEY_GAMEPAD_L_STICK_DOWN | |
KEY_GAMEPAD_R_STICK_LEFT | |
KEY_GAMEPAD_R_STICK_RIGHT | |
KEY_GAMEPAD_R_STICK_UP | |
KEY_GAMEPAD_R_STICK_DOWN | |
KEY_MOUSE_LEFT | |
KEY_MOUSE_RIGHT | |
KEY_MOUSE_MIDDLE | |
KEY_MOUSE_X1 | |
KEY_MOUSE_X2 | |
KEY_MOUSE_WHEEL_X | |
KEY_MOUSE_WHEEL_Y | |
KEY_RESERVED_FOR_MOD_CTRL | |
KEY_RESERVED_FOR_MOD_SHIFT | |
KEY_RESERVED_FOR_MOD_ALT | |
KEY_RESERVED_FOR_MOD_SUPER | |
KEY_NAMED_KEY_END | |
MOD_NONE | |
MOD_CTRL | |
MOD_SHIFT | |
MOD_ALT | |
MOD_SUPER | |
KEY_NAMED_KEY_COUNT |
LEFT | |
RIGHT | |
MIDDLE | |
COUNT |
NONE | |
ARROW | |
TEXT_INPUT | When hovering over input_text , etc. |
RESIZE_ALL | (Unused by Dear ImGui functions) |
RESIZE_NS | When hovering over a horizontal border |
RESIZE_EW | When hovering over a vertical border or a column |
RESIZE_NESW | When hovering over the bottom-left corner of a window |
RESIZE_NWSE | When hovering over the bottom-right corner of a window |
HAND | (Unused by Dear ImGui functions. Use for e.g. hyperlinks) |
WAIT | When waiting for something to process/load. |
PROGRESS | When waiting for something to process/load, but application is still interactive. |
NOT_ALLOWED | When hovering something with disallowed interaction. Usually a crossed circle. |
COUNT |
NONE | |
MOUSE_BUTTON_LEFT | For BeginPopupContext*(): open on Left Mouse release. Guaranteed to always be == 0 (same as MouseButton.LEFT ) |
MOUSE_BUTTON_RIGHT | For BeginPopupContext*(): open on Right Mouse release. Guaranteed to always be == 1 (same as MouseButton.RIGHT ) |
MOUSE_BUTTON_MIDDLE | For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as MouseButton.MIDDLE ) |
NO_REOPEN | For open_popup *(), BeginPopupContext*(): don't reopen same popup if already open (won't reposition, won't reinitialize navigation) |
NO_OPEN_OVER_EXISTING_POPUP | For open_popup *(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack |
NO_OPEN_OVER_ITEMS | For begin_popup_context_window() : don't return true when hovering items, only when hovering empty space |
ANY_POPUP_ID | For is_popup_open() : ignore the ImGuiID parameter and test for any popup. |
ANY_POPUP_LEVEL | For is_popup_open() : search/test at any level of the popup stack (default test in the current level) |
ANY_POPUP |
NONE | |
NO_AUTO_CLOSE_POPUPS | Clicking this doesn't close parent popup window (overrides ItemFlags.AUTO_CLOSE_POPUPS ) |
SPAN_ALL_COLUMNS | Frame will span all columns of its container table (text will still fit in current column) |
ALLOW_DOUBLE_CLICK | Generate press events on double clicks too |
DISABLED | Cannot be selected, display grayed out text |
ALLOW_OVERLAP | (WIP) Hit testing to allow subsequent widgets to overlap this one |
HIGHLIGHT | Make the item be displayed as if it is hovered |
NONE | |
LOGARITHMIC | Make the widget logarithmic (linear otherwise). Consider using SliderFlags.NO_ROUND_TO_FORMAT with this if using a format-string with small amount of digits. |
NO_ROUND_TO_FORMAT | Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits). |
NO_INPUT | Disable CTRL+Click or Enter key allowing to input text directly into the widget. |
WRAP_AROUND | Enable wrapping around from max to min and from min to max. Only supported by DragXXX() functions for now. |
CLAMP_ON_INPUT | Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds. |
CLAMP_ZERO_RANGE | Clamp even if min==max==0.0f. Otherwise due to legacy reason DragXXX functions don't clamp with those values. When your clamping limits are dynamic you almost always want to use it. |
NO_SPEED_TWEAKS | Disable keyboard modifiers altering tweak speed. Useful if you want to alter tweak speed yourself based on your own logic. |
ALWAYS_CLAMP |
ALPHA | Float Alpha |
DISABLED_ALPHA | Float DisabledAlpha |
WINDOW_PADDING | ImVec2 WindowPadding |
WINDOW_ROUNDING | Float WindowRounding |
WINDOW_BORDER_SIZE | Float WindowBorderSize |
WINDOW_MIN_SIZE | ImVec2 WindowMinSize |
WINDOW_TITLE_ALIGN | ImVec2 WindowTitleAlign |
CHILD_ROUNDING | Float ChildRounding |
CHILD_BORDER_SIZE | Float ChildBorderSize |
POPUP_ROUNDING | Float PopupRounding |
POPUP_BORDER_SIZE | Float PopupBorderSize |
FRAME_PADDING | ImVec2 FramePadding |
FRAME_ROUNDING | Float FrameRounding |
FRAME_BORDER_SIZE | Float FrameBorderSize |
ITEM_SPACING | ImVec2 ItemSpacing |
ITEM_INNER_SPACING | ImVec2 ItemInnerSpacing |
INDENT_SPACING | Float IndentSpacing |
CELL_PADDING | ImVec2 CellPadding |
SCROLLBAR_SIZE | Float ScrollbarSize |
SCROLLBAR_ROUNDING | Float ScrollbarRounding |
GRAB_MIN_SIZE | Float GrabMinSize |
GRAB_ROUNDING | Float GrabRounding |
IMAGE_BORDER_SIZE | Float ImageBorderSize |
TAB_ROUNDING | Float TabRounding |
TAB_BORDER_SIZE | Float TabBorderSize |
TAB_BAR_BORDER_SIZE | Float TabBarBorderSize |
TAB_BAR_OVERLINE_SIZE | Float TabBarOverlineSize |
TABLE_ANGLED_HEADERS_ANGLE | Float TableAngledHeadersAngle |
TABLE_ANGLED_HEADERS_TEXT_ALIGN | ImVec2 TableAngledHeadersTextAlign |
BUTTON_TEXT_ALIGN | ImVec2 ButtonTextAlign |
SELECTABLE_TEXT_ALIGN | ImVec2 SelectableTextAlign |
SEPARATOR_TEXT_BORDER_SIZE | Float SeparatorTextBorderSize |
SEPARATOR_TEXT_ALIGN | ImVec2 SeparatorTextAlign |
SEPARATOR_TEXT_PADDING | ImVec2 SeparatorTextPadding |
COUNT |
NONE | |
REORDERABLE | Allow manually dragging tabs to re-order them + New tabs are appended at the end of list |
AUTO_SELECT_NEW_TABS | Automatically select new tabs when they appear |
TAB_LIST_POPUP_BUTTON | Disable buttons to open the tab list popup |
NO_CLOSE_WITH_MIDDLE_MOUSE_BUTTON | Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (is_item_hovered() && is_mouse_clicked(2) ) *p_open = false. |
NO_TAB_LIST_SCROLLING_BUTTONS | Disable scrolling buttons (apply when fitting policy is TabBarFlags.FITTING_POLICY_SCROLL ) |
NO_TOOLTIP | Disable tooltips when hovering a tab |
DRAW_SELECTED_OVERLINE | Draw selected overline markers over selected tab |
FITTING_POLICY_RESIZE_DOWN | Resize tabs when they don't fit |
FITTING_POLICY_SCROLL | Add scroll buttons when tabs don't fit |
NONE | |
UNSAVED_DOCUMENT | Display a dot next to the title + set TabItemFlags.NO_ASSUMED_CLOSURE . |
SET_SELECTED | Trigger flag to programmatically make the tab selected when calling begin_tab_item() |
NO_CLOSE_WITH_MIDDLE_MOUSE_BUTTON | Disable behavior of closing tabs (that are submitted with p_open != NULL) with middle mouse button. You may handle this behavior manually on user's side with if (is_item_hovered() && is_mouse_clicked(2) ) *p_open = false. |
NO_PUSH_ID | Don't call push_id() /pop_id() on begin_tab_item() /end_tab_item() |
NO_TOOLTIP | Disable tooltip for the given tab |
NO_REORDER | Disable reordering this tab or having another tab cross over this tab |
LEADING | Enforce the tab position to the left of the tab bar (after the tab list popup button) |
TRAILING | Enforce the tab position to the right of the tab bar (before the scrolling buttons) |
NO_ASSUMED_CLOSURE | Tab is selected when trying to close + closure is not immediately assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. |
NONE | |
ROW_BG0 | Set row background color 0 (generally used for background, automatically set when TableFlags.ROW_BG is used) |
ROW_BG1 | Set row background color 1 (generally used for selection marking) |
CELL_BG | Set cell background color (top-most color) |
NONE | |
DISABLED | Overriding/master disable flag: hide column, won't show in context menu (unlike calling table_set_column_enabled() which manipulates the user accessible state) |
DEFAULT_HIDE | Default as a hidden/disabled column. |
DEFAULT_SORT | Default as a sorting column. |
WIDTH_STRETCH | Column will stretch. Preferable with horizontal scrolling disabled (default if table sizing policy is _SizingStretchSame or _SizingStretchProp). |
WIDTH_FIXED | Column will not stretch. Preferable with horizontal scrolling enabled (default if table sizing policy is _SizingFixedFit and table is resizable). |
NO_RESIZE | Disable manual resizing. |
NO_REORDER | Disable manual reordering this column, this will also prevent other columns from crossing over this column. |
NO_HIDE | Disable ability to hide/disable this column. |
NO_CLIP | Disable clipping for this column (all NoClip columns will render in a same draw command). |
NO_SORT | Disable ability to sort on this field (even if TableFlags.SORTABLE is set on the table). |
NO_SORT_ASCENDING | Disable ability to sort in the ascending direction. |
NO_SORT_DESCENDING | Disable ability to sort in the descending direction. |
NO_HEADER_LABEL | table_headers_row() will submit an empty label for this column. Convenient for some small columns. Name will still appear in context menu or in angled headers. You may append into this cell by calling table_set_column_index() right after the table_headers_row() call. |
NO_HEADER_WIDTH | Disable header text width contribution to automatic column width. |
PREFER_SORT_ASCENDING | Make the initial sort direction Ascending when first sorting on this column (default). |
PREFER_SORT_DESCENDING | Make the initial sort direction Descending when first sorting on this column. |
INDENT_ENABLE | Use current indent value when entering cell (default for column 0). |
INDENT_DISABLE | Ignore current indent value when entering cell (default for columns > 0). Indentation changes _within_ the cell will still be honored. |
ANGLED_HEADER | table_headers_row() will submit an angled header row for this column. Note this will add an extra row. |
IS_ENABLED | Status: is enabled == not hidden by user/api (referred to as "Hide" in _DefaultHide and _NoHide) flags. |
IS_VISIBLE | Status: is visible == is enabled AND not clipped by scrolling. |
IS_SORTED | Status: is currently part of the sort specs |
IS_HOVERED | Status: is hovered by mouse |
NONE | |
RESIZABLE | Enable resizing columns. |
REORDERABLE | Enable reordering columns in header row (need calling table_setup_column() + table_headers_row() to display headers) |
HIDEABLE | Enable hiding/disabling columns in context menu. |
SORTABLE | Enable sorting. Call table_get_sort_specs() to obtain sort specs. Also see TableFlags.SORT_MULTI and TableFlags.SORT_TRISTATE . |
NO_SAVED_SETTINGS | Disable persisting columns order, width and sort settings in the .ini file. |
CONTEXT_MENU_IN_BODY | Right-click on columns body/contents will display table context menu. By default it is available in table_headers_row() . |
ROW_BG | Set each RowBg color with Col.TABLE_ROW_BG or Col.TABLE_ROW_BG_ALT (equivalent of calling table_set_bg_color with ImGuiTableBgFlags_RowBg0 on each row manually) |
BORDERS_INNER_H | Draw horizontal borders between rows. |
BORDERS_OUTER_H | Draw horizontal borders at the top and bottom. |
BORDERS_INNER_V | Draw vertical borders between columns. |
BORDERS_OUTER_V | Draw vertical borders on the left and right sides. |
BORDERS_H | Draw horizontal borders. |
BORDERS_V | Draw vertical borders. |
BORDERS_INNER | Draw inner borders. |
BORDERS_OUTER | Draw outer borders. |
BORDERS | Draw all borders. |
NO_BORDERS_IN_BODY | [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style |
NO_BORDERS_IN_BODY_UNTIL_RESIZE | [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style |
SIZING_FIXED_FIT | columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width. |
SIZING_FIXED_SAME | columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable TableFlags.NO_KEEP_COLUMNS_VISIBLE . |
SIZING_STRETCH_PROP | columns default to _WidthStretch with default weights proportional to each columns contents widths. |
SIZING_STRETCH_SAME | columns default to _WidthStretch with default weights all equal, unless overridden by table_setup_column() . |
NO_HOST_EXTEND_X | Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used. |
NO_HOST_EXTEND_Y | Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible. |
NO_KEEP_COLUMNS_VISIBLE | Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable. |
PRECISE_WIDTHS | Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth. |
NO_CLIP | Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with table_setup_scroll_freeze() . |
PAD_OUTER_X | Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers. |
NO_PAD_OUTER_X | Default if BordersOuterV is off. Disable outermost padding. |
NO_PAD_INNER_X | Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off). |
SCROLL_X | Enable horizontal scrolling. Require 'outer_size' parameter of begin_table() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX. |
SCROLL_Y | Enable vertical scrolling. Require 'outer_size' parameter of begin_table() to specify the container size. |
SORT_MULTI | Hold shift when clicking headers to sort on multiple column. table_get_sort_specs() may return specs where (SpecsCount > 1). |
SORT_TRISTATE | Allow no sorting, disable default sorting. table_get_sort_specs() may return specs where (SpecsCount == 0). |
HIGHLIGHT_HOVERED_COLUMN | Highlight column headers when hovered (may evolve into a fuller highlight) |
NONE | |
HEADERS | Identify header row (set default background color + width of its contents accounted differently for auto column width) |
NONE | |
SELECTED | Draw as selected |
FRAMED | Draw frame with background (e.g. for collapsing_header ) |
ALLOW_OVERLAP | Hit testing to allow subsequent widgets to overlap this one |
NO_TREE_PUSH_ON_OPEN | Don't do a tree_push() when open (e.g. for collapsing_header ) = no extra indent nor pushing on ID stack |
NO_AUTO_OPEN_ON_LOG | Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes) |
DEFAULT_OPEN | Default node to be open |
OPEN_ON_DOUBLE_CLICK | Open on double-click instead of simple click (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined. |
OPEN_ON_ARROW | Open when clicking on the arrow part (default for multi-select unless any _OpenOnXXX behavior is set explicitly). Both behaviors may be combined. |
LEAF | No collapsing, no arrow (use as a convenience for leaf nodes). |
BULLET | Display a bullet instead of arrow. IMPORTANT: node can still be marked open/close if you don't set the _Leaf flag! |
FRAME_PADDING | Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling align_text_to_frame_padding() before the node. |
SPAN_AVAIL_WIDTH | Extend hit box to the right-most edge, even if not framed. This is not the default in order to allow adding other items on the same line without using AllowOverlap mode. |
SPAN_FULL_WIDTH | Extend hit box to the left-most and right-most edges (cover the indent area). |
SPAN_LABEL_WIDTH | Narrow hit box + narrow hovering highlight, will only cover the label text. |
SPAN_ALL_COLUMNS | Frame will span all columns of its container table (label will still fit in current column) |
LABEL_SPAN_ALL_COLUMNS | Label will span all columns of its container table |
NAV_LEFT_JUMPS_BACK_HERE | (WIP) Nav: left direction may move to this tree_node() from any of its child (items submitted between tree_node and tree_pop ) |
COLLAPSING_HEADER |
NONE | |
NO_TITLE_BAR | Disable title-bar |
NO_RESIZE | Disable user resizing with the lower-right grip |
NO_MOVE | Disable user moving the window |
NO_SCROLLBAR | Disable scrollbars (window can still scroll with mouse or programmatically) |
NO_SCROLL_WITH_MOUSE | Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set. |
NO_COLLAPSE | Disable user collapsing window by double-clicking on it. Also referred to as Window Menu Button (e.g. within a docking node). |
ALWAYS_AUTO_RESIZE | Resize every window to its content every frame |
NO_BACKGROUND | Disable drawing background color (WindowBg, etc.) and outside border. Similar as using set_next_window_bg_alpha(0.0) . |
NO_SAVED_SETTINGS | Never load/save settings in .ini file |
NO_MOUSE_INPUTS | Disable catching mouse, hovering test with pass through. |
MENU_BAR | Has a menu-bar |
HORIZONTAL_SCROLLBAR | Allow horizontal scrollbar to appear (off by default). You may use set_next_window_content_size((width,0.0)) ; prior to calling begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section. |
NO_FOCUS_ON_APPEARING | Disable taking focus when transitioning from hidden to visible state |
NO_BRING_TO_FRONT_ON_FOCUS | Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus) |
ALWAYS_VERTICAL_SCROLLBAR | Always show vertical scrollbar (even if ContentSize.y < Size.y) |
ALWAYS_HORIZONTAL_SCROLLBAR | Always show horizontal scrollbar (even if ContentSize.x < Size.x) |
NO_NAV_INPUTS | No keyboard/gamepad navigation within the window |
NO_NAV_FOCUS | No focusing toward this window with keyboard/gamepad navigation (e.g. skipped by CTRL+TAB) |
UNSAVED_DOCUMENT | Display a dot next to the title. When used in a tab/docking context, tab is selected when clicking the X + closure is not assumed (will wait for user to stop submitting the tab). Otherwise closure is assumed when pressing the X, so if you keep submitting the tab may reappear at end of tab bar. |
NO_NAV | |
NO_DECORATION | |
NO_INPUTS | |
CHILD_WINDOW | Don't use! For internal use by begin_child() |
TOOLTIP | Don't use! For internal use by begin_tooltip() |
POPUP | Don't use! For internal use by begin_popup() |
MODAL | Don't use! For internal use by begin_popup_modal() |
CHILD_MENU | Don't use! For internal use by begin_menu() |