blocking "event"-signal for canvas when handled by item
- From: Stefan Kost <kost imn htwk-leipzig de>
- To: gtk-app-devel-list gnome org
- Subject: blocking "event"-signal for canvas when handled by item
- Date: Tue, 09 Nov 2004 13:58:53 +0100
hi hi,
I have a gnome-canvas with several items on. these items are derived from
gnome-canvas-item and handle the "event" signal themselfs. One thing that they
do there is opening a popup-menu on mouse-clicks. That works so far.
When right clicking on the canvas background I also would like to open a context
menu. I therefore tried 4 variants:
// connecting the canvas to "event" causes the canvas not to draw !?!
g_signal_connect(G_OBJECT(self->priv->canvas),"event",G_CALLBACK(on_canvas_item_event),(gpointer)self);
// that seems to be invalid
g_signal_connect(G_OBJECT(gnome_canvas_root(self->priv->canvas)),"event-after",G_CALLBACK(on_canvas_item_event),(gpointer)self);
// that does nothing at all
g_signal_connect(G_OBJECT(gnome_canvas_root(self->priv->canvas)),"event",G_CALLBACK(on_canvas_item_event),(gpointer)self);
// this causes both menus to apprear, when clicking on a canvas item
g_signal_connect(G_OBJECT(self->priv->canvas),"event-after",G_CALLBACK(on_canvas_item_event),(gpointer)self);
The event-routines of the canvas-items return TRUE if the have already handled
the signal. I thought that would avoid the "event-after" as beeing submitted.
I also tried to stop the emmision of the "event-after" signal for the canvas, in
case I have handled the event aready, but that fails too.
Any ideas for how to properly do it?
Stefan
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]