开发者

Connecting signals in GTK+: anonymous way?

开发者 https://www.devze.com 2022-12-16 08:06 出处:网络
After reading \"Using your signals\" I am wondering if it is possible to connect the signals to \"sinks\" in an \"anonymous\" way?

After reading "Using your signals" I am wondering if it is possible to connect the signals to "sinks" in an "anonymous" way?

In order words, if the example following (snippet from reference above):

aCar = Car()
aCar.connect('engine-started', myCallback) 

Is it possible just to connect myCallback to all the si开发者_C百科gnal engine-started sources in one go? Something along the lines of:

gbus.connect('engine-started', myCallback)

Of course gbus here is just an example.


Yes, you can use gobject.add_emission_hook (g_signal_add_emission_hook).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号