I wrote a widget with a property to set image file to show.
I don't want to save pixels data of image in stack. Instead, I just save the path information of the image file.
So after load stack, the widget need to check if the file exists.
Now I use " execute script "return there is a file" " to check file path.
But OnLoad(), OnAttach(), OnPaint() all can't use script object to execute script.
So anyone have other suggestions to check file path after load widget ( after open stack).
Check file exist after load stack.
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: Check file exist after load stack.
Hi Marken,
You could do such a thing in the widget's OnOpen handler.
You could do such a thing in the widget's OnOpen handler.
-
- Livecode Staff Member
- Posts: 192
- Joined: Thu Apr 18, 2013 2:48 pm
Re: Check file exist after load stack.
Alternatively you could use LCB's the entries of directory <directory> operator to check if the file exists.
Re: Check file exist after load stack.
good, I never test OnOpen() handler. Thank you.livecodeali wrote:Hi Marken,
You could do such a thing in the widget's OnOpen handler.
Re: Check file exist after load stack.
the entries of directory will crash with some path at Windows platform. Other other hand, if the <directory> does not exist and what will happen?livecodeali wrote:Alternatively you could use LCB's the entries of directory <directory> operator to check if the file exists.
Thank you for your information.