Re: [gtkmm] canvas event hierarchy



>In the target table I want to create space at the mouse-position for the
>field (sliding the fields up and down). That should happen while i drag
>the source field around.
>So at least the target table should get events ?

no, the item you are dragging is the one that gets the events. if its
handlers do not return TRUE, then the event is propagated but only
through the parental heirarchy, not across item groups.

>Of course I could keep track of all fields and their coordinates and do
>some own kind of 'event' handling but that sounds dowdy.

no, its not a full event handling system. the code you have to write
is just part of the motion_notify_event and button_press_event
handlers (which you have to write anyway). my code has a core function
that returns the relevant object given a certain coordinate. in both
of the event handlers, i call this function, and then proceed with
various actions depending on the item that the event is in. my stuff
is dragging visual representations of regions of audio files around:
they can be dropped in some places, but not in others. i also have
"sticky" motion, so that when you cross an area in which dropping is
not possible, the item stays where it is. lots more too. just write
the item lookup code, and you'll be all set.

--p




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