home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!stanford.edu!kronos.arc.nasa.gov!joshr
- From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
- Subject: Re: TCL, MultiFinder, and Progress Dialogs
- Message-ID: <1993Jan12.202147.25517@kronos.arc.nasa.gov>
- Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
- Nntp-Posting-Host: mcc2.arc.nasa.gov
- Organization: NASA/ARC Information Sciences Division
- References: <96290@rphroy.ph.gmr.com>
- Date: Tue, 12 Jan 1993 20:21:47 GMT
- Lines: 52
-
- In article <96290@rphroy.ph.gmr.com> rrichter@link.ph.gmr.com (Roy Richter PH/32) writes:
- >I want to have a progress dialog up for an operation that takes
- >over a minute, so I've got the usual text string, and a horizontal
- >bar that fills up as the operation proceeds. It would be nice to
- >also:
- >
- >(1) let the Multifinder take time slices to update other programs,
- > I assume that WaitNextEvent will do it;
- >(2) Have a "Cancel" button the user can push to cancel the
- > operation. This has me stuck.
- >
- >I use the Class Library to manage the dialogs. That way, I just
- >GetGoodClicks and so on. In this case, I'm not passing control up the
- >line to let the DeskTop get the click and dispatch it. I wouldn't want
- >to break up my operation into a bunch of Tasks, that would be
- >hard--since I'm updating the progress dialog in a callback. I'd prefer
- >the MultiFinder timeout and clicks be self-contained in the callback.
- >That was I can use the callback in many places, as needed. Otherwise
- >I'd need to restucture the code into a Task everytime I thought a
- >time-slice was needed.
- >
- >Any hints?
- >
- >--
- >Roy Richter Internet: rrichter@ph.gmr.com
- >Physics Dept, GM Research UUCP: rphroy!rrichter
-
-
- One really sloppy method that I cannot see anyone recommending
- (discussion ?) is to call WaitNextEvent from within a loop,
- masking out all events so they remain in the queue until
- the appropriate time.
- But I don't think this is good.
-
- An easier (but not great) way to handle cancels
- is to use GetKeys and check for command-period.
-
- I have code to do this if anyone wants. The problem is that it will not
- work properly with some alternate keyboard systems (?) and
- inits (?) (I think. Check the Develop article where someone
- talks about repetitive strain injury and has to
- 'type' with her feet.)
-
-
-
-
-
- --
- ----------------------------------
- #include <std/disclaimer.h> Josh Rabinowitz, Mac TCL programmer
- joshr@kronos.arc.nasa.gov
- "Me lost my cookie at the disco." -- Cookie Monster
-