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