Event signals are not handled like other signals. See e.g. the gtkmm
tutorial
https://developer.gnome.org/gtkmm-tutorial/stable/sec-xeventsignals.html.en
and, for keyboard event signals,
https://developer.gnome.org/gtkmm-tutorial/stable/chapter-keyboardevents.html.en
Event signals are propagated among the widgets as described in the
tutorial. I'm not sure how much of this applies when the signal is sent
from the application program itself, but from your observations it seems
that the signal propagation starts from a lowest-level widget also in
that situation.
Kjell
Den 2016-06-18 kl. 17:27, skrev Klaus Rudolph:
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'
_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list