Re: Drag'n'drop problems



On Mon, 08 Sep 2008 11:03:39 -0600
Jeffrey Barish <jeff_barish earthlink net> wrote:

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.

I was going to tell you that you are crazy, but when I tried putting
GTK_TREE_MODEL_ROW in my program in place of the arbitrary string that I
was using, I found that the behavior of my program changed to something
bizarre (I get too many signals).  So I am forced to agree that
GTK_TREE_MODEL_ROW is interpreted somewhere.  It's news to me.  I have
always used an arbitrary string that matches in the source and
destination specifications.

Thanks for that test - it does eliminate fears of other problems in my
program... In my case it was simple - with anything but
GTK_TREE_MODEL_ROW the drop callbacks are _not_ called at all. The
question is (for me, at least): where is the list of predefined values?

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.

The PyGTK FAQ has some hints:

http://faq.pygtk.org/index.py?req=show&file=faq13.030.htp

Ok - that example doesn't use DnD, it directly pushes a row up or down,
but maybe it clears up some things about the insertion. Also, as far as I
can understand it, it works only for GtkListStores, not for TreeStores.

Maybe I have to go back to the lower level interface (the one with the x
and y coordinates).

Thanks again,
John



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