Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!decwrl!shlump.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.sys.mac.programmer Subject: Re: menu bar Keywords: masking menu bar Message-ID: <178@mountn.dec.com> Date: 24 May 89 15:32:17 GMT References: <2832@skivs.UUCP> Reply-To: minow%thundr.dec@decwrl.dec.com (Martin Minow) Distribution: usa Organization: Digital Equipment Corporation Lines: 57 In article <2832@skivs.UUCP> choi@skivs.UUCP (Al Choi) asks how to draw an image over the menu bar. I did the following to get a full-screen window, but note that it is very fragile: the menu bar still responds to mouse clicks, and desk accessories or inits such as superclock don't notice that you've covered the image. It works on both Mac SE's and color Mac II's. It has not been blessed by Apple. The actual drawing was done in response to the update event. show_window() { GrafPtr old_port; GetPort(&old_port); SelectWindow(screen_window); ObscureCursor(); ShowWindow(screen_window); /* * This is needed to get a full-screen window. * It effectively hides the menu bar. It must * be after ShowWindow(). */ CopyRgn(screen_window->clipRgn, screen_window->visRgn); SetPort(screen_window); InvalRect(&thePort->portRect); /* Trigger update event */ SetPort(old_port); } screen_window was defined as follows: SetRect( &window_bounds, 0, 0, screenBits.bounds.right - screenBits.bounds.left, screenBits.bounds.bottom - screenBits.bounds.top ); /* * Note that this window is the size of the entire screen, including * the menu bar. The call to CopyRgn in show_window() above * changes the clip region so the menu bar is covered. I have no * idea if this is strictly koscher. */ screen_window = NewWindow( NIL, /* Allocate storage */ &window_bounds, /* Screen size */ "\p", /* No title */ FALSE, /* Don't draw it yet */ plainDBox, /* Plain box */ BRING_TO_FRONT, /* Where on screen */ FALSE, /* No GoAway box */ 0 /* No refCon */ ); Hope this helps. Martin Minow minow%thundr.dec@decwrl.dec.com