Re: DND in TreeView
- From: Deng Xiyue <manphiz gmail com>
- To: gtkmm-list gnome org
- Subject: Re: DND in TreeView
- Date: Wed, 25 Mar 2009 13:02:45 +0800
On Wed, Mar 25, 2009 at 12:20:50AM -0400, José Alburquerque wrote:
> On Wed, 2009-03-25 at 11:34 +0800, Deng Xiyue wrote:
> > I've refined the testcase with output from both insert and delete signal
> > handlers, so that you can see that the delete signal is never called
> > when dragging the last row away.
>
> I don't know what you mean by "dragging the last row away". On this
> system, dragging any row out of the window returns the row back to the
> treeview as if the dragging operation was not valid. No row is really
> added or removed in that case. It just looks like a no-op so no signal
> handlers would be called because no row is modified.
>
Sorry for not being clear. By dragging I'm always referring to DND
happened within the same TreeView.
So, with the given test program, what I'm experiencing is:
1. If I drag the last row in a TreeView to other place within the same
TreeView, no delete signal is emitted, only insert signal got signaled.
2. If I drag any row (that is not the last row) to the last position,
the insert signal always returns the path that evaluates to be row 0,
which is the first row. That way, I cannot distinguish whether the row
is dragged to the first row or the last row. Note that there are some
assertion message when dragging to to last position.
That way, I cannot detect the full operation of a DND in a TreeView,
since I need both the source and the destination row of a DND to perform
the expected action.
> > Still I'd like to know whether it is the supposed way to handle DND in
> > TreeView.
>
> I think the error is in the code inside the signal handlers because the
> modified code I sent you outputs the statements I inserted when *any*
> row is moved anywhere in the treeview (this is true as much for the last
> row as for any other -- at least on this system). . I don't know enough
> about what you're trying to do, but I still think it's in the logic of
> the handlers.
>
My second test program did the same thing, with more information about
what row is processed at the time the signal is emitted, so you can
observe the behavior I mentioned above.
If it is the logic of the delete handler to not get emitted when a last
row is dragged away to other position, and insert handler got asserted
when dragging a row to the last position, then these 2 signals are not
sufficient to handle DND within a TreeView.
> If all else fails, if you do what Jonner already suggested (i.e. write
> parallel C and C++ code to see if there is a difference in behavior),
> you'll probably have better success at finding the bug, if any. You
> should test in C and C++. If the C and C++ code are equivalent and you
> find a difference in behavior then I would say, yes file a bug.
>
By glancing the gtkmm code, one expects no diverted behavior from GTK+.
However I'll try to cook a GTK+ testcase as suggested. But please
comment my post above at the same time :)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]