Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!apple!kazim From: kazim@Apple.COM (Alex Kazim) Newsgroups: comp.sys.mac.programmer Subject: Re: Dialog Problems Summary: Beginner Trap # 1 Keywords: Dialog Manager, Draw Dialog, Modal Dialog Message-ID: <33261@apple.Apple.COM> Date: 18 Jul 89 18:01:27 GMT References: <331@wehi.dn.mu.oz> Organization: Apple Computer Inc, Cupertino, CA Lines: 26 In article <331@wehi.dn.mu.oz> jon@wehi.dn.mu.oz (Jon Eaves) writes: > >main() >{ > InitStuff(); > OpenResFile("\pRFile.rsrc"); > myDialog=GetNewDialog(myDLOGref,0,-1); >} > >The dialog gets drawn on the screen, but only the first two items are drawn >in it????? ( the OK/Cancel buttons ). > >What's wrong?, Have I fallen into 'Trap for Beginners #1 of 999' > Yup. Trap # 1. You need to call DrawDialog() (Inside Mac Vol 1) to display the items. Since your dialog has buttons, you probably want to call ModalDialog() to handle the events. In this case, you don't need to call DrawDialog() as ModalDialog() does this for you. ========================================================================= Alex Kazim, Apple Computer Mac Programming: Come on baby, make it hurt so good... =========================================================================