Page 1 of 1

Running scripts when changing cards

Posted: Mon Jul 17, 2017 9:06 am
by ittarter
Hi all,

I'm noticing a problem. When users behave, ahem, faster than I anticipated, for example leaving a card when things are still happening, errors happen. Scripts are running but I've not identified objects by what card/stack they're on. So the handlers continue to run but now they cause errors because object x doesn't exist on the card that the user has now moved to.

Users have buttons they can click to move to another card. I was wondering if it would be possible to either
a. create a condition where they would not not go to another card before the running scripts had a chance to finish;
b. cancel/abort ALL running handlers before sending the message to open a different card

Any advice for me? Thanks!

Re: Running scripts when changing cards

Posted: Mon Jul 17, 2017 10:25 am
by jmburnod
Hi,
There is many way to prevent that:
1. set the lockmessages to false at the top of your running message and false at the end
2. Hide btn goNextCd at the start of your running message and show it at the end
3.Disable and set blendlevel to 40 of btn goNextCd at the start of your running message and enable it and set blendlevel to 0 of it at the end
... Sure there is other ways and the question will be "what is the best for your context

Best regards
Jean-Marc

Re: Running scripts when changing cards

Posted: Mon Jul 17, 2017 4:55 pm
by dunbarx
What Jean-Marc said.

I would never allow the user to abort a handler before it was finished, unless that was part of the original plan. I vote to disable rather than hide. It gives the user feedback to keep his hands to himself.

Craig Newman

Re: Running scripts when changing cards

Posted: Mon Jul 17, 2017 5:37 pm
by ittarter
So far, the disable option sounds the most promising.

I could even have a standard bit of code where, if the cursor is set to watch, buttons become unresponsive. And then just set the cursor to watch/arrow at the start/end of each handler. Does that sound like a decent solution? It gives the user "hands to himself" feedback without constantly changing the look of the card.

Re: Running scripts when changing cards

Posted: Mon Jul 17, 2017 6:17 pm
by dunbarx
Cursor feedback is both comforting and informative. I don't know about several different styles of cursor, though, as this may be overkill. Keep it to a single additional "wait" cursor of your choice. Know that images of any kind may be employed, so you are not limited to watches and pointers.

Craig

Re: Running scripts when changing cards

Posted: Tue Jul 18, 2017 11:34 pm
by ittarter
I meant just two style of cursor. Watch means wait, arrow means do what you want. Those are the only ones I'm familiar with. I'm sure there's a list somewhere but I'm happy with those two.

Re: Running scripts when changing cards

Posted: Wed Jul 19, 2017 1:25 am
by bogs
There is actually a list in the dictionary, under 'Cursor' -
Image