Re: How do I connect one signal to another?




Damien Miller <djm@mindrot.org> writes:

> Hi,
> 
> How do I connect one signal to another? Specifically how do I 
> connect the "activated" signal of a text entry widget to a "clicked"
> handler of a button on the parent dialog?

You can't connect one signal to another, but you can
connect a signal to a function that emits another signal.
Since the other signal is emitted on a different object,
you want to use gtk_signal_connect_object, so that the
data you pass in is used as the first parameter to the
handler:

 gtk_signal_connect_object (GTK_OBJECT (entry), "activate",
                            GTK_SIGNAL_FUNC (gtk_button_clicked),
                            GTK_OBJECT (button));

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]