Page 1 of 1


Posted: Wed Feb 23, 2011 1:39 am
by r_houdek
I'm trying to use the simple sourcePath example:

on nodeUp theButton theNodeID
get the sourecPath_of_node_ID_[theNodeID] of me
end nodeUp

...but keep getting an empty string back. A couple of questions:

- Should this return a value or does it have to set?
- Does this only work on treeType "filesystem"



Re: sourcePath

Posted: Wed Feb 23, 2011 3:42 am
by wilstrand
Hi Ritch!

Thanks for good observations!

I see two issues here. First there is a typo in the code example. It says "sourecPath" which of course should be "sourcePath". I checked the rTree documentation and it has the typo, so I presume you copied the example from the documentation and got the typo from there! I am sorry for the inconvenience this has caused! I have corrected the documentation and an rTree version 1.2 will be available at during this week.

Secondly you are right in assuming that the treeType property has to be set to "filesystem" for the sourcePath to work. It works like this:

* the sourcePath property of any Node can be set to any value, through the Property Inspector or by script.
* the sourcePath property of the nodes are set automatically if the treeType is "filesystem"
* the sourcePath property of a node is also set automatically if a file or folder is dragged from Windows Explorer (if you are on Windows) and dropped into rTree.
* if the treeType is "filesystem", the sourcePath of a node will bind that node to the corresponding data source of the filesystem that the sourcePath points to.

Please let me know if this explained the sourcePath and if you got it working! It is poorly documented and I will update in the coming version.

Kind regards


Re: sourcePath

Posted: Thu Feb 24, 2011 3:08 am
by r_houdek
Thanks Mats! Your response answered my questions perfectly (although I'm embarrassed I missed the typo).