Receiving signals, modify and send again to the SAME handler
- From: Klaus Rudolph <lts-rudolph gmx de>
- To: gtkmm-list gnome org
- Subject: Receiving signals, modify and send again to the SAME handler
- Date: Sat, 18 Jun 2016 17:27:23 +0200
I have a signal handler which successfully receives signals.
In this handler I want generate modified signals and send them to the
object, so that the *same* handler will receive this new generated
signals again.
I have the following code fragments:
win = new Gtk::Window;
m_canvas = new Goocanvas::Canvas;
sigc::connection conn_t1 = m_canvas->signal_event().connect(
sigc::ptr_fun( &AnyEvent));
sigc::connection conn_t2 = win->signal_event().connect( sigc::ptr_fun(
&WinHandler));
Now I also register an IdleHandler which emmits signals which I
generated before:
Glib::signal_idle().connect( sigc::mem_fun( *this, &IdleSendEvent::Do));
What I want to achieve: The handler of the canvas should receive an
event and should generate a new one and this one should send to the
canvas object, so that it will call again the handler of the
m_canvas->signal_event().
In other words: Indirectly via the Idle Handler the signal should be
send to the sending object itself.
But if I fire to
g_signal_emit_by_name (m_canvas->gobj(), "button-press-event", event,
&return_val);
the signal is not received in the canvas handler itself, but in some
child objects there.
Q: How to emit again to the canvas? Is there something like
"get_the_parent_signal_object_handler_father_receiver" or something strange?
I did a lot of gtk_widget_get_parent_window() but all results in runtime
errors like:
(go:15430): GLib-GObject-WARNING **: gsignal.c:3484: signal name
'button-press-event' is invalid for instance '0x9afbc48' of type
'GdkX11Window'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]