Canvas: Detecting Enter/Leave of an item while dragging another ...


I'm attempting to write a canvas application that allows the user to
create connections between items by dragging from one to the other.
While they're dragging a line extends from the first and follows the
mouse until dragged over the second item, then it snaps to that item's
connection point.

At least that's the idea.  Unfortunately, while dragging the line the
destination item doesn't receive the GDK_ENTER_NOTIFY event, so I
never know when the rollover occurs.

The sequence I'm using looks like this:

        Item 'A' gets GDK_BUTTON_PRESS event.
        'A' creates line item, starting at its connection point.
        'A' does gnome_canvas_item_grab on the line item, passing
          control to it.
        Line starts processing motion events, following the mouse with
          the line end.

The line item now gets all events until the button is released, so I
can't detect when it passes over.  Is there a way I can detect the
rollover or am I going about this the wrong way?


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