in reply to Re: Tk buttons: Run/Cancel
in thread Tk buttons: Run/Cancel

I have thought of this method (or something similar, using a global variable). However, I don't think this method would work here. My Run callback is something like this:

foreach(@list){ DoLongBlockingThing($_); }

so, I would need the cancel button to immediately break the LongBlockingThing() routine and not have to wait for the loop to come around and check the presence of the temp file (or variable).

Replies are listed 'Best First'.
Re: Re: Re: Tk buttons: Run/Cancel
by meredith (Friar) on Aug 14, 2003 at 03:28 UTC
    Well, noting your reply above also, I would fork and store the child pid somewhere (file or well-scoped variable), then have your cancel button shoot a kill at it. :) would this solve your problem?

    mhoward - at - hattmoward.org