On MS-DOS your application owned the machine when it was running, so most graphical applications controlled the rendering loop and explicitly checked the state of each widget, keyboard and mouse buttons.
A bit like the SDL event loop works, but extended to widgets as well.