home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18632 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.0 KB  |  44 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!casbah.acns.nwu.edu!lunde
  3. From: Albert-Lunde@nwu.edu (Albert Lunde)
  4. Subject: Advice on Event handling in Think Class Lib?
  5. Message-ID: <1992Nov19.050442.9257@news.acns.nwu.edu>
  6. Followup-To: comp.sys.mac.programmer
  7. Originator: lunde@casbah.acns.nwu.edu
  8. Sender: lunde@casbah.acns.nwu.edu (Albert Lunde)
  9. Reply-To: Albert-Lunde@nwu.edu (Albert Lunde)
  10. Organization: Northwestern University, Evanston, Illinois, USA
  11. References: <Nov19.040356.21609@yuma.ACNS.ColoState.EDU>
  12. Date: Thu, 19 Nov 1992 05:04:42 GMT
  13. Lines: 29
  14.  
  15. I'm trying to convert an ANSI C program to run under Think C 5 and the TCL
  16. application framework. The program reads an input file, writes an output
  17. file and posts messages to standard error and a log file.
  18.  
  19. I'm starting with the Tiny Edit demo (more or less), and plan to use
  20. the CEditText/CEditPane types in a window to display the standard error
  21. as the program runs. (I could almost do what I want in the generic C
  22. consol library, but I want a few file dialogs, alerts and controls.)
  23.  
  24. My problem is that I don't want to break up the old code into tiny chunks
  25. suitable for a short idle task, because this would mean saving a lot
  26. of state.  If I was writing this from scratch, I would call a secondary
  27. event loop at conveinent times in the old code (periodically and after
  28. output).  This secondary event loop would process a limited number of
  29. events, return on an idle event and have checks against deep recursion.
  30.  
  31. I would like advice from someone familar with TCL on if there is a way
  32. to use it's event handling to do this sort of thing in a non-violent
  33. way.  One issue is if I can safely call the TCL event methods from
  34. code that is being called by them. (Are the re-entreant?)
  35.  
  36. I thought of calling Process1Event from CApplication a couple of times.
  37.  
  38. Is this a good idea?
  39.  
  40.  
  41. -- 
  42.     Albert Lunde                      Albert-Lunde@nwu.edu
  43.                                       alunde@nuacvm.bitnet
  44.