Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!tut.cis.ohio-state.edu!sei!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!pt.cs.cmu.edu!henry!hairston From: hairston@henry.ece.cmu.edu (David Hairston) Newsgroups: comp.sys.mac.programmer Subject: Re: Getting Rid of the Menu Bar (again!) Message-ID: Date: 22 Jan 91 17:20:09 GMT References: <91021.231449CXT105@psuvm.psu.edu> Organization: Gaia II Lines: 53 In-reply-to: CXT105@psuvm.psu.edu's message of 22 Jan 91 04:14:49 GMT [CXT105@psuvm.psu.edu (Christopher Tate) writes:] [] How do I make the menu bar go away, so that I can draw where it usually [] sits? Specifically, I want to open a window the size of the screen, and [] obscure the menu bar with it. I'm writing a screen saver (yes, I know; [] the last thing we need is *another* screen saver, but there are legal [] reasons for this project), and the window has to be put up (and the menu [] bar taken care of) from within a trap patch. I've gotten the window to [] display beautifully, but the menu bar stays visible. [] [] As I recall, getting rid of the menu bar involves setting the low-memory [] global MBarHeight to zero, and calling DrawMenuBar(). There's more to it [] than that, though, because I'm *doing* that, and it doesn't work! Do I [] need to set the clip region of the Window Manager GrafPort to include the [] menu bar? That sounds pretty hairy.... try to get a hold of Lunarmobiscuit's Darkness or Tom Dowdy's Darkside of the Mac (should be available at sumex) for example source code. i think there are two strategies for getting rid of the menu bar (i've only used one myself, haven't figured the other one out yet ...) 1) the window manager likes to enforce the menu bar so you have to "override" this intrusion. setting MBarHeight = 0 and then doing a DrawMenuBar() is useful for "cooperative" code (i.e. this will get rid of SuperClock). you can draw in the menu bar by adding that region to your window's visRgn. as an example, you could get the gdRect of the screen of interest and RectRgn() it to a region and then UnionRgn() this to ()->visRgn. overkill but it's simple ... 2) haven't tried this ... but the idea is to get the window manager to do your dirty work for you. since the window manager determines the menu bar height from the size of the system font, you have to "convince" the window manager that the system font has height 0. the manager manager will then automatically give you a visRgn over the entire screen and not draw the menu bar, etc. if anyone has done this and is willing to share a pointer, i'd like to hear about it ... [] I'm using THINK C, so my globals are referenced off of A4 instead of A5. [] Is this going to cause problems? (I'm saving and restoring ALL registers [] that I use in the trap patches, and I'm *NOT* tail patching anything!) [] The traps I'm patching are _SystemEvent (to look for events that will [] cancel or delay the screen-saving) and _SystemTask (to get periodic time [] without all the hassle of VBL tasks). _personally_, i think a screensaver should not involve trap patches. i believe you can do all you want simply using MultiFinder but, obviously, you have to assume MultiFinder. with system 7, that's not a bad assumption ... ;) -dave- hairston@henry.ece.cmu.edu