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

epost at ...3323... epost at ...3323...
Wed May 28 06:15:45 CEST 2014


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




More information about the User mailing list