Re: canvas event propagation

IMHO The Right Way (TM) is to modify slightly GnomeCanvas code, so if no
item is interested in event, you can pick it from canvas root group. So
you can intall rubberbanding handler to root, and point-and-click handlers
to ordinary items.
Federico promised to add this feature, but I am not sure about the current
state. You can look at canvas-cleanup branch of gnome-libs, to see, what
new directions are being taken.
Meanwhile, if you need rubberbanding, you can recycle gnome-canvas-acetate
item, found at least in gill and sodipodi. This is basically infinite
invisible item, which is used exactly for that purpose.


On Thu, 25 May 2000, Brian Craft wrote:

> The event handler for the GnomeCanvas gets called before any GnomeCanvasItem
> event handlers. The event handlers for items only get called if the GnomeCanvas
> event handler returns false. How is this useful?
> Suppose you want to be able to rubber-band select items on the canvas, and be
> able to point & click select items. If you don't install an event handler for
> the canvas, you never get the rubber-band events. If you *do* install an event
> handler for the canvas, you don't know when the handler gets called whether the
> event should be passed to an item or begin a rubber-band select.
> I don't get it. Shouldn't it be called *last*, when no items have handled the
> event? Like in a window hierarchy?
> b.c.

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