Guy Rabiller
Guy Rabiller

Reputation: 31

GTK+ Forwarding signals from Widget to Widget?

In GTK+, once I've connected some callback to some widget signals, how can I, from within those callbacks, forward the signal to another widget ?

It seems the signal api does not provide functions with the same arguments as the signal callbacks arguments, so I'm not sure how would I 'forward'a signal directly.

Thanks in advance.

Upvotes: 1

Views: 234

Answers (1)

krokoziabla
krokoziabla

Reputation: 775

I'm not sure if term 'forward' is applicable to glib signal mechanism. In fact it is a notification chain related to an event, the callbacks of the subscribers are called one by one if the event occurs. I think in your case, if you want to forward a signal from A subscriber to B subscriber, forwarding would mean the same if you made subscriber B receive the signal after subscriber A (that is if B had been subscribed after A) if the order was relevant. Or if you need subscriber A to get the result of the callback of subscriber B then you can, for instance, call B's callback from A's callback directly without any GTK+/glib APIs.

Upvotes: 2

Related Questions