TreeView multiple root nodes

About Monkey 2 Forums Monkey 2 Programming Help TreeView multiple root nodes

This topic contains 2 replies, has 2 voices, and was last updated by  Hezkore 1 year, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8255

    Hezkore
    Participant

    Is there a way to have multiple root nodes in a TreeView?
    It seems the project view in Ted2Go manages to do it, but I can’t seem to figure out how.

    Also, is there a way to scroll to a node in the TreeView?

    #8260

    nerobot
    Participant

    Is there a way to have multiple root nodes in a TreeView?

    • Add your “root” items directly to treeview’s RootNode;
    • Set RootNodeVisible=False

    Also, is there a way to scroll to a node in the TreeView?

    For that purpose there is an EnsureVisible() base method (declared in ScrollView).

    In ted2go I improved EnsureVisible – my version expand all parents before try to make visible and grab only Y-scroll.

    Also, I added Selected  property to my TreeViewExt class, and call ensure visible inside of it.

    For more details look at sources: \ Ted2Go \ view \ TreeViewExt.monkey2

    #8273

    Hezkore
    Participant

    You saved the day once again nerobot hehe.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.