Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!hsdndev!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Windows and controls Message-ID: <20586@unix.SRI.COM> Date: 30 Jan 91 17:37:15 GMT References: <1991Jan30.030241.27264@ux1.cso.uiuc.edu> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 47 Even thought I'm not a C programmer I'll take a stab at it. In article <1991Jan30.030241.27264@ux1.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes: >void MakeNewWindow(WindowPtr myWindow, StringPtr windowName) >{ > GetNewWindow(128, myWindow, -1L); > SetPort(myWindow); --> ShowWindow(myWindow); > GetNewControl(128, myWindow); > GetNewControl(129, myWindow); > GetNewControl(130, myWindow); > SetWTitle(myWindow, windowName); --> BeginUpdate(myWindow); --> EraseRect(&myWindow->portRect); > DrawGrowIcon(myWindow); > DrawControls(myWindow); --> EndUpdate(myWindow); --> ShowWindow(myWindow); >} I'm assuming that your are calling every thing correctly and that you do get a valid window. I'm also assuming that the window is invisible and that your sample program does not have an update routine. You need to show your window as soon as possible because you don't service an update event. You also don't need the beginupdate/endupdate. Even if you did have an update routine those calls would cancel the update event. (because it assumes that you just did an update) You don't need to erase the window or the last showwindow either. Matt -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@QM.SRI.COM SRI International | my SUN mxmora@unix.sri.com ___________________________________________________________