Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!ames!uhccux!munnari.oz.au!murtoa.cs.mu.oz.au!murdu!ucsvc!wehi!jon From: jon@wehi.dn.mu.oz (Jon Eaves) Newsgroups: comp.sys.mac.programmer Subject: Re: Dialog Problems Message-ID: <336@wehi.dn.mu.oz> Date: 19 Jul 89 23:20:56 GMT References: <331@wehi.dn.mu.oz> <17225@bellcore.bellcore.com> Organization: Walter & Eliza Hall Institute Lines: 46 In article <17225@bellcore.bellcore.com>, sdh@wind.bellcore.com (Stephen D Hawley) 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' > > if the dialog box is modal, you have to call DrawDialog(), I believe to get > it to show up. > > If it is a modelss dialog box, it will be drawn when you have you event loop > all patched together. When a dialog box is called up with GetNewDialog(), > only some of the items are drawn, the rest are taken care of by an update > event that is generated. If you have the IsDialogEvent() text and > DialogSelect(), the rest will be drawn auto-magically. > > clear? > Yup, thanks to all who replied. I was trying to get things working a bit at a time. ie. #1 -> draw the box, #2 -> process events for the box. However #1 and #2 are a little more closely tied than that. I have now the above code + for (;;) { ModalDialog(NIL,&itemHit); process(itemHit); } and it all works nicely. -------------------------------------------------------------------------------- Jon Eaves Walter and Eliza Hall Institute for Medical Research. "I have this feeling, my luck is not too good, this sword here at my side don't act the way it should" - BOC ACSnet ( jon@wehi.dn.mu.oz ) UUCP ( uunet!munnari!wehi.dn.mu.oz!jon ) Internet ( jon%wehi.dn.mu.oz@uunet.uu.net ) --------------------------------------------------------------------------------