Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!olivea!uunet!blkcat!f421.n109.z1.fidonet.org!Glenn.Mcpherson From: Glenn.Mcpherson@f421.n109.z1.fidonet.org (Glenn Mcpherson) Newsgroups: comp.sys.mac.hypercard Subject: Re: Centering Modal Dialog Message-ID: <3031.278D9BF1@blkcat.fidonet.org> Date: 11 Jan 91 02:00:55 GMT Sender: ufgate@blkcat.fidonet.org (newsout1.26) Organization: FidoNet node 1:109/421 - The Twilight Clone, Paul Heller Lines: 40 > I'll bet this has been asked before. Is there any way to cause > HyperCard's modal dialogs to center themselves on the card window > rather than on the physical screen? Try the following Think C code: /* pp is the XCmdPtr that Hypercard gives you... */ Rect r; Handle res; int h, v; int wHor = 102, wVer = 50; /* you set these! */ theRes = EvalExpr(pp, "\pthe rect of card window"); if(theRes == NIL) /* ERROR! */; HLock( theRes ); CtoPstr( *theRes ); StrToRect( pp, *theRes, &r ); HUnlock( theRes ); DisposHandle( theRes ); h = (r.right - r.left - wHor) / 2 + r.left; v = (r.bottom - r.top - wVer) / 2 + r.top; SetRect(&r, h, v, h + wHor, v + wVer); /* use "r" to open a window... */ Hope this helps... Glenn McPherson Somewhere on Fidonet! -- Glenn Mcpherson, Glenn.Mcpherson@f421.n109.z1.fidonet.org via The Black Cat's Shack's FidoNet<->Usenet Gateway blkcat.fidonet.org and Fidonet 1:109/401