Search code examples
delphilazarusvirtualtreeviewtvirtualstringtree

How to add TObject to PVirtualNode.Data of TVirtualStringTree.Root node


That is my question.

How I can put object to root node of tree? I know about addChild function, but it's for sub-nodes of root node. I need put data into root node.


Solution

  • The solution is simple:

    TVirtualStringTree.AddChild(nil,TMyObject) ...
    

    nil are equal to root node.