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

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

Dear ImGui

Dear ImGui: the immediate mode GUI library, on which every other module of the bundle builds.

The app’s code draws its widgets at each frame, and reads the user’s actions from them in the same call: if imgui.button("OK"): .... This module holds the widgets, the windows, the layout, the tables, the draw lists, the styles and the IO. To run an app, see immapp.run (or hello_imgui.run).

The names follow the C++ API: ImGui::Button is imgui.button, ImGuiWindowFlags_NoTitleBar is imgui.WindowFlags_.no_title_bar. Its interactive manual, each demo next to its code, is in the ImGui Explorer.

Upstream repository · The book’s page

Modules

In imgui_bundle (from imgui_bundle import imgui):

Demos using it

The demos of the catalog that use it (the pictures link to their code and to the playground).

Hello world, in two lines

Hello world, in two lines

ImmApp opens the window, runs the loop, and calls your GUI function at every frame: immapp.run(gui) is all it takes.

More

Add widgets to that function, and you have an app. The C++ version is three lines.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Resizable panels with child windows

Resizable panels with child windows

Learn how to create resizable adjacent panels, using child windows.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Drag and drop

Drag and drop

Drag a name onto another button to copy it, move it, or swap the two: the radio buttons pick the mode.

More

Each button is both a drag source and a drop target. Adapted from the drag and drop section of the Dear ImGui demo.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Knobs, toggles, spinners and more

Knobs, toggles, spinners and more

Knobs, toggle switches, spinners, a command palette, a dock-like cool bar: widgets beyond Dear ImGui’s own.

More

They come from the libraries in the bundle: imgui-knobs, imgui_toggle, imspinner, imgui-command-palette and ImCoolBar. Also file dialogs: the native ones (portable-file-dialogs), and ImFileDialog, drawn with ImGui.

Uses: knobs, toggles, spinners, cool bar, command palette, file dialogs

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Dear ImGui: the interactive manual

Dear ImGui: the interactive manual

Every widget and feature of Dear ImGui, section by section, with the Python and C++ code of each beside it.

More

From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.

Uses: ImGui

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code