Re: Reparent tree iter

Hey Kristian,

Thanks for the answer. The problem with the "cursor-move" event is that I was re-parenting
the row to the same "father" when the user clicked on it. This, obviously, "canceled" the
selection, because the original row which was clicked is now replaced by the copy.

Ian L.

On Sun, Aug 16, 2009 at 4:23 PM, Kristian Rietveld <kris gtk org> wrote:

On Sun, Aug 9, 2009 at 2:18 PM, Ian Liu<ian liu88 gmail com> wrote:
> I have a GtkTreeStore and I wanted to re-parent a leaf iterator.
> I asked on the #irc but I was told to fetch all data, append it on the
> correct parent and remove the first one. But I'm having some problems
> with the cursor-move event when doing this (obviously because the original
> selected iter is gone).
> I'm wondering if there is a way to re-parent an iter without destroying it.

As you have probably seen there are functions to reorder, swap or move
iterators in the same level.  There is no such functionality for moves
to different levels (re-parenting).  What you have been advised on the
IRC channel seems the easiest way for now.  (This is also how tree
view implements the drag and drop of a row to a difference place in
the tree).

What is the problem you are having with the "cursor-move" event?  Did
you mean the move-cursor event?



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