home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!ames!kronos.arc.nasa.gov!joshr
- From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
- Newsgroups: comp.sys.mac.programmer
- Subject: TCL "documents"
- Summary: help me with TCL document, pls
- Keywords: TCL, window, document, thinkc
- Message-ID: <1992Aug17.200906.5393@kronos.arc.nasa.gov>
- Date: 17 Aug 92 20:09:06 GMT
- Sender: joshr@kronos.arc.nasa.gov
- Followup-To: joshr@kronos.arc.nasa.gov
- Distribution: comp.sys.mac.programmer
- Organization: NASA/ARC Information Sciences Division
- Lines: 82
- Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
-
-
- Hello, fellow netters, I have a fairly extensive
- set of questions that I hope to get nearer to
- answering.
-
- I am using thinkc5.02, a mac IIcx with 8megs, sys 7, and
- a SE/30 with 4 megs, and sys 7
- the program I am writing make heavy use of appleevents, so sys 6.x
- compatibility is not an issue. I am using the think class library 1.1
-
- My question centers around the appropriate way
- to make a CDocument-descendent that handles two windows. My present
- strategy was to make my descendent, CTOCDoc, like so:
-
- class CTOCDoc : public CDocument {
- public:
- CTOCTree *itsTree;
- CWindow *its2ndWindow;
- C2ndTOCPane *its2ndPane;
- CString *itsStackName;
- ...
- };
-
-
- the reason I made a its2ndPane member is as a parallel to itsMainPane.
- The desired behavior is to close the document when either
- of the document's windows are closed.
- The present behavior is that the document is closed when itsWindow
- is closed, but not when its2ndWindow is closed. In addition, there
- is a real subtle bug that I have trouble duplicating
- regularly that occurs only when its2ndWindow has been disposed: it appears
- that OCCASIONALLY a handle somewhere to the window is not being set to null
- after the window has been disposed of. I am SURE
- that all MY references are set correctly. The program often crashes in
- the below place:
-
- void CWindow::Dispose()
- {
- ...
- this->Hide();
- ...
- }
- when the window being refferred to has defineitly been already disposed
- of.
-
- It does not appear to be a memory management problem, that is, it does not
- surface with any more regularity while heap scrambling from macsbug.
-
- So, why is the problem occuring?
-
- Is there a "best" or "recommended" way of handling a multi-
- window document (a document, in TCL lingo, is an association of a
- file/set of files and A window).
-
- When I desire to close a window without the user clicking
- in the closebox, do I send the CWindow a Close() or a Dispose()
- message()?
-
- Also, I want to avoid opening the file twice if they choose the same file
- two times. What is a good method of the CApplication keeping track of
- its CDocuments?
-
- Can someone help me with debuging techniques?
-
- I welcome all TCL programmers (and others) replies. Email if you think
- others would not care. I will post a summary if I get anywhere.
-
- I realize this is a bunch of specialized questions, but I think you all
- can rise to the challenge.
- Please help me here, y'all! I realize Iv'e been working
- on this multi-window document thing for quite a while now.
-
- Thanks in advance.
-
-
-
-
- --
- ----------------------------------
- #include <std/disclaimer.h> Josh Rabinowitz, Mac TCL programmer
- joshr@kronos.arc.nasa.gov
- "'I see', said the blind carpenter, as he picked up his hammer and saw".
-