[Gambas-user] BUG with the TreeView's new .item.Reparent()

Fabien Bodard gambas.fr at ...626...
Wed May 28 07:28:02 CEST 2014


If i understand well the error you must to add an void item before reparent
ant then remove the void item. So the child parent become a parent node
before the move
Le 28 mai 2014 06:16, <epost at ...3323...> a écrit :

> OK! I meant node insted of key then :)
>
> But, I think you misunderstood. Let me illustrate:
>
> Fred123
>    ==> Fred124
>    ==> Fred124
>
> All these have unique keys, but if I want to reparent one of the Fred124
> to be
> a child of the other, I get the aforementioned error. However, if I rename
> Fred124 to Fred125, I am now allowed to reparent it to the other Fred124.
> Again, these are the names, not the keys, and to my understanding every
> node
> could have the exact same name/title/text and it shouldn't interfer with
> reparenting as long as you do not do something silly like trying to put a
> parent node into one of its child nodes.
>
> Hope that made it a bit clearer :)
>
> The final result should look like this:
>
> Fred123
>    ==> Fred124
>        ==> Fred124
>
> - Erik
>
> Onsdag 28. mai 2014 12.42.59 skrev du:
> > On Wed, 28 May 2014 03:36:02 +0200
> >
> > epost at ...3323... wrote:
> > > In TreeView, if you reparent a key to be a child of a key that has the
> > > same
> > > name as the key you want to reparent, there's an error message saying:
> > > "New
> > > parent can not be a child item". Renaming the item I want to reparent
> > > avoids the bug...
> > >
> > > - Erik
> >
> > Erik,
> > I am afraid that this doesn't make a great deal of sense to me.  It
> sounds
> > like you are trying to reparent a tree node as a child of itself? Are we
> > having translation problems here?
> >
> > - "if you reparent a key" No, we reparent a node (which has a unique key
> > across the whole tree). So, if we presume you want to "move" a node
> > identified by the key "FRED1234" which currently has a parent-key of
> > "MARY2468" ...
> >
> > - "to be a child of a key" Again, have to presume you mean move
> > node["FRED1234"] to be a child of node["some_key"]
> >
> > - "that has the same name as the key you want to reparent" sounds like
> you
> > want to move node["FRED1234"] to be a child of node["FRED1234"]
> >
> > - If "New parent can not be a child item" is really the error you get,
> then
> > I can understand the confusion, a better message would be "A node cannot
> be
> > reparented to be a child of itself".
> >
> > But I really don't understand the bit about " Renaming the item ...
> avoids
> > the bug"?
> >
> > or have I missed the entire point (which is possible :-) )
> >
> > bruce
> ga
>
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list