home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sunic!kth.se!byse.nada.kth.se!d88-jwa
- From: d88-jwa@byse.nada.kth.se (Jon WΣtte)
- Subject: Re: TCL, MultiFinder, and Progress Dialogs
- Message-ID: <1993Jan11.215603.26274@kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: byse.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <96290@rphroy.ph.gmr.com> <11JAN199316162844@comb1.comb.umd.edu>
- Date: Mon, 11 Jan 1993 21:56:03 GMT
- Lines: 41
-
- In <11JAN199316162844@comb1.comb.umd.edu> stern@comb1.comb.umd.edu (Brian Stern; COMB) 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
-
- >>(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.
-
- >Call WNE with a mDownMask. If it returns true then call FindControl to get
- >the control handle (pass it theEvent.where as the point) and then
- >TrackControl. If TrackControl tells you that the mouseup occurred in
-
- Actually, this is a bad thing to do to a TCL app; for instance
- AppleEvents would be lost because they are ALWAYS delivered
- regardless of event mask.
-
- Instead, I usually put up a movable, modal dialog with the bar
- etc, and when I need to give idle time, I do:
-
- gSleepTime = 0 ;
- gApplication -> Process1Event ( ) ;
-
- If you can set up an Idle chore to do the idling, you could
- even have your dialog be the supervisor of the chore and have
- BeginDialog and EndDialog handle dialog ending.
-
- So what does this do? Well, you can't call DoModalDialog if you
- cannot push the thing you're doing into a chore; you'll have
- to mimic the behaviour in your idle call. What remains is to
- handle DoCommand ( cmdCancel ) by overriding it in the
- CDLOGDirector.
-
- Hope this helps,
-
- / h+
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
- This signature is kept shorter than 4 lines in the interests of UseNet
- S/N ratio.
-