Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!usc!apple!anderson From: anderson@Apple.COM (Clark Anderson) Newsgroups: comp.sys.mac.programmer Subject: Re: TCL problem with modal dialogs Keywords: TCL, modal dialog Message-ID: <44367@apple.Apple.COM> Date: 29 Aug 90 04:47:35 GMT References: <940@beguine.UUCP> Organization: Apple Computer Inc, Cupertino, CA Lines: 36 From: Mark.Saltzman@samba.acs.unc.edu (BBS Account) Subject: TCL problem with modal dialogs >When I use modal dialogs in Think C within the TCL starter project, I >always get and odd adress error somewhere inside the oops library if I dont >dispose of the dialog with DisposDialog. When I do Dispose of it, everything >works fine. But it seems that I should only have to load the dialog once >during my document initialization, use it as many times as I want using >Show window to activate it... Well, not really. If you wanted to do it that way (and do it right), you'd have to build all the dialogs yourself, using the TCL windowing routines, and re-implement the Modal Dialog routine, and write all the code to handle where the user clicks, etc. From my experience, it'd be more of a pain than it's worth, but you could do it. If you want to use dialogs that are resource-resident and use GetNewDialog and Modal Dialog with them, you have to call Dispose Dialog after you're done with it. No big deal. TCL can't handle the windows that the dialogs are in, because they're not of type CWindow, etc. The best way (for me, anyway) is to call GetNewDialog, Modal Dialog, do whatever has to be done, and blow the dialog away with DisposeDialog. Modeless dialogs, on the other hand, might be worth doing using the TCL routines. (Just my humble opinion) --clark -- ----------------------------------------------------------- Clark Anderson InterNet: anderson@apple.com PCB Software Tools AppleLink: C.ANDERSON Apple Computer, Inc BellNet: 408-974-4593 "I speak only for myself, much to my employer's relief..." -----------------------------------------------------------