Hello,
I’m developing a GTK3 application on Linux for rich, interactive business software.
Our goal is to track almost every interaction a user performs on our UI elements(widgets). From my current understanding, this means registering signals using g_signal_connect().
Here’s my concern:
The UI contains many elements (top bar menus, headers, side menu, bottom bar, main content area, etc.).
For each widget, we may want to capture all possible interactions.
For example, with a GtkButton, we might connect to signals like:
clicked, pressed, released, activate, enter-notify-event, leave-notify-event, button-press-event, button-release-event, motion-notify-event, key-press-event, key-release-event, focus-in-event, focus-out-event, etc.
If the app has ~500 buttons, and I want to register ~15–20 signals per button, that means making 7,500–10,000 g_signal_connect() calls.
My question:
- Is this really the expected/normal way to handle events at scale in GTK (connecting signals individually per widget and per event)?
- Or is there a more centralized or efficient mechanism for handling interaction events across many widgets?
Thanks.