Re: passing on signals
- From: edscott wilson garcia <edscott imp mx>
- To: gtk-list gnome org
- Subject: Re: passing on signals
- Date: Thu, 02 Oct 2003 13:38:43 -0500
On Tue, 2003-09-30 at 20:09, edscott wilson garcia wrote:
> Hi,
>
> Does anybody know the correct way to pass on keypressed signals
> received by one widget to another? Either of the following two lines
> causes gtk to segfault when signal received by GtkCombo is passed to
> GtkEntry:
>
> gtk_signal_emit_by_name (GTK_OBJECT (entry),
> "key_press_event",event,data,NULL);
>
> gtk_signal_emit_by_name (GTK_OBJECT (entry),
> "key_press_event",event,data);
If anyone is interested, I figured this one out:
gtk_signal_emit_by_name() is blocking, i.e. it does not return until the
signal has been duly received and processed by the target widget's
signal handler. And the value of "data" is overwritten by the return of
the signal handler (in this case it returns a guint).
This means that you must save whatever you have in "data" to restore it
after the function returns. But the fact that gtk_signal_emit_by_name()
is blocking means that you have to get into the thread business if you
want to make things work as with signal queue. So you are much better
off calling the signal handler of the signalled widget directly. Oh
well...
Edscott
>
>
> TIA,
>
> Edscott Wilson Garcia
>
>
>
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]