You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seif Sallam edited this page Aug 12, 2022
·
2 revisions
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.
Spam?
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...
Hey SFML
SFGUI uses SFML's event structure. That means you can directly give SFML events
to SFGUI widgets.