Re: g_signal_emit()



dhk wrote:
I have two callback functions. The first for when a cell in a treeview gets edited and the second for when the tab key is pressed. The first works fine. In the second, I want to emit the "edited" signal so it acts as if the first event happened. However, the g_signal_emit() in the "key-press-event" callback does not seem to work.

I am doing the following and the renderer and sig_id are valid.

sig_id=g_signal_lookup("edited", G_OBJECT_TYPE(renderer));
g_signal_emit(renderer, sig_id, 0);

When I get to the g_signal_emit() call I get the following error.
g_signal_emit(renderer, sig_id, 0);
Program received signal SIGSEGV, Segmentation fault.
0x00007f712d797ad0 in strlen () from /lib/libc.so.6

The backtrace from gdb is:
#0  0x00007f712d797ad0 in strlen () from /lib/libc.so.6
#1  0x00007f712ddfbd03 in g_strdup () from /usr/lib/libglib-2.0.so.0
#2  0x00007f712e4b7dc8 in ?? () from /usr/lib/libgobject-2.0.so.0
#3  0x00007f712e4a4897 in g_signal_emit_valist ()
   from /usr/lib/libgobject-2.0.so.0
#4 0x00007f712e4a4db3 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0



If I use g_signal_emit_by_name() I get the following error in gdb.

g_signal_emit_by_name(G_OBJECT(renderer), "edited::cellEditedCb");
  or
g_signal_emit_by_name(G_OBJECT(renderer), "edited::0");

WARNING gsignal.c:2140: signal id `193' does not support detail (1256)

All I'm trying to do is have the "key-press-event" act like the "edited" event when the tab key is pressed.

How can this be done?

Thanks,

dave
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


In short what I'm trying to do is emit the "edited" event when the "key-press-event" occurs. That way when the use tabs off the cell in the treeview the callback for the "edited" event is called. It doesn't make sense the if there are two way to leave a cell (tabbing off it or clicking outside of it) that you can't call the same event.

Any ideas?

Thanks,
dave



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