-
Notifications
You must be signed in to change notification settings - Fork 63
Events
When certain things happen in the GUI, events are fired which you can react to.
There are a lot of events, for example mouse clicks, mouse moves, key presses and many more. Many of them lead to actions in SFGUI. For example, when the user clicks on a button, a certain action shall take place.
For this to work, SFGUI has a well-defined event handling mechanism, which is also very easy to understand:
Events are sent to the whole widget hierarchy. Containers give every event to their children, and leaf widgets get all events.
One exception is containers that are invisible. They will not propagate events to children.
If you're working with really huge widget hierarchies (like 100+ widgets, which is very uncommon), then a lot of calls are made into the hierarchy to hand events over to all children. However, don't be afraid: Even when tons of mouse move events are racing through the hierarchy, FPS will be all good.
But please keep in mind that this is not a free ticket for overcrowded user interfaces...
SFGUI uses SFML's event structure. That means you can directly give SFML events to SFGUI widgets.
This might change in the future!