Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!wuarchive!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.sys.mac.programmer Subject: Re: Drawing in the menu bar (AGAIN) Message-ID: <1816@mountn.dec.com> Date: 3 Aug 90 00:45:56 GMT References: <9536@goofy.Apple.COM> <2900@isc-br.ISC-BR.COM> Reply-To: minow@bolt.enet.dec.com (Martin Minow) Organization: Digital Equipment Corporation Lines: 40 In article <2900@isc-br.ISC-BR.COM> jimc@isc-br.ISC-BR.COM (Jim Cathey) writes: >Small 1:1 >CopyBits, EraseRects, and the like should be just fine, shouldn't they? No. Would you like to see the scars? EraseRect (to take one example) is explicitly marked as "may move memory." In fact, not even InvalRect is safe. To return to the original question, there are two techniques you can use to draw over the menubar: -- save the old MBarHeight, set it to zero and (I'm not sure what happens next, but I think you can now open a window that covers the screen). Advantage: SuperClock and notification stuff shut up. Disadvantage: Better restore the MBarHeight before your program exits! -- Hack: the following worked for me: SelectWindow(window); ObscureCursor(); ShowWindow(window); /* * This is needed to get a full-screen window. * It effectively hides the menu bar. It must * be after ShowWindow(). * * The update event eventually causes the display to happen. */ CopyRgn(window->clipRgn, window->visRgn); SetPort(window); InvalRect(&thePort->portRect); Advantage: No loss if your program crashes. Disadvantage: Notifications and SuperClock (and anything else that tries to draw in the MenuBar) overwrite your window. I used this hack for a program that runs on a display server -- the "window" is the only thing that is visible, and there is no interaction on that computer. MacDTS steadfastly refuses to tell us weenies the "approved" method. Martin Minow minow@bolt.enet.dec.com