Re: Drag'n'drop problems



Thanks, Jeffrey, but:

On Mon, 08 Sep 2008 08:19:42 -0600
Jeffrey Barish <jeff_barish earthlink net> wrote:

The first argument only has to match the first argument of the source.

This does not seem to be true. If I replace

  {"GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_APP, 0} // This works

by, eg.:

  {"STRING", GTK_TARGET_SAME_APP, 0}            // Doesn't work

So the string _is_ interpreted somewhere (outside of my program, that is).
To be specific, the drag seems to work, but drop doesn't - no event is
generated in the second case. BTW, it's not just "STRING". I tried with
several other things, like "xml_node_pointer" (which described what I was
doing), but that didn't work either. 

There is some information in this tutorial:

http://scentric.net/tutorial/sec-dnd.html#sec-dnd-selected-item-info

I had found this tutorial, but was somewhat concerned about the '***needs
revision***' statement, and also, it uses the lowest level of interface,
using x and y coordinates. I tried some versions of this, but couldn't
get it to work. Thinking back now, the problem might have been with the
Target string.

There is also some good information in:

http://www.pygtk.org/pygtk2tutorial/sec-TreeViewDragAndDrop.html

There's a C version of this Python tutorial somewhere (I've downloaded
the C code, but lost the URL). It works well, but only drops are shown,
and then only simple strings. I do commend the python guys though - I'm
tempted to switch to Python just for the better docs.


The problem I'm now stuck with is what to do with the path I receive in
data_received (the destination path). I made a simple (destination) tree,
and get 'drop possibles' like this:

-------------------------> Ok
"Main item"--------------> Ok
-------------------------> No
  -----------------------> Ok
  "Subitem 1"------------> No
  -----------------------> Ok
  "Subitem 2"------------> No

BUT, if I convert those paths into iters, and set some data, I'm
destroying the next existing item. Do I have to insert an item before the
path/iter? I'll try that next. It wouldn't explain why I get a 'possible'
on "Main item" though.

Thanks for the hints, Jeff...
John



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