Events and event handling under the hood

前端 未结 4 678
执念已碎
执念已碎 2021-02-06 09:48

I\'ve just been working through some simple programs using SDL and it made me think back to some Java GUIs I\'ve written.

In the simple SDL programs, I have a loop that

4条回答
  •  长发绾君心
    2021-02-06 10:05

    I'm not familiar with Qt, but in Java basically, yes. In practice it gets more complicated, with modal dialogs and the like, but basically it is getting the events from the underlying OS (for keyboard and mouse) and posting them as events on the EventQueue, and the various components get those events and use and consume them or pass them along as they wish.

    The listener framework allows the component to determine what the event was about and pass the appropriate information about it the appropriate listener.

提交回复
热议问题