This works as expected now, Allin. So far at least, I haven't been able to provoke a
crash. Pushing the stop button generates a "Execution aborted by request"
message.
FYI, I discovered this while trying to make sense of what I thought was extremely weird
behavior by Gretl. After starting a time-consuming script, it looked to me like nothing
was happening (the script output window didn't appear). I'd try starting it again
(both from the gui and ctrl-r), and would get errors that didn't make any sense to me.
For example, something like "parse error" for the '/*' sequence at the
beginning of a comment block (with matching '*/'), or "missing endif" at
locations where the 'endif' was in fact there. Eventually I waited long enough for
the script to finish, at which point I realized that it'd been running in the
background just fine. I guess the errors were a consequence of trying to run 2 copies of
the script at the same time.
Many thanks as always!
PS
-----Original Message-----
From: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] On
Behalf Of Allin Cottrell
Sent: Tuesday, December 09, 2014 8:55 PM
To: Gretl users
Subject: [Gretl-users] progress indicator for time-consuming scripts
This is in response to Peter Summers' observation in
http://lists.wfu.edu/pipermail/gretl-users/2014-December/010481.html
It's a long story but I'll try to be brief.
Prior to gretl 1.9.91 we had a mechanism that appeared in the menubar of a script editor
window to indicate progress when a script took appreciable time to complete: a
"spinner" plus a "stop" button that could be used to halt execution of
the script. (At that time the output window didn't appear until execution of the
script was
finished.)
More recently, I figured it was preferable to open a script output window right away, and
show the spinner + stop-button in that window. In this way, we could arrange for partial
output to appear as it was produced, giving a more convincing impression that progress was
being made (see the newish "flush" command).
That worked up to a point, but after Peter's comment I realized that the policy
"open an output window right away and show a spinner and stop-button there" was
not always engaged; it depended, in a way that I hadn't intended, on certain user
choices.
I think this is now fixed in CVS and snapshots. Testing would be welcome. If you run a
time-consuming script in the GUI you should see the output window "come to the
front" with spinner and stopper.
(But if the script completes quickly you probably won't notice
this.)
This is quite tricky to code, and I'd be particularly interested if anyone is able to
provoke a crash (e.g. by pressing the stop button).
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users