Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!ukc!etive!lfcs!nick From: nick@lfcs.ed.ac.uk (Nick Rothwell) Newsgroups: comp.sys.mac.programmer Subject: "DeltaMoveWindow"? Message-ID: <1908@etive.ed.ac.uk> Date: 3 May 89 10:40:16 GMT References: <1907@etive.ed.ac.uk> Sender: news@etive.ed.ac.uk Reply-To: nick@lfcs.ed.ac.uk (Nick Rothwell) Organization: LFCS Enya Admiration Society Lines: 25 I was rather surprised to find that the Window Manager doesn't have a DeltaMoveWindow trap - there's only MoveWindow, which is absolute. I have an application where each "document" (for want of a better word) appears in a number of small windows with WIND templates held in a resource file. If I'm opening several "documents" at once, I want the appearance of the windows to be staggered slightly in a diagonal down the screen, so that they're all visible. So, I had to hack up a "DeltaMoveWindow". This is what I came up with - ugly, but it seems to work. If anybody has a nicer way of doing this, I'd really like to know...! static void deltaMoveWindow(win, dx, dy) WindowPtr win; int dx, dy; { int oldX = -((WindowPeek) win)->port.portBits.bounds.left, oldY = -((WindowPeek) win)->port.portBits.bounds.top; MoveWindow(win, oldX + dx, oldY + dy, false); } Nick. Nick Rothwell, Laboratory for Foundations of Computer Science, Edinburgh. nick@lfcs.ed.ac.uk !mcvax!ukc!lfcs!nick ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ Fais que ton reve soit plus long que la nuit.