Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcvax!ukc!icdoc!qmc-cs!stathis From: stathis@cs.qmc.ac.uk (Stathis Gikas) Newsgroups: comp.sys.mac.programmer Subject: MacApp v2.0b5 problem / ModalDialogs Message-ID: <1169@sequent.cs.qmc.ac.uk> Date: 23 Jul 89 11:44:06 GMT Reply-To: stathis@cs.qmc.ac.uk (Stathis Gikas) Organization: Computer Science Dept, Queen Mary College, University of London, UK. Lines: 84 Summary: Expires: Sender: Followup-To: Keywords: Hi there, I'm developing a User Interface for a configurable messaging system, whose semantic layer is implemented in C and runs on a Sun, while its syntactic layers (UI) run on a number of (different types of) remote hosts. The syntactic layer talks to the semantic layer via remote procedure cals. I'm coding the Mac UI. The Problem: ============ I need to display a modal UserName/Password dialog before I display the UI window(s). (The windows are the same for all users, but what is displayed in them depends on the particular user, as in a news/mail system) So, the last line in my MyUIDocument.doMakeViews method is a call to MyUIDocument.MakePaswdDialog When I run the UI, the dialog is displayed ok, the edit text / button items work fine, but when I hit the ok button, the program crashes into MAcsBug with the message: "exception #4 Non-68K instruction" Tracing the MacApp function TDialogView.PoseModaly shows that before returning the dismisser has the right value ('ok' or 'cancel') However, upon returning, it crashes with the above error message. Additional Information ====================== I've allready implemented the UI in MPW 2.0.2/MacApp 1.1.1 and everything worked fine. When we upgraded to MPW3.0/MacApp2.0b5 we thought we might as well take advantage of the new view architecture, which makes life much easier in terms of changing the appearance of windows/dialogs without having to recompile the whole thing. However, MacApp2x doesn't seem to like creating modal dialogs from its DoMakeViews method. If I called the MyUIDocument.MakePaswdDialog procedure from a menu (i.e from the .DoMenuCommand method) everything works fine. Checking the heaps shows that (usually) there is a bad master pointer somewhere. But the program has only executed MacApp-standard code up to this point (except the MakePaswdDialog code, which is mine, and in any case is a copy of the Cookbok code: BEGIN adWindow:=NewTemplateWindow(1512,NIL); aDialog:=TDialogView(adWindow.FindSubView('DLOG')); aDialog.SelectEditText('name',TRUE); dismisser:=aDialog.PoseModally; <----crashes here END; ) I have initialised the UDialog an UPrinting Units, and I have registered all my views. Environment =========== System B1 6.0.3 Finder B1 6.1 Mfinder 6.1b7 MPW 3.0 MacApp 2.0b5 Pascal 3.0 Any ideas? Has anybody implemented (in MAcApp2x) an application which puts up a modal dialog before displaying its windows? Solutions/ideas/comments greatly appreciated, as I'm getting desperate, and I'm thinking of going back to good old MacApp1.1.1... For people in the UK/London area: I might even buy you a drink :-) Thanks in advance. PS. I've only been using MacApp2x for a month, so it might be the case that I'm missing something really elementary/obvious. No flames please... -- ==================================================================== Stathis Gikas, (gw: cs.ucl.edu) Dep of Computer Science, (ARPA) stathis@cs.qmc.ac.uk Queen Mary College, (UUCP) stathis@qmc-cs.UUCP Mile End Rd, London E1 4NS, (AppleLink) UK0087 UK. Tel 01-980 4811 x 5245