sourcePath

This is a forum focused on providing support for rTree

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
r_houdek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Wed Feb 23, 2011 1:35 am

sourcePath

Post by r_houdek » Wed Feb 23, 2011 1:39 am

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"

Thanks!

Ritch

wilstrand
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Mon Jan 03, 2011 3:02 pm
Contact:

Re: sourcePath

Post by wilstrand » Wed Feb 23, 2011 3:42 am

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 http://www.tapirsoft.com 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

Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects

r_houdek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Wed Feb 23, 2011 1:35 am

Re: sourcePath

Post by r_houdek » Thu Feb 24, 2011 3:08 am

Thanks Mats! Your response answered my questions perfectly (although I'm embarrassed I missed the typo).

Ritch

Locked

Return to “rTree”