Re: images and path names

2012-09-03 Thread J. Landman Gay

On 9/2/12 9:24 PM, Timothy Miller wrote:

If I set the source of an image in its inspector by clicking on the
little file icon and selecting the file from the dialog box, the
source field in the inspector shows ./test.image.jpg

Same thing happens with File menu: New referenced control: Image
file...

Yet if I write a script:

import paint from file ./test.image.jpg

I get an error, presumably because the path name of the image is
incorrect.


It's Unix file paths. The dot means this folder. The IDE is creating a 
path relative to the stack file.


If you set the defaultfolder to the one holding your stack, the relative 
path import should work.




On the other hand, the script:

import paint from file /users/Daddy/Documents/Rev Documents/project
images/test.image.jpg

does work.


Full filepaths always work.



Yet, if I paste

/users/Daddy/Documents/Rev Documents/project images/test.image.jpg

Into the source field of the inspector for an image, the image
doesn't display.


The IDE is trying to help by making whatever you paste into a relative 
file path. It's looking for a folder inside the stack's folder named 
users/etc. Generally this is okay because it allows you to move the 
enclosing stack folder from one place to another without breaking the paths.


I think if you turn on the Files  Memory preference that uses 
absolute file paths, pasting the full path into the inspector will work 
and you'll also see full file paths when you choose a file from within 
the inspector.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


images and path names

2012-09-02 Thread Timothy Miller
If I set the source of an image in its inspector by clicking on the little 
file icon and selecting the file from the dialog box, the source field in the 
inspector shows ./test.image.jpg

Same thing happens with File menu: New referenced control: Image file...

Yet if I write a script:

import paint from file ./test.image.jpg

I get an error, presumably because the path name of the image is incorrect.

On the other hand, the script:

import paint from file /users/Daddy/Documents/Rev Documents/project 
images/test.image.jpg

does work.

Yet, if I paste

/users/Daddy/Documents/Rev Documents/project images/test.image.jpg

Into the source field of the inspector for an image, the image doesn't 
display.

This seems inconsistent. I don't get it. Is there a simple explanation?

Thanks in advance,

Tim
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode