home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21306 < prev    next >
Encoding:
Text File  |  1993-01-12  |  2.5 KB  |  65 lines

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