Bill,

I don't see anything in the handler that should require a wait, if that's all that is going on. Is the map still loading while you're trying to get the snapshot? Any pending messages? Even so it doesn't make sense, because once a handler triggers it should run to completion. Normally any pending messages will be suspended until the handler finishes, but the waits in this one will allow them to process. Then when the pending activity is done, the original handler picks up where it left off. But maybe that's not happening, or maybe the background activity is exiting to top.

Anyway, I'd look for background activity. An error in another script that runs during the wait may be causing all scripts to abort.

I can't think why you'd need to add the wait in the first place though. If you remove all waits from your test stack, does it still work there?

On 5/4/14, 10:21 PM, proth...@earthednet.org wrote:

Jacqueline:
Thanks for responding. I can’t reproduce the problem with my test stack,
which works fine. My actual application is more complicated, and has a
fairly large map image. So, I’m wondering if that might be the cause and
I’ll have to make some tests. RC3 worked initially, but began failing
intermittently after a few seconds using the app. Incidentally, unless I
put a “wait 0.1 seconds with messages” before the snapshot command,
neither 6.6 or 6.6.2RC3 works. I tried the try/catch (no errors thrown(
and putting the result, which always returns a rect of the capture
region, it seems.

The code I use for my application is:

on copyMapToSnap
    put the name of me into thisImage
    set the visible of thisImage to FALSE
    wait for 0.1 seconds with messages
    --wait for 1 seconds with messages
    put the rect of this stack into stackRect
    put rectLeft(stackRect)&","&rectTop(stackRect) into theOffset
--this is the point at the topleft of the stack window
    put the rect of graphic "MapBox" into theRect  --This is relative to
the stack
    put offsetRect(theRect,theOffset) into snapRect--offset the capture
rect to absolute screen coordinates
    put adjustSizeOfRect(snapRect,1,1,-1,-1) into snapRect  --remove
border of grahics box
    --wait for 0.1 seconds with messages
    --wait for 1 seconds --with messages
    --try
       export snapshot from rect  snapRect to image "mapSnap"
    --catch theError
       --answer theError
  -- end try
    put the result
    --wait for 0.1 seconds with messages
    --wait for 1.1 seconds
    put adjustSizeOfRect(theRect,1,1,-1,-1) into snapRect  --theRect is
relative to the stack
    set the rect of image "mapSnap" to snapRect  --now set the captured
rect to the mapbox rect
    wait for 0 seconds with messages
    set the visible of thisImage to TRUE
end copyMapToSnap

In the absence of ideas from this list, I’m going to try adding some
complexity to the test stack and see if I can find what causes the failure.

Best,
Bill

Prothero William
waproth...@gmail.com


--
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

Reply via email to