Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!ucsd!pacbell.com!pacbell!well!wdh From: wdh@well.sf.ca.us (Bill Hofmann) Newsgroups: comp.sys.mac.programmer Subject: Re: MacApp model dialogs (was Re: Scrolling lists in dialogs) Keywords: modal dialogs, alerts, centre, center Message-ID: <22233@well.sf.ca.us> Date: 18 Dec 90 17:23:01 GMT References: <2896@ux.acs.umn.edu> <1990Dec14.165910.27928@actrix.gen.nz> <458@spam.ua.oz> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 19 In article <458@spam.ua.oz> jnixon@spam.ua.oz (John Nixon) writes: >The problem is, I would also like to >be able to centre (or center --- when in Rome ...) these ``built-in'' >alerts/dialogs. Could some kind soul let me know if this is possible? Yes. The process is: 1. Call GetResource('ALRT', ) and save into an AlertTHndl variable 2. The first field in an AlertTemplate is the boundsRect of the alert window. 3. Manipulate the boundsRect in memory to center it (screenBits.bounds, or on a ColorQD machine, find the GDevice you want to center it on) This boundsRect is in global coordinates. 4. Call Alert() or NoteAlert(), etc. 5. Since Alert... calls GetResource('ALRT',), it'll get your manipulated data. 6. That's all there is. Don't mark the resource changed. -Bill Hofmann