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

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!byse.nada.kth.se!d88-jwa
  3. From: d88-jwa@byse.nada.kth.se (Jon WΣtte)
  4. Subject: Re: TCL, MultiFinder, and Progress Dialogs
  5. Message-ID: <1993Jan11.215603.26274@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: byse.nada.kth.se
  8. Organization: Royal Institute of Technology, Stockholm, Sweden
  9. References: <96290@rphroy.ph.gmr.com> <11JAN199316162844@comb1.comb.umd.edu>
  10. Date: Mon, 11 Jan 1993 21:56:03 GMT
  11. Lines: 41
  12.  
  13. In <11JAN199316162844@comb1.comb.umd.edu> stern@comb1.comb.umd.edu (Brian Stern; COMB) writes:
  14.  
  15. >>I want to have a progress dialog up for an operation that takes
  16. >>over a minute, so I've got the usual text string, and a horizontal
  17.  
  18. >>(1) let the Multifinder take time slices to update other programs,
  19. >>    I assume that WaitNextEvent will do it;
  20. >>(2) Have a "Cancel" button the user can push to cancel the 
  21. >>    operation.  This has me stuck.
  22.  
  23. >Call WNE with a mDownMask. If it returns true then call FindControl to get
  24. >the control handle (pass it theEvent.where as the point) and then
  25. >TrackControl. If TrackControl tells you that the mouseup occurred in
  26.  
  27. Actually, this is a bad thing to do to a TCL app; for instance
  28. AppleEvents would be lost because they are ALWAYS delivered
  29. regardless of event mask.
  30.  
  31. Instead, I usually put up a movable, modal dialog with the bar
  32. etc, and when I need to give idle time, I do:
  33.  
  34.     gSleepTime = 0 ;
  35.     gApplication -> Process1Event ( ) ;
  36.  
  37. If you can set up an Idle chore to do the idling, you could
  38. even have your dialog be the supervisor of the chore and have
  39. BeginDialog and EndDialog handle dialog ending.
  40.  
  41. So what does this do? Well, you can't call DoModalDialog if you
  42. cannot push the thing you're doing into a chore; you'll have
  43. to mimic the behaviour in your idle call. What remains is to
  44. handle DoCommand ( cmdCancel ) by overriding it in the
  45. CDLOGDirector.
  46.  
  47. Hope this helps,
  48.  
  49.                             / h+
  50. -- 
  51.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  52.    This signature is kept shorter than 4 lines in the interests of UseNet
  53.    S/N ratio.
  54.