Define event multiple times

What happen if define clicked event to Button twice - will new event appended to existing clicked event listener (of this widget) or just replacing with new one?

Hi @d47081, are you using language bindings like gtkmm, gtk-rs, pygobject, etc? For C, g_signal_connect() appends a signal handler to a list.

1 Like

You don’t “define” clicked events. You either connect to the GtkButton::clicked signal, in which case: yes, multiple connections will be invoked in order; or you are subclassing GtkButton and overriding the clicked virtual function that acts as the class handler for the GtkButton::clicked signal, in which case you can only do that once.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.