3 ms·
You don't have to 'install' event handlers, there are no event objects, and there's no event loop like: while (uiEvent = uiGetNextEvent()) { uiHand
by flohofwoe 3y ago
You don't have to 'install' event handlers, there are no event objects, and there's no event loop like:
while (uiEvent = uiGetNextEvent()) {
uiHandleEvent(uiEvent);
}
...and it would never enter my mind to call this an 'event handler':
if (Button("Click Me!")) {
printf("Button Clicked!");
}
One very nice side effect of this immediate mode style code is that it 'runs on a linear timeline', e.g. you can step through the code in a debugger without having to put breakpoints inside 'event handlers'.
How all this is implemented inside the immediate mode UI framework isn't relevant. The 'immediate mode idea' is only about the user-facing code which describes the UI, not the internal implementation (those can vastly differ, and could even manage a 'retained mode' widget tree under the hood).