Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!hafro!isgate!krafla!sigurasg From: sigurasg@rhi.hi.is (Sigurdur Asgeirsson) Newsgroups: comp.sys.mac.programmer Subject: Using modeless dialogs in DAs Keywords: LSC DA Dialogs Modeless Message-ID: <1525@krafla.rhi.hi.is> Date: 16 Feb 90 22:31:49 GMT References: <1059ghassemi@yvax.byu.edu> <9958@hoptoad.uucp> Reply-To: sigurasg@rhi.hi.is (Sigurdur Asgeirsson) Organization: University of Iceland (RHI) Lines: 25 Help!! I'm trying to write a DA in LSC 4.0 and wanted to use a modeless dialog as its main window, but I have run into a few problems. In a DA you have to set the WindowKind field to your refNum so that the device manager can pass the events concerning the window to the DA (and handle dragging, closing etc.). However IsDialogEvent seems to want the WindowKind field set to dialogKind, and refuses to recognize any events at all. No sweat me thought, I'll just pass the events right on to DialogSelect without asking IsDialogEvent first, this seems to work as long as I run the damn thing as an application with the stuff in DA-stuff folder that comes with LSC, but as soon as I try to run it as a DA everything goes haywire. If I run it from LSC the DA shell 'unexpectedly quits' with errors 1,2 or 3. DA handler on the other hand just quietly leaves along with all DA's that are open at the time. I do have a couple of userItems in the dialog, and the error seems to be in the drawProc for one of those, but why does it work as an application, and not as a DA? Any help on this would be more than welcome. P.S. Is it OK for a DA to call SetDAFont? sigurasg@rhi.hi.is