Events and Callbacks
IUP is a graphic-interface library, so most of the time it waits for an event to occur, such as a button click or a mouse leaving a window. The application can inform IUP which callback to be called, informing that en event has taken place. So events are handled through callbacks. And callbacks are just functions that the application register in IUP.
The events are processed only when IUP has the control of the application. After the application create and show a dialog it must return the control to IUP so it can process incoming events. This is done in the IUP main event loop. And it is usually done once at the application "main" function. One exception is the display of modal dialogs. This dialog will have its own event loop and the previous shown dialogs will stop receiving events until the modal dialog returns.