home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14097 < prev    next >
Encoding:
Text File  |  1992-08-17  |  3.3 KB  |  98 lines

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!ames!kronos.arc.nasa.gov!joshr
  2. From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: TCL "documents"
  5. Summary: help me with TCL document, pls
  6. Keywords: TCL, window, document, thinkc
  7. Message-ID: <1992Aug17.200906.5393@kronos.arc.nasa.gov>
  8. Date: 17 Aug 92 20:09:06 GMT
  9. Sender: joshr@kronos.arc.nasa.gov
  10. Followup-To: joshr@kronos.arc.nasa.gov
  11. Distribution: comp.sys.mac.programmer
  12. Organization: NASA/ARC Information Sciences Division
  13. Lines: 82
  14. Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
  15.  
  16.  
  17. Hello, fellow netters, I have a fairly extensive
  18. set of questions that I hope to get nearer to 
  19. answering.
  20.  
  21. I am using thinkc5.02, a mac IIcx with 8megs, sys 7, and
  22.                a SE/30 with 4 megs, and sys 7
  23. the program I am writing make heavy use of appleevents, so sys 6.x
  24. compatibility is not an issue.  I am using the think class library 1.1
  25.  
  26. My question centers around the appropriate way
  27. to make a CDocument-descendent that handles two windows.  My present
  28. strategy was to make my descendent, CTOCDoc, like so:
  29.  
  30. class CTOCDoc : public CDocument {
  31. public:
  32.    CTOCTree *itsTree;
  33.    CWindow *its2ndWindow;
  34.    C2ndTOCPane *its2ndPane;
  35.    CString *itsStackName;
  36.    ...
  37. };
  38.  
  39.  
  40. the reason I made a its2ndPane member is as a parallel to itsMainPane.
  41. The desired behavior is to close the document when either 
  42. of the document's windows are closed.
  43. The present behavior is that the document is closed when itsWindow
  44. is closed, but not when its2ndWindow is closed.  In addition, there 
  45. is a real subtle bug that I have trouble duplicating
  46. regularly that occurs only when its2ndWindow has been disposed: it appears
  47. that OCCASIONALLY  a handle somewhere to the window is not being set to null
  48. after the window has been disposed of.  I am SURE 
  49. that all MY references are set correctly.  The program often crashes in
  50. the below place:
  51.  
  52. void    CWindow::Dispose()
  53. {
  54. ... 
  55.    this->Hide();                    
  56. ...
  57. }   
  58. when the window being refferred to has defineitly been already disposed
  59. of.
  60.  
  61. It does not appear to be a memory management problem, that is, it does not
  62. surface with any more regularity while heap scrambling from macsbug.
  63.  
  64. So, why is the problem occuring?
  65.  
  66. Is there a "best" or "recommended" way of handling a multi-
  67. window document (a document, in TCL lingo, is an association of a 
  68. file/set of files and A window). 
  69.  
  70. When I desire to close a window without the user clicking
  71. in the closebox, do I send the CWindow a Close() or a Dispose() 
  72. message()? 
  73.  
  74. Also, I want to avoid opening the file twice if they choose the same file
  75. two times.  What is a good method of the CApplication keeping track of
  76. its CDocuments?
  77.  
  78. Can someone help me with debuging techniques?  
  79.  
  80. I welcome all TCL programmers (and others) replies.  Email if you think
  81. others would not care.  I will post a summary if I get anywhere.
  82.  
  83. I realize this is a bunch of specialized questions, but I think you all 
  84. can rise to the challenge.
  85. Please help me here, y'all! I realize Iv'e been working
  86. on this multi-window document thing for quite a while now.
  87.  
  88. Thanks in advance. 
  89.  
  90.  
  91.  
  92.  
  93. -- 
  94. ----------------------------------
  95. #include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
  96. joshr@kronos.arc.nasa.gov
  97. "'I see', said the blind carpenter, as he picked up his hammer and saw".
  98.