This is a follow-up question to this other one.
I am trying to extend gtk.Builder but I found out that once the builder is instantiated one can only call the connect_signals method once: if called more than once, any call after the second will return None (which would mean: all signals have been connected, which is a blatant lie!).
The problem is that in my design I would need to pass around the builder instance to various modules (each of them has some of the handlers for managing the GUI), but this way, I can’t.
I tried to see if I could understand how/where gtk.Builder stores the handler names that assigned withing the Glade GUI, in order to write my own method to overcome this limitation, but after more than an hour of console experiments I still haven’t understand where this information is stored.
Any help or pointer is highly appreciated! 🙂
That
connect_signalsonly works once is an old but undocumented limitation of the GtkBuilder C code. Especially from Python there is no way to access its internals to remedy that.Instead of the builder you could pass around a dictionary. After everyone added their handlers you call
connect_signalswith it.