Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    12

    Need help in clearing a tree

    Zip = File.Find("\\\\share\\folder", "*.*", true, false, ShowSearchProgress, nil);
    if Zip then
    for i,v in Zip do
    tbSplit = String.SplitPath(v);
    name = tbSplit.Filename
    tblNodeData = {};
    tblNodeData.Text = name;
    tblNodeData.Data = v;
    Tree.InsertNode("Tree1", "3", tblNodeData);
    end
    end
    end

    How do I clear the tree once it is populated?

  2. #2
    Join Date
    Mar 2007
    Location
    HeaveN
    Posts
    534
    hope this helps u...

    Code:
    	Tree.SetEnabled("Tree1", false);
    	result = Tree.RemoveNode("Tree1", "1", nil);
    	result = Tree.RemoveNode("Tree1", "2", nil);
    	result = Tree.RemoveNode("Tree1", "3", nil);
    	result = Tree.RemoveNode("Tree1", "4", nil);
    	result = Tree.RemoveNode("Tree1", "5", nil);
    	result = Tree.RemoveNode("Tree1", "6", nil);
    	result = Tree.RemoveNode("Tree1", "7", nil);
    	result = Tree.RemoveNode("Tree1", "8", nil);
    	result = Tree.RemoveNode("Tree1", "9", nil);
    	result = Tree.RemoveNode("Tree1", "10", nil);
    	result = Tree.RemoveNode("Tree1", "11", nil);
    	Tree.SetEnabled("Tree1", true);

  3. #3
    Join Date
    Oct 2005
    Posts
    12
    Thanks! It work great!!!!

  4. #4
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Or then again, you could always do:

    Code:
    Count = 0
    Entries = 1337
    
    repeat
    	Count = Count + 1
    	Tree.RemoveNode("Tree1", Count, nil);
    until Count == Entries
    Just change Tree1 to whatever it is called and the entries to remove.

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    no need for a loop, remove all nodes from a tree by useing index of "0"

    Code:
    Tree.RemoveNode("Tree1", "0");
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. Problem jumping pages using a Tree
    By tibirix in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 05-05-2009, 03:06 AM
  2. Tree flicker issue
    By Animl in forum AutoPlay Media Studio 7.5
    Replies: 0
    Last Post: 03-16-2008, 11:15 PM
  3. Tree (Inheritance)
    By CHGM in forum AutoPlay Media Studio 7.5
    Replies: 0
    Last Post: 01-03-2008, 07:27 AM
  4. Tree Object+DataGrid PageJunp Issue
    By pakapaka in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 09-11-2007, 10:02 AM
  5. How do I clear a tree?
    By Teraka in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 03-19-2007, 12:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts