Drag'n'drop problems



Hello people.

I was playing around with the idea of a specialized editor with a
facility to drop macros into the a structure tree, using DnD.
This would boil down to DnD between two TreeViews.

Preliminary research showed a confusion of information on the net, which
I categorized into (at least) 3 methods: 

- really low level DnD at widget level,
- Higher level DnD at TreeView level,
- High level DnD at TreeModel level.

All tree involve (unless I'm very mistaken) defining Target lists which
have an 'ascii' format description, flags, and a numeric type (more or
less corresponding to the format). I couldn't find a list of valid format
descriptions. Can anyone point me in the right direction?

I've done the following:

- 2 GtkTreeStores with separate Views (in the same app),
- One of them designated as drag_source, and with srci->drag_data_get
and srci->row_draggable assigned handlers for those events.
- The other TreeStore designated as drag_dest, and with
desti->row_drop_possible and desti->drag_data_received assigned handlers
for these events.
- Both are defined with the same GtkTarget[] list.

What happens: The drag starts (draggable and data_get are called), but no
signal is emitted in the destination widget. The only sign of recognition
in the destination are the selection effects when hovering (the line
above/below/around the target line) with the dragged object. 

In particular, 'drop_possible' is never called.

I've been at this for a couple of days, and with the different methods
available it is very difficult to find a simple and clear example.

Help!
John



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