I have the following code in the DoubleClick event of a listbox.
var theItem as FolderItem
theItem = new FolderItem(me.SelectedRowValue, FolderItem.PathModes.Native)
theItem.parent.Open
The string in me.SelectedRowValue is a path to a file. The path is a correct native path.
When I run the code, however, the constructed FolderItem theItem is created with a path that appears to be relative to the application. In other words the path of the created folderItem is the path to the application, plus a space, plus the native path to the file.
Like this: /Users/JohnDoe/Documents/Tools/Xojo Projects/ /Users/JohnDoe/Documents/Tools/DATA_SETS/Files/test-file.jpg
Why might that be? I’ve done this before but I’ve never seen this behavior.
What am I overlooking?
That was the explanation for this effect I was searching for! Thanks much cause it drove me nuts. I was working around but somehow I believed that I made it wrong somehow! Made my day
This is what I thought it might be. Did you know you can store the actual FolderItem in RowTag or CellTag? It’s much easier to pass the object around than the string. I am curious where the extra space comes from though.
@Tim_Parnell yeah, it was that extra space at the beginning of the string.
I am getting the path string by parsing the results of terminal utilities output. I failed to notice that there was a space at the beginning of thee result.