Thinking in Immediate: ImGUI

By Zhihao Yuan

When programming graphical user interfaces, sometimes we might think, "Ah, I wish to have an event listener that triggers when this data member changes!" Before laughing at yourself, adding getters and setters everywhere so that you can emit a signal whenever you want, I want to tell you, your naive thought is actually the right way of thinking about that program.

If you have data, the GUI should follow the data. Data change GUI change. Two widgets use that data, two widgets change at the same time. That is, Immediate Mode GUI. This talk will introduce immediate mode GUI programming with pyimgui, a Python library that pushes the elegance of the Dear ImGUI library in C++ to a new boundary. This time, let’s think in immediate, think functional, express your program with no callbacks, and bring back the joy of programming.