Re: Gnome Canvas and crossing events

Michael Welsh Duggan <md5i cs cmu edu> writes:

> I have recently been bitten by the way crossing events are handled in
> the gnome canvas.  If I have a canvas group made up of several items,
> and I attach an event handler to the group, it will receive the
> enter/leave notifications not just for the group, but all of its
> subitems as well.
> This in and of itself may or may not be considered correct behavior.
> After looking at things a little closer, I think that this could very
> well be considered correct, but only if the detail specified a
> semanticaly correct GdkNotifyType.  Currently, it will always reply

After thinking about it a bit longer, I am no longer convinced that my
above solution would actually improve anything.  In fact, I am certain
that it would not.

The root of the problem is that we are using GDK events (for use with
windows) to simulate events for items that are most definitely not
windows.  In order to achieve what I really want, I would need the
window and subwindow parts of the event to point to the appropriate
canvas items, rather than (in this case) the canvas iteself, and
nothing for the subwindow.  But the window and subwindow fields are
GdkWindows, and GnomeCanvasItems are definitely *not*.

Now, we could just cast window and subwindow to GnomeCanvasItems, and
make developers aware that they have to recast these in canvas item
event handlers, but this smacks of being a little unsound, from a
type-safety point of view.  But maybe this could be considerd
acceptable.  Any ideas?

Michael Welsh Duggan
(md5i cs cmu edu)

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