Re: document the difference of event and event-after in GtkWidget



On Thu, 4 Nov 2004, Stefan Kost wrote:

hi hi,

it would be nice if someone could please document the event-after signal in
GtkWidget. Especially how it differs from "event".

event-after is emitted after the event was handled.
the signal exists only because signal handlers connected as
"after" handlers to events are not being executed if the event was handled.

I currently try to setup content menus on a GnomeCanvas, where the menus are
different for the canvas items and the canvas itself. I am not managing to test
the signal handlers for the items first and only if they do not handle the
signal, try the canvas handler (connected to "event-after").

event handling with the canvas is somewhat awkward:

- connect to the ::event signal of your items and return TRUE if they handled
  the event.
- to catch unhandled events on canvas items, connect to the ::event signal of
  the canvas->root item.
- to catch events on the canvas background, connect to canvas::event. be aware
  that this is a widget (not a canvas-item) event, so you have to do certain
  things yourself here, like   gnome_canvas_window_to_world (canvas,
                                        event->button.x, event->button.y,
                                        &world_x, &world_y);


Stefan

---
ciaoTJ



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